Skip to content

Commit

Permalink
[TS SDK] Adding paySui, payAllSui to local-serializer (MystenLabs#8181)
Browse files Browse the repository at this point in the history
  • Loading branch information
healthydeve authored Feb 11, 2023
1 parent c3b63f9 commit ebe6c39
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-cows-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mysten/sui.js": patch
---

Support deserializing `paySui` and `payAllSui` transactions
2 changes: 2 additions & 0 deletions sdk/typescript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ Troubleshooting:

If you see errors like `ECONNRESET or "socket hang up"`, run `node -v` to make sure your node version is `v18.x.x`. Refer to this [guide](https://blog.logrocket.com/how-switch-node-js-versions-nvm/) to switch node version.

Some more follow up here is if you used homebrew to install node, there could be multiple paths to node on your machine. https://stackoverflow.com/questions/52676244/node-version-not-updating-after-nvm-use-on-mac

To run E2E tests against DevNet

```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,23 @@ export class LocalTxnDataSerializer implements TxnDataSerializer {
gasPrice,
},
};
} else if ('PaySui' in tx) {
return {
kind: 'paySui',
data: {
inputCoins: tx.PaySui.coins.map((c) => c.objectId),
recipients: tx.PaySui.recipients,
amounts: tx.PaySui.amounts,
},
};
} else if ('PayAllSui' in tx) {
return {
kind: 'payAllSui',
data: {
inputCoins: tx.PayAllSui.coins.map((c) => c.objectId),
recipient: tx.PayAllSui.recipient,
},
};
}
throw new Error(`Unsupported transaction type ${tx}`);
}
Expand Down

0 comments on commit ebe6c39

Please sign in to comment.