suidouble 1.9.0 → 1.11.0
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/SuiCoin.js +2 -2
- package/lib/SuiPackage.js +10 -6
- package/package.json +2 -2
package/lib/SuiCoin.js
CHANGED
|
@@ -244,14 +244,14 @@ class SuiCoin {
|
|
|
244
244
|
return coinInput;
|
|
245
245
|
} else {
|
|
246
246
|
// some other coin
|
|
247
|
-
const coinInput = txb.add(Commands.SplitCoins(txb.object(coinIds[0]), [txb.pure(expectedAmountAsBigInt)]));
|
|
247
|
+
const coinInput = txb.add(Commands.SplitCoins(txb.object(coinIds[0]), [txb.pure.u64(expectedAmountAsBigInt)]));
|
|
248
248
|
return coinInput;
|
|
249
249
|
}
|
|
250
250
|
} else {
|
|
251
251
|
// few coin objects to merge
|
|
252
252
|
const coinIdToMergeIn = coinIds.shift();
|
|
253
253
|
txb.add(Commands.MergeCoins(txb.object(coinIdToMergeIn), coinIds.map((id)=>{return txb.object(id);})));
|
|
254
|
-
const coinInputSplet = txb.add(Commands.SplitCoins(txb.object(coinIdToMergeIn), [txb.pure(expectedAmountAsBigInt)]));
|
|
254
|
+
const coinInputSplet = txb.add(Commands.SplitCoins(txb.object(coinIdToMergeIn), [txb.pure.u64(expectedAmountAsBigInt)]));
|
|
255
255
|
|
|
256
256
|
return coinInputSplet;
|
|
257
257
|
}
|
package/lib/SuiPackage.js
CHANGED
|
@@ -394,9 +394,9 @@ class SuiPackage extends SuiObject {
|
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
396
|
|
|
397
|
-
async publish() {
|
|
397
|
+
async publish(params = {}) {
|
|
398
398
|
if (!this._isBuilt) {
|
|
399
|
-
await this.build();
|
|
399
|
+
await this.build(params);
|
|
400
400
|
}
|
|
401
401
|
if (this.address) {
|
|
402
402
|
throw new Error('already published. Maybe you need to upgrade() it?');
|
|
@@ -438,11 +438,11 @@ class SuiPackage extends SuiObject {
|
|
|
438
438
|
return this.address;
|
|
439
439
|
}
|
|
440
440
|
|
|
441
|
-
async upgrade() {
|
|
441
|
+
async upgrade(params = {}) {
|
|
442
442
|
await this.checkOnChainIfNeeded();
|
|
443
443
|
|
|
444
444
|
if (!this._isBuilt) {
|
|
445
|
-
await this.build();
|
|
445
|
+
await this.build(params);
|
|
446
446
|
}
|
|
447
447
|
|
|
448
448
|
this.log('upgrading package...');
|
|
@@ -503,7 +503,7 @@ class SuiPackage extends SuiObject {
|
|
|
503
503
|
* Build a Move project using `sui move build`
|
|
504
504
|
* @returns Boolean true on success
|
|
505
505
|
*/
|
|
506
|
-
async build() {
|
|
506
|
+
async build(params = {}) {
|
|
507
507
|
this.log('builing a package...');
|
|
508
508
|
|
|
509
509
|
const path = this._path;
|
|
@@ -512,7 +512,11 @@ class SuiPackage extends SuiObject {
|
|
|
512
512
|
throw new Error('Cant build a package with no path defined');
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
-
|
|
515
|
+
let command = `sui move build --dump-bytecode-as-base64 --path ${path}`;
|
|
516
|
+
if (params.withUnpublishedDependencies) {
|
|
517
|
+
command = `sui move build --with-unpublished-dependencies --dump-bytecode-as-base64 --path ${path}`;
|
|
518
|
+
}
|
|
519
|
+
const buildResult = await SuiCliCommands.exec(command);
|
|
516
520
|
const { modules, dependencies, digest } = JSON.parse(buildResult);
|
|
517
521
|
|
|
518
522
|
this._builtModules = modules;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "suidouble",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
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": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"author": "Jeka Kiselyov <jeka911@gmail.com> (https://github.com/jeka-kiselyov)",
|
|
22
22
|
"license": "Apache-2.0",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@mysten/sui": "^1.
|
|
24
|
+
"@mysten/sui": "^1.11.0",
|
|
25
25
|
"@wallet-standard/core": "^1.0.3",
|
|
26
26
|
"websocket": "^1.0.35"
|
|
27
27
|
},
|