@msafe/sui3-sdk 0.0.40-pre-bad2402.0 → 0.0.40

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.
@@ -36,7 +36,8 @@ import {
36
36
  IRejectTransactionRequest,
37
37
  IProposeIntentionAndBuildAndVoteRequest,
38
38
  } from '@msafe/sui3-utils';
39
- import { SerializedSignature, PublicKey } from '@mysten/sui.js/cryptography';
39
+ import { SerializedSignature } from '@mysten/sui.js/cryptography';
40
+ import { PublicKey } from '@mysten/sui.js/src/cryptography';
40
41
  import axios, { AxiosError, AxiosRequestConfig, AxiosResponse } from 'axios';
41
42
 
42
43
  import { IBackend } from '@/backend/interface';
@@ -16,8 +16,9 @@ import {
16
16
  buildRejectTxb,
17
17
  isSameAddress,
18
18
  } from '@msafe/sui3-utils';
19
- import { SuiObjectData, SuiObjectResponse } from '@mysten/sui.js/client';
19
+ import { SuiObjectData } from '@mysten/sui.js/client';
20
20
  import { SerializedSignature } from '@mysten/sui.js/cryptography';
21
+ import { SuiObjectResponse } from '@mysten/sui.js/src/client';
21
22
  import { TransactionBlock } from '@mysten/sui.js/transactions';
22
23
  import { normalizeStructTag } from '@mysten/sui.js/utils';
23
24
 
@@ -139,7 +140,6 @@ export class MSafeAccount {
139
140
  throw new Error(`Can't find app helper for application ${request.application}`);
140
141
  }
141
142
  const txb = await appHelper.build({
142
- network: 'sui:testnet',
143
143
  intentionData: request.intention,
144
144
  txType: request.txType,
145
145
  txSubType: request.txSubType,
@@ -320,13 +320,12 @@ export class MSafeAccount {
320
320
 
321
321
  async simulateBuildTransaction(): Promise<SimulationResult> {
322
322
  const intention = await this.backend.getNextIntention({ msafeAddress: this.address });
323
- console.log('🚀 ~ MSafeAccount ~ simulateBuildTransaction ~ appHelper:', appHelpers.apps);
323
+
324
324
  const appHelper = appHelpers.getAppHelper(intention.application);
325
325
  if (!appHelper) {
326
326
  throw new Error(`Can't find app helper for application ${intention.application}`);
327
327
  }
328
328
  const txb = await appHelper.build({
329
- network: 'sui:testnet',
330
329
  intentionData: intention.intention,
331
330
  txType: intention.txType as TransactionType,
332
331
  txSubType: intention.txSubType,
@@ -1,5 +1,5 @@
1
1
  import { isSameAddress } from '@msafe/sui3-utils';
2
- import { PublicKey } from '@mysten/sui.js/cryptography';
2
+ import { PublicKey } from '@mysten/sui.js/src/cryptography';
3
3
  import { normalizeSuiAddress } from '@mysten/sui.js/utils';
4
4
 
5
5
  import { MSafeGlobals } from '@/globals/MSafeGlobals';
@@ -34,6 +34,10 @@ export const LOCAL_SYNCING_URL = 'http://127.0.0.1:3001';
34
34
  export const DEV_API_URL = 'https://sui-dev.m-safe.link';
35
35
  export const DEV_SYNCING_URL = 'http://52.53.228.20';
36
36
 
37
+ export const PREV_API_URL = 'https://sui-preview.m-safe.link';
38
+
39
+ export const PROD_API_URL = 'https://sui.m-safe.link';
40
+
37
41
  export const ENV_CONFIGS = new Map<MSafeEnv, MSafeConfig>([
38
42
  [
39
43
  MSafeEnv.unit,
@@ -71,6 +75,30 @@ export const ENV_CONFIGS = new Map<MSafeEnv, MSafeConfig>([
71
75
  syncingURL: DEV_SYNCING_URL,
72
76
  },
73
77
  ],
78
+ [
79
+ MSafeEnv.prev,
80
+ {
81
+ suiClient: {
82
+ url: MAINNET_RPC_URL,
83
+ },
84
+ backend: {
85
+ url: PREV_API_URL,
86
+ },
87
+ syncingURL: '',
88
+ },
89
+ ],
90
+ [
91
+ MSafeEnv.prod,
92
+ {
93
+ suiClient: {
94
+ url: MAINNET_RPC_URL,
95
+ },
96
+ backend: {
97
+ url: PROD_API_URL,
98
+ },
99
+ syncingURL: '',
100
+ },
101
+ ],
74
102
  ]);
75
103
 
76
104
  export function getMSafeConfig(env: MSafeEnv, options?: MSafeConfigOptions) {
@@ -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/cryptography';
6
+ import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
7
7
  import { TransactionBlock } from '@mysten/sui.js/transactions';
8
8
 
9
9
  export interface IWallet {