Skip to content

Commit

Permalink
readme + changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase committed Aug 12, 2024
1 parent e04f3f7 commit f766754
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added

- USD value conversion details to the StakingReward object
- Gasless USDC Sends

## [0.0.14] - 2024-08-05

Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,14 @@ const transfer = await wallet.createTransfer({ amount: 0.00001, assetId: Coinbas
```


### Gasless USDC Transfers

To transfer USDC without needing to hold ETH for gas, you can use the `createTransfer` method with the `gasless` option set to `true`.
```typescript
const transfer = await wallet.createTransfer({ amount: 0.00001, assetId: Coinbase.assets.Usdc, destination: anotherWallet, gasless: true });
```


### Trading Funds

```typescript
Expand Down
3 changes: 3 additions & 0 deletions src/coinbase/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ export class Wallet {
* @param options.destination - The destination of the transfer. If a Wallet, sends to the Wallet's default address. If a String, interprets it as the address ID.
* @param options.timeoutSeconds - The maximum amount of time to wait for the Transfer to complete, in seconds.
* @param options.intervalSeconds - The interval at which to poll the Network for Transfer status, in seconds.
* @param options.gasless - Whether the Transfer should be gasless. Defaults to false.
* @returns The hash of the Transfer transaction.
* @throws {APIError} if the API request to create a Transfer fails.
* @throws {APIError} if the API request to broadcast a Transfer fails.
Expand All @@ -713,6 +714,7 @@ export class Wallet {
destination,
timeoutSeconds = 10,
intervalSeconds = 0.2,
gasless = false,
}: CreateTransferOptions): Promise<Transfer> {
if (!this.getDefaultAddress()) {
throw new InternalError("Default address not found");
Expand All @@ -723,6 +725,7 @@ export class Wallet {
destination,
timeoutSeconds,
intervalSeconds,
gasless,
});
}

Expand Down

0 comments on commit f766754

Please sign in to comment.