Skip to content

Commit

Permalink
feat(top up): allow eth/sol destination for fiat top up PE-6034
Browse files Browse the repository at this point in the history
  • Loading branch information
fedellen committed Apr 24, 2024
1 parent fd9663b commit 8ca05ab
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,26 @@ if (process.platform === 'darwin') {
}
```

##### Top up to ETH or SOL wallets

```ts
const turbo = TurboFactory.unauthenticated({ token: 'ethereum' });

const { url, winc, paymentAmount } = await turbo.createCheckoutSession({
amount: USD(10.0), // $10.00 USD
owner: publicEthereumAddress,
});
```

```ts
const turbo = TurboFactory.unauthenticated({ token: 'solana' });

const { url, winc, paymentAmount } = await turbo.createCheckoutSession({
amount: USD(10.0), // $10.00 USD
owner: publicSolanaAddress,
});
```

#### `uploadFile({ fileStreamFactory, fileSizeFactory, signal, dataItemOpts })`

Signs and uploads a raw file. The provided `fileStreamFactory` should produce a NEW file data stream each time is it invoked. The `fileSizeFactory` is a function that returns the size of the file. The `signal` is an optional [AbortSignal] that can be used to cancel the upload or timeout the request. `dataItemOpts` is an optional object that can be used to configure tags, target, and anchor for the data item upload.
Expand Down
2 changes: 1 addition & 1 deletion src/common/payment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class TurboUnauthenticatedPaymentService
promoCodes.length > 0
? `&${this.appendPromoCodesToQuery(promoCodes)}`
: ''
}`;
}&token=${this.token}`;

const { adjustments, paymentSession, topUpQuote } =
await this.httpService.get<TopUpRawResponse>({
Expand Down

0 comments on commit 8ca05ab

Please sign in to comment.