Skip to content

Commit

Permalink
[chore] Update README Docs for Transfer / Trade wait() (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
John-peterson-coinbase authored Aug 28, 2024
1 parent ba4c9e0 commit 51977e3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,15 +154,17 @@ console.log(`Faucet transaction: ${faucetTransaction}`);
// Create a new Wallet to transfer funds to.
// Then, we can transfer 0.00001 ETH out of the Wallet to another Wallet.
const anotherWallet = await Wallet.create();
const transfer = await wallet.createTransfer({ amount: 0.00001, assetId: Coinbase.assets.Eth, destination: anotherWallet });
let transfer = await wallet.createTransfer({ amount: 0.00001, assetId: Coinbase.assets.Eth, destination: anotherWallet });
transfer = await transfer.wait();
```


### 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 });
let transfer = await wallet.createTransfer({ amount: 0.00001, assetId: Coinbase.assets.Usdc, destination: anotherWallet, gasless: true });
transfer = await transfer.wait();
```


Expand All @@ -178,8 +180,9 @@ console.log(`Wallet successfully created: ${mainnetWallet}`);

// Trade 0.00001 ETH to USDC
let trade = await wallet.createTrade({ amount: 0.00001, fromAssetId: Coinbase.assets.Eth, toAssetId: Coinbase.assets.Usdc });
trade = await trade.wait();

console.log(`Second trade successfully completed: ${trade}`);
console.log(`Trade successfully completed: ${trade}`);
```

### Re-Instantiating Wallets
Expand Down

0 comments on commit 51977e3

Please sign in to comment.