@msafe/sui3-sdk 1.0.7 → 1.0.8
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 +195 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +53 -24
- package/dist/index.d.ts +53 -24
- package/dist/index.js +195 -59
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -2,8 +2,9 @@ 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
3
|
import * as _mysten_sui_cryptography from '@mysten/sui/cryptography';
|
|
4
4
|
import { PublicKey, SignatureWithBytes } from '@mysten/sui/cryptography';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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';
|
|
7
8
|
import { Transaction } from '@mysten/sui/transactions';
|
|
8
9
|
import { Buffer } from 'buffer';
|
|
9
10
|
|
|
@@ -97,10 +98,12 @@ declare enum MSafeEnv {
|
|
|
97
98
|
prev = "prev",
|
|
98
99
|
prod = "prod"
|
|
99
100
|
}
|
|
101
|
+
/** Normalize HTTP(S) fullnode URL for SuiGrpcClient (gRPC-web) baseUrl. */
|
|
102
|
+
declare function httpUrlToGrpcBaseUrl(url: string): string;
|
|
100
103
|
interface MSafeConfig {
|
|
101
104
|
suiClient: {
|
|
102
105
|
url: string;
|
|
103
|
-
transport?:
|
|
106
|
+
transport?: RpcTransport;
|
|
104
107
|
};
|
|
105
108
|
backend: {
|
|
106
109
|
url: string;
|
|
@@ -111,7 +114,7 @@ interface MSafeConfig {
|
|
|
111
114
|
interface MSafeConfigOptions {
|
|
112
115
|
suiClient?: {
|
|
113
116
|
url: string;
|
|
114
|
-
transport?:
|
|
117
|
+
transport?: RpcTransport;
|
|
115
118
|
};
|
|
116
119
|
backend?: {
|
|
117
120
|
url?: string;
|
|
@@ -140,19 +143,18 @@ interface IWallet {
|
|
|
140
143
|
}): Promise<SignatureWithBytes>;
|
|
141
144
|
signAndExecuteTransactionBlock(input: {
|
|
142
145
|
transactionBlock: Transaction | Uint8Array;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}): Promise<SuiTransactionBlockResponse>;
|
|
146
|
+
include?: SuiClientTypes.TransactionInclude;
|
|
147
|
+
}): Promise<SuiClientTypes.TransactionResult>;
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
declare class MSafeGlobals {
|
|
149
151
|
readonly backend: IBackend;
|
|
150
|
-
readonly suiClient:
|
|
152
|
+
readonly suiClient: SuiGrpcClient;
|
|
151
153
|
readonly config: MSafeConfig;
|
|
152
154
|
_wallet: IWallet | undefined;
|
|
153
155
|
constructor(input: {
|
|
154
156
|
backend: IBackend;
|
|
155
|
-
suiClient:
|
|
157
|
+
suiClient: SuiGrpcClient;
|
|
156
158
|
config: MSafeConfig;
|
|
157
159
|
});
|
|
158
160
|
static New(env: MSafeEnv, options?: MSafeConfigOptions): Promise<MSafeGlobals>;
|
|
@@ -177,6 +179,15 @@ declare class PublicKeyHelper {
|
|
|
177
179
|
private getPublicKeyFromChain;
|
|
178
180
|
}
|
|
179
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
|
+
}>;
|
|
180
191
|
interface PendingTx {
|
|
181
192
|
application: string;
|
|
182
193
|
txType: TransactionType;
|
|
@@ -250,15 +261,15 @@ type SimulationResult = SimulationSuccessResult | SimulationFailedResult;
|
|
|
250
261
|
interface SimulationSuccessResult {
|
|
251
262
|
success: true;
|
|
252
263
|
gasPrice: bigint;
|
|
253
|
-
gasUsed: GasCostSummary;
|
|
264
|
+
gasUsed: SuiClientTypes.GasCostSummary;
|
|
254
265
|
gasBudget: bigint;
|
|
255
|
-
gasObject:
|
|
256
|
-
response:
|
|
266
|
+
gasObject: GasObjectReference;
|
|
267
|
+
response: SimulateDryRunResponse;
|
|
257
268
|
}
|
|
258
269
|
interface SimulationFailedResult {
|
|
259
270
|
success: false;
|
|
260
271
|
gasPrice: bigint;
|
|
261
|
-
response
|
|
272
|
+
response?: SimulateDryRunResponse;
|
|
262
273
|
simulationError: string;
|
|
263
274
|
}
|
|
264
275
|
interface SimulationOption extends IGasOption {
|
|
@@ -329,17 +340,23 @@ declare class Simulator {
|
|
|
329
340
|
private copyTransaction;
|
|
330
341
|
}
|
|
331
342
|
|
|
343
|
+
type CoinMetadata = SuiClientTypes.CoinMetadata;
|
|
332
344
|
interface OwnedCoin {
|
|
333
345
|
type: string;
|
|
334
346
|
balance: bigint;
|
|
335
347
|
metadata?: CoinMetadata;
|
|
336
348
|
}
|
|
337
349
|
|
|
338
|
-
|
|
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;
|
|
339
355
|
interface BatchObjectOptions {
|
|
340
356
|
filter?: ObjectFilter;
|
|
341
357
|
pageSize?: number;
|
|
342
|
-
|
|
358
|
+
/** Extra fields to request from the node; defaults include Move JSON for struct fields. */
|
|
359
|
+
objectInclude?: SuiClientTypes.ObjectInclude;
|
|
343
360
|
}
|
|
344
361
|
|
|
345
362
|
declare class MSafeAccount {
|
|
@@ -351,7 +368,7 @@ declare class MSafeAccount {
|
|
|
351
368
|
constructor(globals: MSafeGlobals, info: IMSafeConfig);
|
|
352
369
|
static New(globals: MSafeGlobals, address: string): Promise<void>;
|
|
353
370
|
ownedCoins(): Promise<OwnedCoin[]>;
|
|
354
|
-
ownedObjects(options?: BatchObjectOptions): Promise<
|
|
371
|
+
ownedObjects(options?: BatchObjectOptions): Promise<OwnedObjectData[]>;
|
|
355
372
|
pendingTransaction(): Promise<PendingTx | undefined>;
|
|
356
373
|
historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
|
|
357
374
|
futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
|
|
@@ -381,7 +398,10 @@ declare class MSafeAccount {
|
|
|
381
398
|
}): Promise<void>;
|
|
382
399
|
skipNextFailedIntention(): Promise<void>;
|
|
383
400
|
fetchTransaction(): Promise<string[]>;
|
|
384
|
-
executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<
|
|
401
|
+
executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
|
|
402
|
+
effects: true;
|
|
403
|
+
events: true;
|
|
404
|
+
}>>;
|
|
385
405
|
dashboard(): Promise<_msafe_sui3_utils.IGetDashboardResp>;
|
|
386
406
|
private calculateWeightFromVotes;
|
|
387
407
|
private calculateWeight;
|
|
@@ -467,17 +487,17 @@ declare class Formatter {
|
|
|
467
487
|
declare function addPrefix(s: string, prefix: string): string;
|
|
468
488
|
|
|
469
489
|
declare const SUI_COIN = "0x2::sui::SUI";
|
|
470
|
-
declare function getPublicKeyFromChain(suiClient:
|
|
490
|
+
declare function getPublicKeyFromChain(suiClient: SuiGrpcClient, address: string): Promise<PublicKey | undefined>;
|
|
471
491
|
declare function getAllCoins(input: {
|
|
472
|
-
suiClient:
|
|
492
|
+
suiClient: SuiGrpcClient;
|
|
473
493
|
owner: string;
|
|
474
494
|
coinType: string | undefined;
|
|
475
|
-
}): Promise<
|
|
495
|
+
}): Promise<SuiClientTypes.Coin[]>;
|
|
476
496
|
|
|
477
497
|
declare class CoinHelper {
|
|
478
498
|
private _client;
|
|
479
499
|
private _coinMetaReg;
|
|
480
|
-
constructor(client:
|
|
500
|
+
constructor(client: SuiGrpcClient);
|
|
481
501
|
getCoinMeta(coinType: string): Promise<CoinMetadata | undefined>;
|
|
482
502
|
private queryCoinMeta;
|
|
483
503
|
}
|
|
@@ -485,12 +505,21 @@ declare const COIN_TYPE_ARG_REGEX: RegExp;
|
|
|
485
505
|
declare class Coin {
|
|
486
506
|
static isCoin(type: string | undefined | null): boolean;
|
|
487
507
|
static getCoinType(type: string): string | null;
|
|
488
|
-
static getBalance(data:
|
|
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;
|
|
489
518
|
}
|
|
490
519
|
|
|
491
520
|
/**
|
|
492
|
-
* Normalize a transaction
|
|
521
|
+
* Normalize a transaction value to {@link Transaction} (handles plain Transaction or serialized legacy shapes).
|
|
493
522
|
*/
|
|
494
523
|
declare function toSuiTransaction(txb: Transaction | unknown): Transaction;
|
|
495
524
|
|
|
496
|
-
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, msafeChainToSuiNetwork, stringToBuffer, toSuiTransaction };
|
|
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
|
@@ -2,8 +2,9 @@ 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
3
|
import * as _mysten_sui_cryptography from '@mysten/sui/cryptography';
|
|
4
4
|
import { PublicKey, SignatureWithBytes } from '@mysten/sui/cryptography';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
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';
|
|
7
8
|
import { Transaction } from '@mysten/sui/transactions';
|
|
8
9
|
import { Buffer } from 'buffer';
|
|
9
10
|
|
|
@@ -97,10 +98,12 @@ declare enum MSafeEnv {
|
|
|
97
98
|
prev = "prev",
|
|
98
99
|
prod = "prod"
|
|
99
100
|
}
|
|
101
|
+
/** Normalize HTTP(S) fullnode URL for SuiGrpcClient (gRPC-web) baseUrl. */
|
|
102
|
+
declare function httpUrlToGrpcBaseUrl(url: string): string;
|
|
100
103
|
interface MSafeConfig {
|
|
101
104
|
suiClient: {
|
|
102
105
|
url: string;
|
|
103
|
-
transport?:
|
|
106
|
+
transport?: RpcTransport;
|
|
104
107
|
};
|
|
105
108
|
backend: {
|
|
106
109
|
url: string;
|
|
@@ -111,7 +114,7 @@ interface MSafeConfig {
|
|
|
111
114
|
interface MSafeConfigOptions {
|
|
112
115
|
suiClient?: {
|
|
113
116
|
url: string;
|
|
114
|
-
transport?:
|
|
117
|
+
transport?: RpcTransport;
|
|
115
118
|
};
|
|
116
119
|
backend?: {
|
|
117
120
|
url?: string;
|
|
@@ -140,19 +143,18 @@ interface IWallet {
|
|
|
140
143
|
}): Promise<SignatureWithBytes>;
|
|
141
144
|
signAndExecuteTransactionBlock(input: {
|
|
142
145
|
transactionBlock: Transaction | Uint8Array;
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
}): Promise<SuiTransactionBlockResponse>;
|
|
146
|
+
include?: SuiClientTypes.TransactionInclude;
|
|
147
|
+
}): Promise<SuiClientTypes.TransactionResult>;
|
|
146
148
|
}
|
|
147
149
|
|
|
148
150
|
declare class MSafeGlobals {
|
|
149
151
|
readonly backend: IBackend;
|
|
150
|
-
readonly suiClient:
|
|
152
|
+
readonly suiClient: SuiGrpcClient;
|
|
151
153
|
readonly config: MSafeConfig;
|
|
152
154
|
_wallet: IWallet | undefined;
|
|
153
155
|
constructor(input: {
|
|
154
156
|
backend: IBackend;
|
|
155
|
-
suiClient:
|
|
157
|
+
suiClient: SuiGrpcClient;
|
|
156
158
|
config: MSafeConfig;
|
|
157
159
|
});
|
|
158
160
|
static New(env: MSafeEnv, options?: MSafeConfigOptions): Promise<MSafeGlobals>;
|
|
@@ -177,6 +179,15 @@ declare class PublicKeyHelper {
|
|
|
177
179
|
private getPublicKeyFromChain;
|
|
178
180
|
}
|
|
179
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
|
+
}>;
|
|
180
191
|
interface PendingTx {
|
|
181
192
|
application: string;
|
|
182
193
|
txType: TransactionType;
|
|
@@ -250,15 +261,15 @@ type SimulationResult = SimulationSuccessResult | SimulationFailedResult;
|
|
|
250
261
|
interface SimulationSuccessResult {
|
|
251
262
|
success: true;
|
|
252
263
|
gasPrice: bigint;
|
|
253
|
-
gasUsed: GasCostSummary;
|
|
264
|
+
gasUsed: SuiClientTypes.GasCostSummary;
|
|
254
265
|
gasBudget: bigint;
|
|
255
|
-
gasObject:
|
|
256
|
-
response:
|
|
266
|
+
gasObject: GasObjectReference;
|
|
267
|
+
response: SimulateDryRunResponse;
|
|
257
268
|
}
|
|
258
269
|
interface SimulationFailedResult {
|
|
259
270
|
success: false;
|
|
260
271
|
gasPrice: bigint;
|
|
261
|
-
response
|
|
272
|
+
response?: SimulateDryRunResponse;
|
|
262
273
|
simulationError: string;
|
|
263
274
|
}
|
|
264
275
|
interface SimulationOption extends IGasOption {
|
|
@@ -329,17 +340,23 @@ declare class Simulator {
|
|
|
329
340
|
private copyTransaction;
|
|
330
341
|
}
|
|
331
342
|
|
|
343
|
+
type CoinMetadata = SuiClientTypes.CoinMetadata;
|
|
332
344
|
interface OwnedCoin {
|
|
333
345
|
type: string;
|
|
334
346
|
balance: bigint;
|
|
335
347
|
metadata?: CoinMetadata;
|
|
336
348
|
}
|
|
337
349
|
|
|
338
|
-
|
|
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;
|
|
339
355
|
interface BatchObjectOptions {
|
|
340
356
|
filter?: ObjectFilter;
|
|
341
357
|
pageSize?: number;
|
|
342
|
-
|
|
358
|
+
/** Extra fields to request from the node; defaults include Move JSON for struct fields. */
|
|
359
|
+
objectInclude?: SuiClientTypes.ObjectInclude;
|
|
343
360
|
}
|
|
344
361
|
|
|
345
362
|
declare class MSafeAccount {
|
|
@@ -351,7 +368,7 @@ declare class MSafeAccount {
|
|
|
351
368
|
constructor(globals: MSafeGlobals, info: IMSafeConfig);
|
|
352
369
|
static New(globals: MSafeGlobals, address: string): Promise<void>;
|
|
353
370
|
ownedCoins(): Promise<OwnedCoin[]>;
|
|
354
|
-
ownedObjects(options?: BatchObjectOptions): Promise<
|
|
371
|
+
ownedObjects(options?: BatchObjectOptions): Promise<OwnedObjectData[]>;
|
|
355
372
|
pendingTransaction(): Promise<PendingTx | undefined>;
|
|
356
373
|
historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
|
|
357
374
|
futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
|
|
@@ -381,7 +398,10 @@ declare class MSafeAccount {
|
|
|
381
398
|
}): Promise<void>;
|
|
382
399
|
skipNextFailedIntention(): Promise<void>;
|
|
383
400
|
fetchTransaction(): Promise<string[]>;
|
|
384
|
-
executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<
|
|
401
|
+
executePendingTx(pending: PendingTx, isRejectTx?: boolean): Promise<_mysten_sui_client.SuiClientTypes.TransactionResult<{
|
|
402
|
+
effects: true;
|
|
403
|
+
events: true;
|
|
404
|
+
}>>;
|
|
385
405
|
dashboard(): Promise<_msafe_sui3_utils.IGetDashboardResp>;
|
|
386
406
|
private calculateWeightFromVotes;
|
|
387
407
|
private calculateWeight;
|
|
@@ -467,17 +487,17 @@ declare class Formatter {
|
|
|
467
487
|
declare function addPrefix(s: string, prefix: string): string;
|
|
468
488
|
|
|
469
489
|
declare const SUI_COIN = "0x2::sui::SUI";
|
|
470
|
-
declare function getPublicKeyFromChain(suiClient:
|
|
490
|
+
declare function getPublicKeyFromChain(suiClient: SuiGrpcClient, address: string): Promise<PublicKey | undefined>;
|
|
471
491
|
declare function getAllCoins(input: {
|
|
472
|
-
suiClient:
|
|
492
|
+
suiClient: SuiGrpcClient;
|
|
473
493
|
owner: string;
|
|
474
494
|
coinType: string | undefined;
|
|
475
|
-
}): Promise<
|
|
495
|
+
}): Promise<SuiClientTypes.Coin[]>;
|
|
476
496
|
|
|
477
497
|
declare class CoinHelper {
|
|
478
498
|
private _client;
|
|
479
499
|
private _coinMetaReg;
|
|
480
|
-
constructor(client:
|
|
500
|
+
constructor(client: SuiGrpcClient);
|
|
481
501
|
getCoinMeta(coinType: string): Promise<CoinMetadata | undefined>;
|
|
482
502
|
private queryCoinMeta;
|
|
483
503
|
}
|
|
@@ -485,12 +505,21 @@ declare const COIN_TYPE_ARG_REGEX: RegExp;
|
|
|
485
505
|
declare class Coin {
|
|
486
506
|
static isCoin(type: string | undefined | null): boolean;
|
|
487
507
|
static getCoinType(type: string): string | null;
|
|
488
|
-
static getBalance(data:
|
|
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;
|
|
489
518
|
}
|
|
490
519
|
|
|
491
520
|
/**
|
|
492
|
-
* Normalize a transaction
|
|
521
|
+
* Normalize a transaction value to {@link Transaction} (handles plain Transaction or serialized legacy shapes).
|
|
493
522
|
*/
|
|
494
523
|
declare function toSuiTransaction(txb: Transaction | unknown): Transaction;
|
|
495
524
|
|
|
496
|
-
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, msafeChainToSuiNetwork, stringToBuffer, toSuiTransaction };
|
|
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 };
|