@msafe/sui3-sdk 0.0.41 → 0.0.42-pre-2f7c0fb.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@msafe/sui3-sdk",
3
- "version": "0.0.41",
3
+ "version": "0.0.42-pre-2f7c0fb.0",
4
4
  "description": "SDK for MSafe SUI V3",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -21,13 +21,13 @@
21
21
  "author": "MSafe <admin@m-safe.io>",
22
22
  "license": "MIT",
23
23
  "dependencies": {
24
- "@msafe/sui-app-store": "^0.0.10",
25
- "@msafe/sui3-utils": "3.1.46-pre-0545528.0",
24
+ "@msafe/sui-wallet": "^0.0.24",
25
+ "@msafe/sui3-utils": "^3.1.51",
26
26
  "axios": "^1.6.6",
27
27
  "buffer": "^6.0.3"
28
28
  },
29
29
  "devDependencies": {
30
- "@mysten/sui.js": "^0.46.1",
30
+ "@mysten/sui.js": "^0.50.1",
31
31
  "@types/jest": "^29.5.8",
32
32
  "@types/node": "^20.9.2",
33
33
  "@typescript-eslint/eslint-plugin": "^6.5.0",
@@ -59,6 +59,7 @@
59
59
  "lint": "eslint . --ext .ts,.tsx",
60
60
  "build": "yarn clean && yarn _build:node",
61
61
  "_build:node": "tsup --format cjs,esm --dts",
62
+ "build-yalc": "yarn build && yalc publish --private",
62
63
  "prerelease": "yarn build && chmod +x ./scripts/prerelease.sh && ./scripts/prerelease.sh"
63
64
  },
64
65
  "peerDependencies": {
@@ -38,8 +38,7 @@ import {
38
38
  IGetDashboardReq,
39
39
  IGetDashboardResp,
40
40
  } from '@msafe/sui3-utils';
41
- import { SerializedSignature } from '@mysten/sui.js/cryptography';
42
- import { PublicKey } from '@mysten/sui.js/src/cryptography';
41
+ import { SerializedSignature, PublicKey } from '@mysten/sui.js/cryptography';
43
42
  import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
44
43
 
45
44
  import { IBackend } from '@/backend/interface';
@@ -16,9 +16,8 @@ import {
16
16
  buildRejectTxb,
17
17
  isSameAddress,
18
18
  } from '@msafe/sui3-utils';
19
- import { SuiObjectData } from '@mysten/sui.js/client';
19
+ import { SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client';
20
20
  import { SerializedSignature } from '@mysten/sui.js/cryptography';
21
- import { SuiObjectResponse } from '@mysten/sui.js/src/client';
22
21
  import { TransactionBlock } from '@mysten/sui.js/transactions';
23
22
  import { normalizeStructTag } from '@mysten/sui.js/utils';
24
23
 
@@ -94,11 +93,9 @@ export class MSafeAccount {
94
93
  const rejectPending = res.reject;
95
94
 
96
95
  return {
97
- txType: TransactionType.Assets,
98
- txSubType:
99
- 'coinType' in pendingTx.intention
100
- ? TransactionSubTypes.assets.coin.send
101
- : TransactionSubTypes.assets.object.send,
96
+ application: pendingTx.application,
97
+ txType: pendingTx.txType,
98
+ txSubType: pendingTx.txSubType,
102
99
  createdAt: pendingTx.createdAt as Date,
103
100
  creator: pendingTx.creator,
104
101
  digest: pendingTx.digest,
@@ -140,6 +137,7 @@ export class MSafeAccount {
140
137
  throw new Error(`Can't find app helper for application ${request.application}`);
141
138
  }
142
139
  const txb = await appHelper.build({
140
+ network: 'sui:testnet',
143
141
  intentionData: request.intention,
144
142
  txType: request.txType,
145
143
  txSubType: request.txSubType,
@@ -320,12 +318,13 @@ export class MSafeAccount {
320
318
 
321
319
  async simulateBuildTransaction(): Promise<SimulationResult> {
322
320
  const intention = await this.backend.getNextIntention({ msafeAddress: this.address });
323
-
321
+ console.log('🚀 ~ MSafeAccount ~ simulateBuildTransaction ~ appHelper:', appHelpers.apps);
324
322
  const appHelper = appHelpers.getAppHelper(intention.application);
325
323
  if (!appHelper) {
326
324
  throw new Error(`Can't find app helper for application ${intention.application}`);
327
325
  }
328
326
  const txb = await appHelper.build({
327
+ network: 'sui:testnet',
329
328
  intentionData: intention.intention,
330
329
  txType: intention.txType as TransactionType,
331
330
  txSubType: intention.txSubType,
@@ -375,10 +374,9 @@ export class MSafeAccount {
375
374
  });
376
375
  }
377
376
 
378
- async dashboard(timezone?: string) {
377
+ async dashboard() {
379
378
  return this.backend.getDashboard({
380
379
  msafeAddress: this.address,
381
- timezone,
382
380
  });
383
381
  }
384
382
 
@@ -1,5 +1,5 @@
1
1
  import { isSameAddress } from '@msafe/sui3-utils';
2
- import { PublicKey } from '@mysten/sui.js/src/cryptography';
2
+ import { PublicKey } from '@mysten/sui.js/cryptography';
3
3
  import { normalizeSuiAddress } from '@mysten/sui.js/utils';
4
4
 
5
5
  import { MSafeGlobals } from '@/globals/MSafeGlobals';
@@ -3,6 +3,7 @@ import { GasCostSummary, SuiObjectRef } from '@mysten/sui.js/client';
3
3
  import { SerializedSignature } from '@mysten/sui.js/cryptography';
4
4
 
5
5
  export interface PendingTx {
6
+ application: string;
6
7
  txType: TransactionType;
7
8
  txSubType: string;
8
9
  digest: string;
@@ -3,7 +3,7 @@ import {
3
3
  SuiTransactionBlockResponseOptions,
4
4
  SuiTransactionBlockResponse,
5
5
  } from '@mysten/sui.js/client';
6
- import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
6
+ import { SignatureWithBytes } from '@mysten/sui.js/cryptography';
7
7
  import { TransactionBlock } from '@mysten/sui.js/transactions';
8
8
 
9
9
  export interface IWallet {