@msafe/sui3-sdk 0.0.11 → 0.0.12-pre-84adfec.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/dist/index.cjs +721 -685
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -7
- package/dist/index.d.ts +19 -7
- package/dist/index.js +716 -677
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/backend/BackendImpl.ts +6 -0
- package/src/backend/PseudoBackend.ts +3 -0
- package/src/backend/interface.ts +3 -0
- package/src/core/MSafeAccount.ts +58 -19
- package/src/core/MessageHelper.ts +6 -2
- package/src/globals/const.ts +2 -0
- package/src/types/msafe.ts +15 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _mysten_sui_js_src_cryptography from '@mysten/sui.js/src/cryptography';
|
|
2
2
|
import { PublicKey as PublicKey$1 } from '@mysten/sui.js/src/cryptography';
|
|
3
3
|
import * as _mysten_sui_js_client from '@mysten/sui.js/client';
|
|
4
|
-
import { SuiClient, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
|
|
4
|
+
import { SuiClient, GasCostSummary, DryRunTransactionBlockResponse, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
|
|
5
5
|
import * as _msafe_sui3_utils from '@msafe/sui3-utils';
|
|
6
6
|
import { AuthLoginRequest, MSafeAccountInfo, UserWithOwnedMSafe, HistoryTransaction, CreateMSafeAccountInfoRequest, MultisigAccountManager } from '@msafe/sui3-utils';
|
|
7
7
|
import { PublicKey, SerializedSignature, SignatureScheme } from '@mysten/sui.js/cryptography';
|
|
@@ -72,9 +72,9 @@ interface PendingTx {
|
|
|
72
72
|
createdAt: Date;
|
|
73
73
|
sequenceNumber: number;
|
|
74
74
|
votes: PendingVote[];
|
|
75
|
-
rejectDigest
|
|
76
|
-
rejectPayload
|
|
77
|
-
rejectVotes
|
|
75
|
+
rejectDigest: string;
|
|
76
|
+
rejectPayload: string;
|
|
77
|
+
rejectVotes: PendingVote[];
|
|
78
78
|
}
|
|
79
79
|
interface PendingVote {
|
|
80
80
|
userAddress: string;
|
|
@@ -117,6 +117,13 @@ interface FutureIntention {
|
|
|
117
117
|
statusRemark?: string;
|
|
118
118
|
createdAt: Date;
|
|
119
119
|
}
|
|
120
|
+
interface SimulationResult {
|
|
121
|
+
success: boolean;
|
|
122
|
+
errorMsg?: string;
|
|
123
|
+
gasPrice: bigint;
|
|
124
|
+
gasUsed: GasCostSummary;
|
|
125
|
+
dryRunResult: DryRunTransactionBlockResponse;
|
|
126
|
+
}
|
|
120
127
|
|
|
121
128
|
interface IWallet {
|
|
122
129
|
walletType: string;
|
|
@@ -205,6 +212,9 @@ interface IBackend {
|
|
|
205
212
|
userAddress: string;
|
|
206
213
|
msafeAddress: string;
|
|
207
214
|
signature: SerializedSignature;
|
|
215
|
+
application: string;
|
|
216
|
+
txType: string;
|
|
217
|
+
txSubType: string;
|
|
208
218
|
}): Promise<void>;
|
|
209
219
|
proposePendingTransaction(input: {
|
|
210
220
|
intention: TxIntention;
|
|
@@ -265,6 +275,7 @@ type DBConfig = ModelConfig;
|
|
|
265
275
|
declare const UNIT_DATABASE_CONFIG: DBConfig;
|
|
266
276
|
declare const LOCAL_DATABASE_CONFIG: DBConfig;
|
|
267
277
|
declare const DEV_DATABASE_CONFIG: DBConfig;
|
|
278
|
+
declare const MSAFE_APPLICATION = "msafe";
|
|
268
279
|
declare const TESTNET_RPC_URL = "https://sui-testnet.blockvision.org/v1/2Sgk89ivT64MnKdcGzjmyjY2ndD";
|
|
269
280
|
declare const MAINNET_RPC_URL = "https://sui-mainnet.blockvision.org/v1/2Sgk7NPvqkd7mESYkxF01yX15l7";
|
|
270
281
|
declare const LOCAL_API_URL = "http://127.0.0.1:3000";
|
|
@@ -328,6 +339,7 @@ declare class MessageHelper {
|
|
|
328
339
|
static updateAddressBookMessage(updates: UpdateAddressBookEntry[]): string;
|
|
329
340
|
}
|
|
330
341
|
interface ProposeIntentionData {
|
|
342
|
+
msafeAddress: string;
|
|
331
343
|
intention: TxIntention;
|
|
332
344
|
sn: number;
|
|
333
345
|
}
|
|
@@ -361,9 +373,8 @@ declare class MSafeAccount {
|
|
|
361
373
|
static new(globals: MSafeGlobals, address: string): Promise<MSafeAccountInfo>;
|
|
362
374
|
ownedCoins(): Promise<OwnedCoin[]>;
|
|
363
375
|
ownedObjects(options?: BatchObjectOptions): Promise<SuiObjectData[]>;
|
|
364
|
-
pendingTransactions(): Promise<PendingTx[]>;
|
|
365
376
|
pendingTransaction(): Promise<PendingTx | undefined>;
|
|
366
|
-
historyTransaction(paginationOption?: PaginationOption): Promise<_msafe_sui3_utils.HistoryTransaction
|
|
377
|
+
historyTransaction(paginationOption?: PaginationOption): Promise<PagedResult<_msafe_sui3_utils.HistoryTransaction>>;
|
|
367
378
|
futureIntentions(paginationOption?: PaginationOption): Promise<FutureIntention[]>;
|
|
368
379
|
currentSequenceNumber(): Promise<number>;
|
|
369
380
|
nextSequenceNumber(): Promise<number>;
|
|
@@ -373,6 +384,7 @@ declare class MSafeAccount {
|
|
|
373
384
|
rejectCurrentTx(pending?: PendingTx): Promise<void>;
|
|
374
385
|
buildNextIntentionAndAddToPending(): Promise<void>;
|
|
375
386
|
skipNextFailedIntention(): Promise<void>;
|
|
387
|
+
simulateIntention(intention: TxIntention): Promise<SimulationResult>;
|
|
376
388
|
executePendingTx(pending: PendingTx): Promise<_mysten_sui_js_client.SuiTransactionBlockResponse>;
|
|
377
389
|
get address(): string;
|
|
378
390
|
private get backend();
|
|
@@ -477,4 +489,4 @@ declare class Coin {
|
|
|
477
489
|
static getBalance(data: SuiObjectData): bigint | undefined;
|
|
478
490
|
}
|
|
479
491
|
|
|
480
|
-
export { AUTH_SIGN_MESSAGE, AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_API_URL, DEV_DATABASE_CONFIG, DEV_SYNCING_URL, type DeleteAddressBookEntry, ENV_CONFIGS, Formatter, type FutureIntention, type GetAddressBookResult, type GetAddressBookResultEntry, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, type JWTToken, LOCAL_API_URL, LOCAL_DATABASE_CONFIG, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, MessageHelper, OpAddressBookType, type PagedMeta, type PagedResult, type PaginationMeta, type PaginationOption, type PaginationResponse, type PendingTx, type PendingVote, PublicKeySerde, type ReceiveTransaction, SUI_COIN, SignatureVerifier, TESTNET_RPC_URL, type TxIntention, UNIT_DATABASE_CONFIG, Uint8ArrayToHex, type UpdateAddressBookEntry, type UpsertAddressBookEntry, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|
|
492
|
+
export { AUTH_SIGN_MESSAGE, AddressBookSDK, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_API_URL, DEV_DATABASE_CONFIG, DEV_SYNCING_URL, type DeleteAddressBookEntry, ENV_CONFIGS, Formatter, type FutureIntention, type GetAddressBookResult, type GetAddressBookResultEntry, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, type JWTToken, LOCAL_API_URL, LOCAL_DATABASE_CONFIG, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSAFE_APPLICATION, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, MessageHelper, OpAddressBookType, type PagedMeta, type PagedResult, type PaginationMeta, type PaginationOption, type PaginationResponse, type PendingTx, type PendingVote, PublicKeySerde, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationResult, TESTNET_RPC_URL, type TxIntention, UNIT_DATABASE_CONFIG, Uint8ArrayToHex, type UpdateAddressBookEntry, type UpsertAddressBookEntry, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|