@msafe/sui3-sdk 0.0.52-pre-3eeb6fb.0 → 0.0.52
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/dist/index.cjs +4 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +5 -20
- package/dist/index.js.map +1 -1
- package/package.json +7 -4
- package/src/core/MSafeAccount.ts +2 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@msafe/sui3-sdk",
|
|
3
|
-
"version": "0.0.52
|
|
3
|
+
"version": "0.0.52",
|
|
4
4
|
"description": "SDK for MSafe SUI V3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
"author": "MSafe <admin@m-safe.io>",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@msafe/sui-wallet": "^0.0.
|
|
25
|
-
"@msafe/sui3-utils": "^3.1.
|
|
26
|
-
"@mysten/sui.js": "0.53.0",
|
|
24
|
+
"@msafe/sui-wallet": "^0.0.67-pre-3d37348.0",
|
|
25
|
+
"@msafe/sui3-utils": "^3.1.60",
|
|
27
26
|
"axios": "^1.6.6",
|
|
28
27
|
"buffer": "^6.0.3"
|
|
29
28
|
},
|
|
30
29
|
"devDependencies": {
|
|
31
30
|
"@msafe/mpay-sdk-sui": "^1.0.25",
|
|
31
|
+
"@mysten/sui.js": "^0.50.1",
|
|
32
32
|
"@types/jest": "^29.5.8",
|
|
33
33
|
"@types/node": "^20.9.2",
|
|
34
34
|
"@typescript-eslint/eslint-plugin": "^6.5.0",
|
|
@@ -62,5 +62,8 @@
|
|
|
62
62
|
"build": "yarn clean && tsup --platform browser --format cjs,esm --dts",
|
|
63
63
|
"build-yalc": "yarn build && yalc publish --private",
|
|
64
64
|
"prerelease": "yarn build && chmod +x ./scripts/prerelease.sh && ./scripts/prerelease.sh"
|
|
65
|
+
},
|
|
66
|
+
"peerDependencies": {
|
|
67
|
+
"@mysten/sui.js": ">0.46.0"
|
|
65
68
|
}
|
|
66
69
|
}
|
package/src/core/MSafeAccount.ts
CHANGED
|
@@ -19,8 +19,7 @@ import {
|
|
|
19
19
|
import { SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client';
|
|
20
20
|
import { SerializedSignature } from '@mysten/sui.js/cryptography';
|
|
21
21
|
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
22
|
-
import {
|
|
23
|
-
import { SUI_MAINNET_CHAIN, SUI_TESTNET_CHAIN } from '@mysten/wallet-standard';
|
|
22
|
+
import { normalizeStructTag, toHEX } from '@mysten/sui.js/utils';
|
|
24
23
|
|
|
25
24
|
import { MSafeGlobals } from '@/globals/MSafeGlobals';
|
|
26
25
|
import { Simulator } from '@/simulate/simulator';
|
|
@@ -145,9 +144,6 @@ export class MSafeAccount {
|
|
|
145
144
|
suiClient: this.globals.suiClient,
|
|
146
145
|
account: {
|
|
147
146
|
address: this.address,
|
|
148
|
-
publicKey: fromHEX(this.address),
|
|
149
|
-
chains: [SUI_MAINNET_CHAIN, SUI_TESTNET_CHAIN],
|
|
150
|
-
features: [],
|
|
151
147
|
},
|
|
152
148
|
});
|
|
153
149
|
return this.simulator.simulate({ txb, sender: this.address });
|
|
@@ -186,16 +182,11 @@ export class MSafeAccount {
|
|
|
186
182
|
suiClient: this.globals.suiClient,
|
|
187
183
|
account: {
|
|
188
184
|
address: this.address,
|
|
189
|
-
publicKey: fromHEX(this.address),
|
|
190
|
-
chains: [SUI_MAINNET_CHAIN, SUI_TESTNET_CHAIN],
|
|
191
|
-
features: [],
|
|
192
185
|
},
|
|
193
186
|
});
|
|
194
|
-
const userAddress = await this.wallet.address();
|
|
195
|
-
console.log('🚀 ~ MSafeAccount ~ userAddress:', userAddress);
|
|
196
187
|
txb.setGasPrice(input.gasPrice);
|
|
197
188
|
txb.setGasBudget(input.gasBudget);
|
|
198
|
-
txb.setSender(
|
|
189
|
+
txb.setSender(this.address);
|
|
199
190
|
const payload = await txb.build({ client: this.globals.suiClient });
|
|
200
191
|
const digest = await txb.getDigest({ client: this.globals.suiClient });
|
|
201
192
|
|
|
@@ -356,9 +347,6 @@ export class MSafeAccount {
|
|
|
356
347
|
suiClient: this.globals.suiClient,
|
|
357
348
|
account: {
|
|
358
349
|
address: this.address,
|
|
359
|
-
publicKey: fromHEX(this.address),
|
|
360
|
-
chains: [SUI_MAINNET_CHAIN, SUI_TESTNET_CHAIN],
|
|
361
|
-
features: [],
|
|
362
350
|
},
|
|
363
351
|
});
|
|
364
352
|
return this.simulator.simulate({ txb, sender: this.address });
|