@msafe/sui3-sdk 0.0.90 → 1.0.6

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.d.cts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as _msafe_sui3_utils from '@msafe/sui3-utils';
2
2
  import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult, IGetPendingTransactionRequest, GetPendingTransactionResponse, IGetHistoryTransactionsRequest, GetHistoryTransactionsResponse, IGetIntentionsRequest, GetTransactionIntentionsResponse, IMSafeAddressRequest, TransactionIntentionItem, ICreateMSafeReq, IProposeIntentionRequest, IRejectTransactionRequest, IVoteTransactionRequest, IBuildTransactionRequest, ISkipIntentionRequest, IProposeIntentionAndBuildAndVoteRequest, IGetAddressBookResult, UpdateAddressBookEntry, IGetAddressBookModeResult, ISetAddressBookModeReq, Report, IGetDashboardReq, IGetDashboardResp, TransactionType, TxIntention, IGasOption, PublicKeyWithSchema, AddressBookMode, MultiSigAccount, CoinTransferIntention, ObjectTransferIntention, PlainPayloadIntention } from '@msafe/sui3-utils';
3
- import * as _mysten_sui_js_cryptography from '@mysten/sui.js/cryptography';
4
- import { PublicKey, SerializedSignature, SignatureWithBytes } from '@mysten/sui.js/cryptography';
5
- import * as _mysten_sui_js_client from '@mysten/sui.js/client';
6
- import { SuiClientOptions, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, SuiClient, GasCostSummary, SuiObjectRef, DryRunTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
7
- import { TransactionBlock } from '@mysten/sui.js/transactions';
3
+ import * as _mysten_sui_cryptography from '@mysten/sui/cryptography';
4
+ import { PublicKey, SignatureWithBytes } from '@mysten/sui/cryptography';
5
+ import { RpcTransport, SuiGrpcClient } from '@mysten/sui/grpc';
6
+ import * as _mysten_sui_client from '@mysten/sui/client';
7
+ import { SuiClientTypes } from '@mysten/sui/client';
8
+ import { Transaction } from '@mysten/sui/transactions';
8
9
  import { Buffer } from 'buffer';
9
10
 
10
11
  declare enum InfoTypeKey {
@@ -78,7 +79,7 @@ interface IBackend {
78
79
  getAddressBookEntries(pagination?: IPageOptions): Promise<IGetAddressBookResult>;
79
80
  updateAddressBook(input: {
80
81
  updates: UpdateAddressBookEntry[];
81
- signature: SerializedSignature;
82
+ signature: string;
82
83
  }): Promise<void>;
83
84
  getAddressBookMode(): Promise<IGetAddressBookModeResult>;
84
85
  setAddressBookMode(input: ISetAddressBookModeReq): Promise<void>;
@@ -89,6 +90,7 @@ interface IBackend {
89
90
  updateNotificationSubscription(input: NotificationUpdateDto): Promise<void>;
90
91
  }
91
92
 
93
+ declare function msafeChainToSuiNetwork(chain: 'sui:mainnet' | 'sui:testnet'): 'mainnet' | 'testnet';
92
94
  declare enum MSafeEnv {
93
95
  local = "local",
94
96
  unit = "unit",
@@ -96,10 +98,12 @@ declare enum MSafeEnv {
96
98
  prev = "prev",
97
99
  prod = "prod"
98
100
  }
101
+ /** Normalize HTTP(S) fullnode URL for SuiGrpcClient (gRPC-web) baseUrl. */
102
+ declare function httpUrlToGrpcBaseUrl(url: string): string;
99
103
  interface MSafeConfig {
100
104
  suiClient: {
101
105
  url: string;
102
- transport?: SuiClientOptions['transport'];
106
+ transport?: RpcTransport;
103
107
  };
104
108
  backend: {
105
109
  url: string;
@@ -110,7 +114,7 @@ interface MSafeConfig {
110
114
  interface MSafeConfigOptions {
111
115
  suiClient?: {
112
116
  url: string;
113
- transport?: SuiClientOptions['transport'];
117
+ transport?: RpcTransport;
114
118
  };
115
119
  backend?: {
116
120
  url?: string;
@@ -135,23 +139,22 @@ interface IWallet {
135
139
  messageStr: string;
136
140
  }): Promise<SignatureWithBytes>;
137
141
  signTransactionBlock(input: {
138
- transactionBlock: TransactionBlock | Uint8Array;
142
+ transactionBlock: Transaction | Uint8Array;
139
143
  }): Promise<SignatureWithBytes>;
140
144
  signAndExecuteTransactionBlock(input: {
141
- transactionBlock: TransactionBlock;
142
- requestType?: ExecuteTransactionRequestType;
143
- options?: SuiTransactionBlockResponseOptions;
144
- }): Promise<SuiTransactionBlockResponse>;
145
+ transactionBlock: Transaction | Uint8Array;
146
+ include?: SuiClientTypes.TransactionInclude;
147
+ }): Promise<SuiClientTypes.TransactionResult>;
145
148
  }
146
149
 
147
150
  declare class MSafeGlobals {
148
151
  readonly backend: IBackend;
149
- readonly suiClient: SuiClient;
152
+ readonly suiClient: SuiGrpcClient;
150
153
  readonly config: MSafeConfig;
151
154
  _wallet: IWallet | undefined;
152
155
  constructor(input: {
153
156
  backend: IBackend;
154
- suiClient: SuiClient;
157
+ suiClient: SuiGrpcClient;
155
158
  config: MSafeConfig;
156
159
  });
157
160
  static New(env: MSafeEnv, options?: MSafeConfigOptions): Promise<MSafeGlobals>;
@@ -176,6 +179,15 @@ declare class PublicKeyHelper {
176
179
  private getPublicKeyFromChain;
177
180
  }
178
181
 
182
+ /** Gas coin reference derived from simulation / execution effects. */
183
+ interface GasObjectReference {
184
+ objectId: string;
185
+ version: string;
186
+ digest: string;
187
+ }
188
+ type SimulateDryRunResponse = SuiClientTypes.SimulateTransactionResult<{
189
+ effects: true;
190
+ }>;
179
191
  interface PendingTx {
180
192
  application: string;
181
193
  txType: TransactionType;
@@ -243,21 +255,21 @@ interface ProposeIntention {
243
255
  sequenceNumber: number;
244
256
  userAddress: string;
245
257
  msafeAddress: string;
246
- signature: SerializedSignature;
258
+ signature: string;
247
259
  }
248
260
  type SimulationResult = SimulationSuccessResult | SimulationFailedResult;
249
261
  interface SimulationSuccessResult {
250
262
  success: true;
251
263
  gasPrice: bigint;
252
- gasUsed: GasCostSummary;
264
+ gasUsed: SuiClientTypes.GasCostSummary;
253
265
  gasBudget: bigint;
254
- gasObject: SuiObjectRef;
255
- response: DryRunTransactionBlockResponse;
266
+ gasObject: GasObjectReference;
267
+ response: SimulateDryRunResponse;
256
268
  }
257
269
  interface SimulationFailedResult {
258
270
  success: false;
259
271
  gasPrice: bigint;
260
- response: DryRunTransactionBlockResponse;
272
+ response?: SimulateDryRunResponse;
261
273
  simulationError: string;
262
274
  }
263
275
  interface SimulationOption extends IGasOption {
@@ -320,25 +332,31 @@ declare class Simulator {
320
332
  private globals;
321
333
  constructor(globals: MSafeGlobals);
322
334
  simulate(input: {
323
- txb: TransactionBlock;
335
+ txb: Transaction;
324
336
  sender: string;
325
337
  }): Promise<SimulationResult>;
326
338
  private getGasPrice;
327
339
  private toGasBudget;
328
- private copyTransactionBlock;
340
+ private copyTransaction;
329
341
  }
330
342
 
343
+ type CoinMetadata = SuiClientTypes.CoinMetadata;
331
344
  interface OwnedCoin {
332
345
  type: string;
333
346
  balance: bigint;
334
347
  metadata?: CoinMetadata;
335
348
  }
336
349
 
337
- type ObjectFilter = (objRes: SuiObjectResponse) => boolean;
350
+ /** Owned object row with Move JSON content (for helpers like Coin.getBalance). */
351
+ type OwnedObjectData = SuiClientTypes.Object<{
352
+ json: true;
353
+ }>;
354
+ type ObjectFilter = (obj: OwnedObjectData) => boolean;
338
355
  interface BatchObjectOptions {
339
356
  filter?: ObjectFilter;
340
357
  pageSize?: number;
341
- objectOptions?: SuiObjectDataOptions;
358
+ /** Extra fields to request from the node; defaults include Move JSON for struct fields. */
359
+ objectInclude?: SuiClientTypes.ObjectInclude;
342
360
  }
343
361
 
344
362
  declare class MSafeAccount {
@@ -350,18 +368,18 @@ declare class MSafeAccount {
350
368
  constructor(globals: MSafeGlobals, info: IMSafeConfig);
351
369
  static New(globals: MSafeGlobals, address: string): Promise<void>;
352
370
  ownedCoins(): Promise<OwnedCoin[]>;
353
- ownedObjects(options?: BatchObjectOptions): Promise<SuiObjectData[]>;
371
+ ownedObjects(options?: BatchObjectOptions): Promise<OwnedObjectData[]>;
354
372
  pendingTransaction(): Promise<PendingTx | undefined>;
355
373
  historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
356
374
  futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
357
375
  currentSequenceNumber(): Promise<number>;
358
376
  nextSequenceNumber(): Promise<number>;
359
377
  simulateIntention(request: Omit<IProposeIntentionRequest, 'msafeAddress' | 'signature'> & {
360
- txb?: TransactionBlock;
378
+ txb?: Transaction;
361
379
  }): Promise<SimulationResult>;
362
380
  proposeIntention(input: Omit<IProposeIntentionRequest, 'signature' | 'msafeAddress'>): Promise<void>;
363
381
  proposeIntentionAndBuildVote(input: Omit<IProposeIntentionAndBuildAndVoteRequest, 'signature' | 'msafeAddress' | 'payload' | 'digest'> & {
364
- txb?: TransactionBlock;
382
+ txb?: Transaction;
365
383
  }): Promise<void>;
366
384
  simulateCoinTransferIntention(intention: CoinTransferIntention): Promise<SimulationResult>;
367
385
  proposeCoinTransferIntention(intention: CoinTransferIntention): Promise<void>;
@@ -380,7 +398,10 @@ declare class MSafeAccount {
380
398
  }): Promise<void>;
381
399
  skipNextFailedIntention(): Promise<void>;
382
400
  fetchTransaction(): Promise<string[]>;
383
- executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_js_client.SuiTransactionBlockResponse>;
401
+ executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
402
+ effects: true;
403
+ events: true;
404
+ }>>;
384
405
  dashboard(): Promise<_msafe_sui3_utils.IGetDashboardResp>;
385
406
  private calculateWeightFromVotes;
386
407
  private calculateWeight;
@@ -432,26 +453,26 @@ declare class SignatureVerifier {
432
453
  static getPublicKeyFromSignature(input: {
433
454
  message: Uint8Array;
434
455
  messageType: 'TransactionBlock' | 'Personal';
435
- signature: SerializedSignature;
436
- }): Promise<_mysten_sui_js_cryptography.PublicKey>;
456
+ signature: string;
457
+ }): Promise<_mysten_sui_cryptography.PublicKey>;
437
458
  static getPublicKeyFromPersonalSignature(input: {
438
459
  messageStr: string;
439
- signature: SerializedSignature;
440
- }): Promise<_mysten_sui_js_cryptography.PublicKey>;
460
+ signature: string;
461
+ }): Promise<_mysten_sui_cryptography.PublicKey>;
441
462
  static verifySignature(input: {
442
463
  message: Uint8Array;
443
464
  messageType: 'TransactionBlock' | 'Personal';
444
- signature: SerializedSignature;
465
+ signature: string;
445
466
  targetAddress: string;
446
467
  }): Promise<boolean>;
447
468
  static verifyPersonalSignature(input: {
448
469
  messageStr: string;
449
- signature: SerializedSignature;
470
+ signature: string;
450
471
  targetAddress: string;
451
472
  }): Promise<boolean>;
452
473
  static verifyTransactionSignature(input: {
453
474
  payload: Uint8Array;
454
- signature: SerializedSignature;
475
+ signature: string;
455
476
  targetAddress: string;
456
477
  }): Promise<boolean>;
457
478
  }
@@ -466,17 +487,17 @@ declare class Formatter {
466
487
  declare function addPrefix(s: string, prefix: string): string;
467
488
 
468
489
  declare const SUI_COIN = "0x2::sui::SUI";
469
- declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey | undefined>;
490
+ declare function getPublicKeyFromChain(suiClient: SuiGrpcClient, address: string): Promise<PublicKey | undefined>;
470
491
  declare function getAllCoins(input: {
471
- suiClient: SuiClient;
492
+ suiClient: SuiGrpcClient;
472
493
  owner: string;
473
494
  coinType: string | undefined;
474
- }): Promise<CoinStruct[]>;
495
+ }): Promise<SuiClientTypes.Coin[]>;
475
496
 
476
497
  declare class CoinHelper {
477
498
  private _client;
478
499
  private _coinMetaReg;
479
- constructor(client: SuiClient);
500
+ constructor(client: SuiGrpcClient);
480
501
  getCoinMeta(coinType: string): Promise<CoinMetadata | undefined>;
481
502
  private queryCoinMeta;
482
503
  }
@@ -484,7 +505,21 @@ declare const COIN_TYPE_ARG_REGEX: RegExp;
484
505
  declare class Coin {
485
506
  static isCoin(type: string | undefined | null): boolean;
486
507
  static getCoinType(type: string): string | null;
487
- static getBalance(data: SuiObjectData): bigint | undefined;
508
+ static getBalance(data: {
509
+ type?: string | null;
510
+ json?: Record<string, unknown> | null;
511
+ content?: {
512
+ dataType?: string;
513
+ fields?: {
514
+ balance?: string;
515
+ };
516
+ };
517
+ }): bigint | undefined;
488
518
  }
489
519
 
490
- export { AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeInfo, DEV_API_URL, DEV_SYNCING_URL, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, InfoTypeEnabledDto, InfoTypeKey, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnabledDto, MSafeEnv, MSafeGlobals, type NotificationData, type NotificationInfo, NotificationSubscribeDto, NotificationUpdateDto, PREV_API_URL, PROD_API_URL, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationFailedResult, type SimulationOption, type SimulationResult, type SimulationSuccessResult, TESTNET_RPC_URL, Uint8ArrayToHex, addPrefix, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
520
+ /**
521
+ * Normalize a transaction value to {@link Transaction} (handles plain Transaction or serialized legacy shapes).
522
+ */
523
+ declare function toSuiTransaction(txb: Transaction | unknown): Transaction;
524
+
525
+ export { AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeInfo, DEV_API_URL, DEV_SYNCING_URL, ENV_CONFIGS, Formatter, type FutureIntention, type GasObjectReference, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, InfoTypeEnabledDto, InfoTypeKey, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnabledDto, MSafeEnv, MSafeGlobals, type NotificationData, type NotificationInfo, NotificationSubscribeDto, NotificationUpdateDto, PREV_API_URL, PROD_API_URL, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulateDryRunResponse, type SimulationFailedResult, type SimulationOption, type SimulationResult, type SimulationSuccessResult, TESTNET_RPC_URL, Uint8ArrayToHex, addPrefix, getAllCoins, getMSafeConfig, getPublicKeyFromChain, httpUrlToGrpcBaseUrl, msafeChainToSuiNetwork, stringToBuffer, toSuiTransaction };
package/dist/index.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  import * as _msafe_sui3_utils from '@msafe/sui3-utils';
2
2
  import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult, IGetPendingTransactionRequest, GetPendingTransactionResponse, IGetHistoryTransactionsRequest, GetHistoryTransactionsResponse, IGetIntentionsRequest, GetTransactionIntentionsResponse, IMSafeAddressRequest, TransactionIntentionItem, ICreateMSafeReq, IProposeIntentionRequest, IRejectTransactionRequest, IVoteTransactionRequest, IBuildTransactionRequest, ISkipIntentionRequest, IProposeIntentionAndBuildAndVoteRequest, IGetAddressBookResult, UpdateAddressBookEntry, IGetAddressBookModeResult, ISetAddressBookModeReq, Report, IGetDashboardReq, IGetDashboardResp, TransactionType, TxIntention, IGasOption, PublicKeyWithSchema, AddressBookMode, MultiSigAccount, CoinTransferIntention, ObjectTransferIntention, PlainPayloadIntention } from '@msafe/sui3-utils';
3
- import * as _mysten_sui_js_cryptography from '@mysten/sui.js/cryptography';
4
- import { PublicKey, SerializedSignature, SignatureWithBytes } from '@mysten/sui.js/cryptography';
5
- import * as _mysten_sui_js_client from '@mysten/sui.js/client';
6
- import { SuiClientOptions, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, SuiClient, GasCostSummary, SuiObjectRef, DryRunTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
7
- import { TransactionBlock } from '@mysten/sui.js/transactions';
3
+ import * as _mysten_sui_cryptography from '@mysten/sui/cryptography';
4
+ import { PublicKey, SignatureWithBytes } from '@mysten/sui/cryptography';
5
+ import { RpcTransport, SuiGrpcClient } from '@mysten/sui/grpc';
6
+ import * as _mysten_sui_client from '@mysten/sui/client';
7
+ import { SuiClientTypes } from '@mysten/sui/client';
8
+ import { Transaction } from '@mysten/sui/transactions';
8
9
  import { Buffer } from 'buffer';
9
10
 
10
11
  declare enum InfoTypeKey {
@@ -78,7 +79,7 @@ interface IBackend {
78
79
  getAddressBookEntries(pagination?: IPageOptions): Promise<IGetAddressBookResult>;
79
80
  updateAddressBook(input: {
80
81
  updates: UpdateAddressBookEntry[];
81
- signature: SerializedSignature;
82
+ signature: string;
82
83
  }): Promise<void>;
83
84
  getAddressBookMode(): Promise<IGetAddressBookModeResult>;
84
85
  setAddressBookMode(input: ISetAddressBookModeReq): Promise<void>;
@@ -89,6 +90,7 @@ interface IBackend {
89
90
  updateNotificationSubscription(input: NotificationUpdateDto): Promise<void>;
90
91
  }
91
92
 
93
+ declare function msafeChainToSuiNetwork(chain: 'sui:mainnet' | 'sui:testnet'): 'mainnet' | 'testnet';
92
94
  declare enum MSafeEnv {
93
95
  local = "local",
94
96
  unit = "unit",
@@ -96,10 +98,12 @@ declare enum MSafeEnv {
96
98
  prev = "prev",
97
99
  prod = "prod"
98
100
  }
101
+ /** Normalize HTTP(S) fullnode URL for SuiGrpcClient (gRPC-web) baseUrl. */
102
+ declare function httpUrlToGrpcBaseUrl(url: string): string;
99
103
  interface MSafeConfig {
100
104
  suiClient: {
101
105
  url: string;
102
- transport?: SuiClientOptions['transport'];
106
+ transport?: RpcTransport;
103
107
  };
104
108
  backend: {
105
109
  url: string;
@@ -110,7 +114,7 @@ interface MSafeConfig {
110
114
  interface MSafeConfigOptions {
111
115
  suiClient?: {
112
116
  url: string;
113
- transport?: SuiClientOptions['transport'];
117
+ transport?: RpcTransport;
114
118
  };
115
119
  backend?: {
116
120
  url?: string;
@@ -135,23 +139,22 @@ interface IWallet {
135
139
  messageStr: string;
136
140
  }): Promise<SignatureWithBytes>;
137
141
  signTransactionBlock(input: {
138
- transactionBlock: TransactionBlock | Uint8Array;
142
+ transactionBlock: Transaction | Uint8Array;
139
143
  }): Promise<SignatureWithBytes>;
140
144
  signAndExecuteTransactionBlock(input: {
141
- transactionBlock: TransactionBlock;
142
- requestType?: ExecuteTransactionRequestType;
143
- options?: SuiTransactionBlockResponseOptions;
144
- }): Promise<SuiTransactionBlockResponse>;
145
+ transactionBlock: Transaction | Uint8Array;
146
+ include?: SuiClientTypes.TransactionInclude;
147
+ }): Promise<SuiClientTypes.TransactionResult>;
145
148
  }
146
149
 
147
150
  declare class MSafeGlobals {
148
151
  readonly backend: IBackend;
149
- readonly suiClient: SuiClient;
152
+ readonly suiClient: SuiGrpcClient;
150
153
  readonly config: MSafeConfig;
151
154
  _wallet: IWallet | undefined;
152
155
  constructor(input: {
153
156
  backend: IBackend;
154
- suiClient: SuiClient;
157
+ suiClient: SuiGrpcClient;
155
158
  config: MSafeConfig;
156
159
  });
157
160
  static New(env: MSafeEnv, options?: MSafeConfigOptions): Promise<MSafeGlobals>;
@@ -176,6 +179,15 @@ declare class PublicKeyHelper {
176
179
  private getPublicKeyFromChain;
177
180
  }
178
181
 
182
+ /** Gas coin reference derived from simulation / execution effects. */
183
+ interface GasObjectReference {
184
+ objectId: string;
185
+ version: string;
186
+ digest: string;
187
+ }
188
+ type SimulateDryRunResponse = SuiClientTypes.SimulateTransactionResult<{
189
+ effects: true;
190
+ }>;
179
191
  interface PendingTx {
180
192
  application: string;
181
193
  txType: TransactionType;
@@ -243,21 +255,21 @@ interface ProposeIntention {
243
255
  sequenceNumber: number;
244
256
  userAddress: string;
245
257
  msafeAddress: string;
246
- signature: SerializedSignature;
258
+ signature: string;
247
259
  }
248
260
  type SimulationResult = SimulationSuccessResult | SimulationFailedResult;
249
261
  interface SimulationSuccessResult {
250
262
  success: true;
251
263
  gasPrice: bigint;
252
- gasUsed: GasCostSummary;
264
+ gasUsed: SuiClientTypes.GasCostSummary;
253
265
  gasBudget: bigint;
254
- gasObject: SuiObjectRef;
255
- response: DryRunTransactionBlockResponse;
266
+ gasObject: GasObjectReference;
267
+ response: SimulateDryRunResponse;
256
268
  }
257
269
  interface SimulationFailedResult {
258
270
  success: false;
259
271
  gasPrice: bigint;
260
- response: DryRunTransactionBlockResponse;
272
+ response?: SimulateDryRunResponse;
261
273
  simulationError: string;
262
274
  }
263
275
  interface SimulationOption extends IGasOption {
@@ -320,25 +332,31 @@ declare class Simulator {
320
332
  private globals;
321
333
  constructor(globals: MSafeGlobals);
322
334
  simulate(input: {
323
- txb: TransactionBlock;
335
+ txb: Transaction;
324
336
  sender: string;
325
337
  }): Promise<SimulationResult>;
326
338
  private getGasPrice;
327
339
  private toGasBudget;
328
- private copyTransactionBlock;
340
+ private copyTransaction;
329
341
  }
330
342
 
343
+ type CoinMetadata = SuiClientTypes.CoinMetadata;
331
344
  interface OwnedCoin {
332
345
  type: string;
333
346
  balance: bigint;
334
347
  metadata?: CoinMetadata;
335
348
  }
336
349
 
337
- type ObjectFilter = (objRes: SuiObjectResponse) => boolean;
350
+ /** Owned object row with Move JSON content (for helpers like Coin.getBalance). */
351
+ type OwnedObjectData = SuiClientTypes.Object<{
352
+ json: true;
353
+ }>;
354
+ type ObjectFilter = (obj: OwnedObjectData) => boolean;
338
355
  interface BatchObjectOptions {
339
356
  filter?: ObjectFilter;
340
357
  pageSize?: number;
341
- objectOptions?: SuiObjectDataOptions;
358
+ /** Extra fields to request from the node; defaults include Move JSON for struct fields. */
359
+ objectInclude?: SuiClientTypes.ObjectInclude;
342
360
  }
343
361
 
344
362
  declare class MSafeAccount {
@@ -350,18 +368,18 @@ declare class MSafeAccount {
350
368
  constructor(globals: MSafeGlobals, info: IMSafeConfig);
351
369
  static New(globals: MSafeGlobals, address: string): Promise<void>;
352
370
  ownedCoins(): Promise<OwnedCoin[]>;
353
- ownedObjects(options?: BatchObjectOptions): Promise<SuiObjectData[]>;
371
+ ownedObjects(options?: BatchObjectOptions): Promise<OwnedObjectData[]>;
354
372
  pendingTransaction(): Promise<PendingTx | undefined>;
355
373
  historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
356
374
  futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
357
375
  currentSequenceNumber(): Promise<number>;
358
376
  nextSequenceNumber(): Promise<number>;
359
377
  simulateIntention(request: Omit<IProposeIntentionRequest, 'msafeAddress' | 'signature'> & {
360
- txb?: TransactionBlock;
378
+ txb?: Transaction;
361
379
  }): Promise<SimulationResult>;
362
380
  proposeIntention(input: Omit<IProposeIntentionRequest, 'signature' | 'msafeAddress'>): Promise<void>;
363
381
  proposeIntentionAndBuildVote(input: Omit<IProposeIntentionAndBuildAndVoteRequest, 'signature' | 'msafeAddress' | 'payload' | 'digest'> & {
364
- txb?: TransactionBlock;
382
+ txb?: Transaction;
365
383
  }): Promise<void>;
366
384
  simulateCoinTransferIntention(intention: CoinTransferIntention): Promise<SimulationResult>;
367
385
  proposeCoinTransferIntention(intention: CoinTransferIntention): Promise<void>;
@@ -380,7 +398,10 @@ declare class MSafeAccount {
380
398
  }): Promise<void>;
381
399
  skipNextFailedIntention(): Promise<void>;
382
400
  fetchTransaction(): Promise<string[]>;
383
- executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_js_client.SuiTransactionBlockResponse>;
401
+ executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
402
+ effects: true;
403
+ events: true;
404
+ }>>;
384
405
  dashboard(): Promise<_msafe_sui3_utils.IGetDashboardResp>;
385
406
  private calculateWeightFromVotes;
386
407
  private calculateWeight;
@@ -432,26 +453,26 @@ declare class SignatureVerifier {
432
453
  static getPublicKeyFromSignature(input: {
433
454
  message: Uint8Array;
434
455
  messageType: 'TransactionBlock' | 'Personal';
435
- signature: SerializedSignature;
436
- }): Promise<_mysten_sui_js_cryptography.PublicKey>;
456
+ signature: string;
457
+ }): Promise<_mysten_sui_cryptography.PublicKey>;
437
458
  static getPublicKeyFromPersonalSignature(input: {
438
459
  messageStr: string;
439
- signature: SerializedSignature;
440
- }): Promise<_mysten_sui_js_cryptography.PublicKey>;
460
+ signature: string;
461
+ }): Promise<_mysten_sui_cryptography.PublicKey>;
441
462
  static verifySignature(input: {
442
463
  message: Uint8Array;
443
464
  messageType: 'TransactionBlock' | 'Personal';
444
- signature: SerializedSignature;
465
+ signature: string;
445
466
  targetAddress: string;
446
467
  }): Promise<boolean>;
447
468
  static verifyPersonalSignature(input: {
448
469
  messageStr: string;
449
- signature: SerializedSignature;
470
+ signature: string;
450
471
  targetAddress: string;
451
472
  }): Promise<boolean>;
452
473
  static verifyTransactionSignature(input: {
453
474
  payload: Uint8Array;
454
- signature: SerializedSignature;
475
+ signature: string;
455
476
  targetAddress: string;
456
477
  }): Promise<boolean>;
457
478
  }
@@ -466,17 +487,17 @@ declare class Formatter {
466
487
  declare function addPrefix(s: string, prefix: string): string;
467
488
 
468
489
  declare const SUI_COIN = "0x2::sui::SUI";
469
- declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey | undefined>;
490
+ declare function getPublicKeyFromChain(suiClient: SuiGrpcClient, address: string): Promise<PublicKey | undefined>;
470
491
  declare function getAllCoins(input: {
471
- suiClient: SuiClient;
492
+ suiClient: SuiGrpcClient;
472
493
  owner: string;
473
494
  coinType: string | undefined;
474
- }): Promise<CoinStruct[]>;
495
+ }): Promise<SuiClientTypes.Coin[]>;
475
496
 
476
497
  declare class CoinHelper {
477
498
  private _client;
478
499
  private _coinMetaReg;
479
- constructor(client: SuiClient);
500
+ constructor(client: SuiGrpcClient);
480
501
  getCoinMeta(coinType: string): Promise<CoinMetadata | undefined>;
481
502
  private queryCoinMeta;
482
503
  }
@@ -484,7 +505,21 @@ declare const COIN_TYPE_ARG_REGEX: RegExp;
484
505
  declare class Coin {
485
506
  static isCoin(type: string | undefined | null): boolean;
486
507
  static getCoinType(type: string): string | null;
487
- static getBalance(data: SuiObjectData): bigint | undefined;
508
+ static getBalance(data: {
509
+ type?: string | null;
510
+ json?: Record<string, unknown> | null;
511
+ content?: {
512
+ dataType?: string;
513
+ fields?: {
514
+ balance?: string;
515
+ };
516
+ };
517
+ }): bigint | undefined;
488
518
  }
489
519
 
490
- export { AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeInfo, DEV_API_URL, DEV_SYNCING_URL, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, InfoTypeEnabledDto, InfoTypeKey, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnabledDto, MSafeEnv, MSafeGlobals, type NotificationData, type NotificationInfo, NotificationSubscribeDto, NotificationUpdateDto, PREV_API_URL, PROD_API_URL, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationFailedResult, type SimulationOption, type SimulationResult, type SimulationSuccessResult, TESTNET_RPC_URL, Uint8ArrayToHex, addPrefix, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
520
+ /**
521
+ * Normalize a transaction value to {@link Transaction} (handles plain Transaction or serialized legacy shapes).
522
+ */
523
+ declare function toSuiTransaction(txb: Transaction | unknown): Transaction;
524
+
525
+ export { AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeInfo, DEV_API_URL, DEV_SYNCING_URL, ENV_CONFIGS, Formatter, type FutureIntention, type GasObjectReference, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, InfoTypeEnabledDto, InfoTypeKey, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnabledDto, MSafeEnv, MSafeGlobals, type NotificationData, type NotificationInfo, NotificationSubscribeDto, NotificationUpdateDto, PREV_API_URL, PROD_API_URL, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulateDryRunResponse, type SimulationFailedResult, type SimulationOption, type SimulationResult, type SimulationSuccessResult, TESTNET_RPC_URL, Uint8ArrayToHex, addPrefix, getAllCoins, getMSafeConfig, getPublicKeyFromChain, httpUrlToGrpcBaseUrl, msafeChainToSuiNetwork, stringToBuffer, toSuiTransaction };