suidouble 0.0.21 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/SuiPackageModule.js +7 -0
- package/package.json +1 -1
package/lib/SuiPackageModule.js
CHANGED
|
@@ -116,15 +116,22 @@ class SuiPackageModule extends SuiCommonMethods {
|
|
|
116
116
|
const tx = new sui.TransactionBlock();
|
|
117
117
|
|
|
118
118
|
const callArgs = [];
|
|
119
|
+
|
|
119
120
|
for (let param of params) {
|
|
120
121
|
if (param && param.type && param.amount && param.type === 'SUI') {
|
|
121
122
|
let amount = BigInt(param.amount);
|
|
122
123
|
const coin = tx.add(sui.Transactions.SplitCoins(tx.gas, [tx.pure(amount)]));
|
|
123
124
|
callArgs.push(coin);
|
|
125
|
+
} else if (param && Array.isArray(param) && param.length == 1 && param[0].type && param[0].amount && param[0].type === 'SUI') {
|
|
126
|
+
// vector<Coin<SUI>>
|
|
127
|
+
let amount = BigInt(param[0].amount);
|
|
128
|
+
const coin = tx.add(sui.Transactions.SplitCoins(tx.gas, [tx.pure(amount)]));
|
|
129
|
+
callArgs.push(tx.makeMoveVec({ objects: [coin]}));
|
|
124
130
|
} else {
|
|
125
131
|
callArgs.push(tx.pure(param));
|
|
126
132
|
}
|
|
127
133
|
}
|
|
134
|
+
|
|
128
135
|
tx.moveCall({
|
|
129
136
|
target: `${this._package.address}::${this._moduleName}::${methodName}`,
|
|
130
137
|
arguments: callArgs,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suidouble",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|