Skip to content

Commit

Permalink
[Wallet SDK] Port useful changes from MGI guide to the generic Sep-24…
Browse files Browse the repository at this point in the history
… guide (#930)

* Consolidate 'token' => 'authToken' in all places

* Fix typos

* Port useful changes from MGI guide to this Sep-24 guide

* Expand on stellar id hash format
  • Loading branch information
CassioMG authored Aug 21, 2024
1 parent 3a7f719 commit 443e2ec
Show file tree
Hide file tree
Showing 3 changed files with 210 additions and 38 deletions.
4 changes: 3 additions & 1 deletion docs/build/apps/moneygram-access-integration-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ The provided reference number would then be taken to any MoneyGram cash agent in

## Generate Stellar Keypairs

In this section, you will generate at least two Stellar keypairs, one that will be used to prove your application’s identity when authenticating with MoneyGram Access, and another that will hold, send, & receive USDC on Stellar. You should always use one keypair for authentication, but application could use many keypairs for sending & receiving payments. In this guide, we'll assume the application uses one keypair for each purpose.
In this section, you will generate at least two Stellar keypairs, one that will be used to prove your application’s identity when authenticating with MoneyGram Access, and another that will hold, send & receive USDC on Stellar. You should always use one keypair for authentication, but application could use many keypairs for sending & receiving payments. In this guide, we'll assume the application uses one keypair for each purpose.

This section assumes that your application does not have any support for the Stellar network. If your application already supports deposits & withdrawals of XLM, you already have one or more Stellar accounts that can be used for these purposes, although it is heavily encouraged to use a new keypair for authentication.

Expand Down Expand Up @@ -394,6 +394,8 @@ const transaction = await anchor.sep24().getTransactionBy({
// "stellarTransactionId" (aka "stellar_transaction_id" on the SEP spec)
// is the hash of the Stellar network transaction payment related to this
// Anchor transaction.
// The "stellarTransactionId" has a SHA256 hash format like the below:
// - "a35135d8ed4b29b66d821444f6760f8ca1e77bea1fb49541bebeb2c3d844364a"
// E.g. we'll only have this transaction id field AFTER the wallet sends funds
// to Anchor on the withdrawal flow or receives funds from Anchor on the
// deposit flow.
Expand Down
6 changes: 3 additions & 3 deletions docs/build/apps/wallet/sep10.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -150,18 +150,18 @@ Let's add authentication with a bearer token. Simply update the request transfor
<CodeExample>

```kotlin
val signer = WalletSigner.DomainSigner("https://demo-wallet-server.stellar.org/sign") { bearerAuth("token") }
val signer = WalletSigner.DomainSigner("https://demo-wallet-server.stellar.org/sign") { bearerAuth("authToken") }
```

```typescript
const signer = new DomainSigner("https://demo-wallet-server.stellar.org/sign", {
Authorization: `Bearer ${token}`,
Authorization: `Bearer ${authToken}`,
});
```

```dart
Map<String, String> requestHeaders = {
"Authorization": "Bearer $token",
"Authorization": "Bearer $authToken",
"Content-Type": "application/json"
};
Expand Down
Loading

0 comments on commit 443e2ec

Please sign in to comment.