Skip to content

Commit

Permalink
[docs] add an example of sending a token (#20779)
Browse files Browse the repository at this point in the history
## Description 
fix #20725  

add an example of sending a coin other than sui coin


---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:

---------

Co-authored-by: ronny-mysten <[email protected]>
  • Loading branch information
klren0312 and ronny-mysten authored Jan 6, 2025
1 parent 675c10b commit bbc432b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/content/guides/developer/sui-101/building-ptb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ With PTBs, you can use the gas payment coin to construct coins with a set balanc

You can also transfer the gas coin using `transferObjects`, in the event that you want to transfer all of your coin balance to another address.

Of course, you can also transfer other coins in your wallet using their `Object ID`. For example,

```ts
const otherCoin = tx.object('0xCoinObjectId');
const coin = tx.splitCoins(otherCoin, [tx.pure(100)]);
tx.transferObjects([coin], tx.pure(address));
```

## Get PTB bytes

If you need the PTB bytes, instead of signing or executing the PTB, you can use the `build` method on the transaction builder itself.
Expand Down

0 comments on commit bbc432b

Please sign in to comment.