@@ -145,6 +145,69 @@ curl -X 'POST' \
145
145
# }
146
146
```
147
147
148
+ You can also use the ` /transactions/build ` endpoint to build a token transfer transaction:
149
+
150
+ ``` shell
151
+ curl -X ' POST' \
152
+ ' http://127.0.0.1:22973/transactions/build' \
153
+ -H ' accept: application/json' \
154
+ -H ' Content-Type: application/json' \
155
+ -d ' {
156
+ "fromPublicKey": "0381818e63bd9e35a5489b52a430accefc608fd60aa2c7c0d1b393b5239aedf6b0",
157
+ "destinations": [
158
+ {
159
+ "address": "1C2RAVWSuaXw8xtUxqVERR7ChKBE1XgscNFw73NSHE1v3",
160
+ "tokens": [
161
+ {
162
+ "id": "19246e8c2899bc258a1156e08466e3cdd3323da756d8a543c7fc911847b96f00",
163
+ "amount": "1000000000000000000"
164
+ }
165
+ ],
166
+ }
167
+ ]
168
+ }'
169
+ ```
170
+
171
+ In addition to using the raw endpoint, you can also refer to [ this guide] ( ../sdk/transaction.md ) on how to use the ` @alephium/web3 ` SDK to build and send transactions.
172
+
173
+ The ` @alephium/web3 ` SDK also provides APIs to extract ALPH and token deposits from a transaction:
174
+
175
+ ``` typescript
176
+ import { getALPHDepositInfo , getDepositInfo , getSenderAddress } from ' @alephium/web3'
177
+
178
+ // extract ALPH deposit info from a transaction
179
+ const alphDepositInfo = getALPHDepositInfo (tx )
180
+ // [
181
+ // {
182
+ // targetAddress: '1khyjTYdKEyCSyg6SqyDf97Vq3EmSJF9zPugb3KYERP8',
183
+ // depositAmount: 1000000000000000000n
184
+ // }
185
+ // ]
186
+
187
+ // get the sender address of the deposit transaction
188
+ const senderAddress = getSenderAddress (tx )
189
+
190
+ // extract ALPH and token deposit info from a transaction
191
+ const depositInfo = getDepositInfo (tx )
192
+ // {
193
+ // alph: [
194
+ // {
195
+ // targetAddress: '1khyjTYdKEyCSyg6SqyDf97Vq3EmSJF9zPugb3KYERP8',
196
+ // depositAmount: 1000000000000000000n
197
+ // }
198
+ // ],
199
+ // tokens: [
200
+ // {
201
+ // tokenId: '19246e8c2899bc258a1156e08466e3cdd3323da756d8a543c7fc911847b96f00',
202
+ // targetAddress: '1khyjTYdKEyCSyg6SqyDf97Vq3EmSJF9zPugb3KYERP8',
203
+ // depositAmount: 1000000000000000000n
204
+ // }
205
+ // ]
206
+ // }
207
+ ```
208
+
209
+ You can filter the deposit information sent to your exchange address by ` targetAddress ` and ` tokenId ` .
210
+
148
211
## Block APIs
149
212
150
213
### Get block hash with transaction ID
0 commit comments