@msafe/sui3-sdk 0.0.15-pre-3e855d9.0 → 0.0.16
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 +80 -91
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +99 -113
- package/dist/index.d.ts +99 -113
- package/dist/index.js +84 -93
- package/dist/index.js.map +1 -1
- package/package.json +8 -10
- package/src/backend/BackendImpl.ts +48 -86
- package/src/backend/interface.ts +25 -30
- package/src/core/MSafeAccount.ts +64 -45
- package/src/types/msafe.ts +9 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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,
|
|
4
|
+
import { SuiClient, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, GasCostSummary, DryRunTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
|
|
5
5
|
import * as _msafe_sui3_utils from '@msafe/sui3-utils';
|
|
6
|
-
import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult,
|
|
6
|
+
import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult, IGetPendingTransactionRequest, GetPendingTransactionResponse, IGetHistoryTransactionsRequest, GetHistoryTransactionsResponse, IGetIntentionsRequest, GetTransactionIntentionsResponse, ICreateMSafeReq, IProposeIntentionRequest, IVoteTransactionRequest, IBuildTransactionRequest, ISkipIntentionRequest, IGetAddressBookResult, UpdateAddressBookEntry, TransactionType, MultiSigAccount, CoinTransferIntention, ObjectTransferIntention } from '@msafe/sui3-utils';
|
|
7
7
|
import * as _mysten_sui_js_cryptography from '@mysten/sui.js/cryptography';
|
|
8
|
-
import {
|
|
8
|
+
import { PublicKey, SerializedSignature } from '@mysten/sui.js/cryptography';
|
|
9
9
|
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
10
10
|
import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
|
|
11
11
|
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
@@ -43,79 +43,6 @@ declare class IntentionHelper {
|
|
|
43
43
|
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
interface PendingTx {
|
|
47
|
-
digest: string;
|
|
48
|
-
payload: string;
|
|
49
|
-
msafeAddress: string;
|
|
50
|
-
isRejectTx: boolean;
|
|
51
|
-
intention: TxIntention;
|
|
52
|
-
creator: string;
|
|
53
|
-
createdAt: Date;
|
|
54
|
-
sequenceNumber: number;
|
|
55
|
-
votes: PendingVote[];
|
|
56
|
-
rejectDigest: string;
|
|
57
|
-
rejectPayload: string;
|
|
58
|
-
rejectVotes: PendingVote[];
|
|
59
|
-
}
|
|
60
|
-
interface PendingVote {
|
|
61
|
-
userAddress: string;
|
|
62
|
-
signature: string;
|
|
63
|
-
timestamp: Date;
|
|
64
|
-
}
|
|
65
|
-
interface HistorySendTx {
|
|
66
|
-
digest: string;
|
|
67
|
-
payload: string;
|
|
68
|
-
msafeAddress: string;
|
|
69
|
-
sequenceNumber: number;
|
|
70
|
-
isRejectTx: boolean;
|
|
71
|
-
status: string;
|
|
72
|
-
creator: string;
|
|
73
|
-
createdAt: Date;
|
|
74
|
-
votes: HistoryVote[];
|
|
75
|
-
}
|
|
76
|
-
interface ReceiveTransaction {
|
|
77
|
-
digest: string;
|
|
78
|
-
payload: string;
|
|
79
|
-
txType: string;
|
|
80
|
-
txSubType: string;
|
|
81
|
-
timestamp: Date;
|
|
82
|
-
}
|
|
83
|
-
interface HistoryVote {
|
|
84
|
-
userAddress: string;
|
|
85
|
-
timestamp: Date;
|
|
86
|
-
}
|
|
87
|
-
interface FutureIntention {
|
|
88
|
-
intentionId: string;
|
|
89
|
-
intention: TxIntention;
|
|
90
|
-
sequenceNumber: number;
|
|
91
|
-
msafeAddress: string;
|
|
92
|
-
creator: string;
|
|
93
|
-
txType: string;
|
|
94
|
-
txSubType: string;
|
|
95
|
-
rawData: string;
|
|
96
|
-
processed: boolean;
|
|
97
|
-
status: string;
|
|
98
|
-
statusRemark?: string;
|
|
99
|
-
createdAt: Date;
|
|
100
|
-
}
|
|
101
|
-
interface ProposeIntention {
|
|
102
|
-
application: string;
|
|
103
|
-
txType: string;
|
|
104
|
-
txSubType: string;
|
|
105
|
-
intention: TxIntention;
|
|
106
|
-
sequenceNumber: number;
|
|
107
|
-
userAddress: string;
|
|
108
|
-
msafeAddress: string;
|
|
109
|
-
signature: SerializedSignature;
|
|
110
|
-
}
|
|
111
|
-
interface SimulationResult {
|
|
112
|
-
success: boolean;
|
|
113
|
-
errorMsg?: string;
|
|
114
|
-
gasPrice: bigint;
|
|
115
|
-
gasUsed: GasCostSummary;
|
|
116
|
-
dryRunResult: DryRunTransactionBlockResponse;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
46
|
interface IBackend {
|
|
120
47
|
authSign(input: IAuthLoginReq): Promise<JWTToken>;
|
|
121
48
|
verifyToken(jwt?: JWTToken): Promise<boolean>;
|
|
@@ -132,13 +59,13 @@ interface IBackend {
|
|
|
132
59
|
msafeAddress: string;
|
|
133
60
|
status: UserMSafeStatus;
|
|
134
61
|
}): Promise<void>;
|
|
135
|
-
getPendingTransactions(
|
|
136
|
-
getHistoryTransactions(
|
|
137
|
-
getFutureIntentions(
|
|
138
|
-
getCurrentSequenceNumber(
|
|
139
|
-
getNextSequenceNumber(
|
|
62
|
+
getPendingTransactions(input: IGetPendingTransactionRequest): Promise<GetPendingTransactionResponse>;
|
|
63
|
+
getHistoryTransactions(input: IGetHistoryTransactionsRequest): Promise<GetHistoryTransactionsResponse>;
|
|
64
|
+
getFutureIntentions(input: IGetIntentionsRequest): Promise<GetTransactionIntentionsResponse>;
|
|
65
|
+
getCurrentSequenceNumber(address: string): Promise<number>;
|
|
66
|
+
getNextSequenceNumber(address: string): Promise<number>;
|
|
140
67
|
createMSafeAccount(input: ICreateMSafeReq): Promise<void>;
|
|
141
|
-
proposeIntention(input:
|
|
68
|
+
proposeIntention(input: IProposeIntentionRequest): Promise<void>;
|
|
142
69
|
proposePendingTransaction(input: {
|
|
143
70
|
intention: TxIntention;
|
|
144
71
|
userAddress: string;
|
|
@@ -146,25 +73,10 @@ interface IBackend {
|
|
|
146
73
|
digest: string;
|
|
147
74
|
signature: SerializedSignature;
|
|
148
75
|
}): Promise<void>;
|
|
149
|
-
rejectCurrentTx(input:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
signature: SerializedSignature;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
voteForTransaction(input: {
|
|
156
|
-
txDigest: string;
|
|
157
|
-
msafeAddress: string;
|
|
158
|
-
userAddress: string;
|
|
159
|
-
signature: SerializedSignature;
|
|
160
|
-
}): Promise<void>;
|
|
161
|
-
buildNextIntentionAndAddToPending(input: {
|
|
162
|
-
msafeAddress: string;
|
|
163
|
-
}): Promise<void>;
|
|
164
|
-
skipNextFailedIntention(input: {
|
|
165
|
-
msafeAddress: string;
|
|
166
|
-
userAddress: string;
|
|
167
|
-
}): Promise<void>;
|
|
76
|
+
rejectCurrentTx(input: IVoteTransactionRequest): Promise<void>;
|
|
77
|
+
voteForTransaction(input: IVoteTransactionRequest): Promise<void>;
|
|
78
|
+
buildNextIntentionAndAddToPending(input: IBuildTransactionRequest): Promise<void>;
|
|
79
|
+
skipNextFailedIntention(input: ISkipIntentionRequest): Promise<void>;
|
|
168
80
|
processExecutedTransaction(digest: string): Promise<void>;
|
|
169
81
|
getAddressBookEntries(pagination?: IPageOptions): Promise<IGetAddressBookResult>;
|
|
170
82
|
updateAddressBook(input: {
|
|
@@ -254,6 +166,84 @@ declare class PublicKeyHelper {
|
|
|
254
166
|
private getPublicKeyFromChain;
|
|
255
167
|
}
|
|
256
168
|
|
|
169
|
+
interface PendingTx {
|
|
170
|
+
txType: TransactionType;
|
|
171
|
+
txSubType: string;
|
|
172
|
+
digest: string;
|
|
173
|
+
payload: string;
|
|
174
|
+
msafeAddress: string;
|
|
175
|
+
intention: TxIntention;
|
|
176
|
+
creator: string;
|
|
177
|
+
createdAt: Date;
|
|
178
|
+
sequenceNumber: number;
|
|
179
|
+
votes: PendingVote[];
|
|
180
|
+
rejectDigest: string;
|
|
181
|
+
rejectPayload: string;
|
|
182
|
+
rejectVotes: PendingVote[];
|
|
183
|
+
}
|
|
184
|
+
interface PendingVote {
|
|
185
|
+
userAddress: string;
|
|
186
|
+
signature: string;
|
|
187
|
+
timestamp: Date;
|
|
188
|
+
}
|
|
189
|
+
interface HistorySendTx {
|
|
190
|
+
digest: string;
|
|
191
|
+
payload: string;
|
|
192
|
+
msafeAddress: string;
|
|
193
|
+
sequenceNumber: number;
|
|
194
|
+
isRejectTx: boolean;
|
|
195
|
+
status: string;
|
|
196
|
+
creator: string;
|
|
197
|
+
createdAt: Date;
|
|
198
|
+
votes: HistoryVote[];
|
|
199
|
+
}
|
|
200
|
+
interface ReceiveTransaction {
|
|
201
|
+
digest: string;
|
|
202
|
+
payload: string;
|
|
203
|
+
txType: string;
|
|
204
|
+
txSubType: string;
|
|
205
|
+
timestamp: Date;
|
|
206
|
+
}
|
|
207
|
+
interface HistoryVote {
|
|
208
|
+
userAddress: string;
|
|
209
|
+
timestamp: Date;
|
|
210
|
+
}
|
|
211
|
+
interface FutureIntention {
|
|
212
|
+
intentionId: string;
|
|
213
|
+
intention: TxIntention;
|
|
214
|
+
sequenceNumber: number;
|
|
215
|
+
msafeAddress: string;
|
|
216
|
+
creator: string;
|
|
217
|
+
txType: string;
|
|
218
|
+
txSubType: string;
|
|
219
|
+
rawData: string;
|
|
220
|
+
processed: boolean;
|
|
221
|
+
status: string;
|
|
222
|
+
statusRemark?: string;
|
|
223
|
+
createdAt: Date;
|
|
224
|
+
}
|
|
225
|
+
interface ProposeIntention {
|
|
226
|
+
application: string;
|
|
227
|
+
txType: string;
|
|
228
|
+
txSubType: string;
|
|
229
|
+
intention: TxIntention;
|
|
230
|
+
sequenceNumber: number;
|
|
231
|
+
userAddress: string;
|
|
232
|
+
msafeAddress: string;
|
|
233
|
+
signature: SerializedSignature;
|
|
234
|
+
}
|
|
235
|
+
interface SimulationResult {
|
|
236
|
+
success: boolean;
|
|
237
|
+
errorMsg?: string;
|
|
238
|
+
gasPrice: bigint;
|
|
239
|
+
gasUsed: GasCostSummary;
|
|
240
|
+
dryRunResult: DryRunTransactionBlockResponse;
|
|
241
|
+
}
|
|
242
|
+
interface Pagination {
|
|
243
|
+
page?: string;
|
|
244
|
+
limit?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
257
247
|
interface CreateMSafeInfo {
|
|
258
248
|
name: string;
|
|
259
249
|
description?: string;
|
|
@@ -314,23 +304,19 @@ declare class MSafeAccount {
|
|
|
314
304
|
ownedCoins(): Promise<OwnedCoin[]>;
|
|
315
305
|
ownedObjects(options?: BatchObjectOptions): Promise<SuiObjectData[]>;
|
|
316
306
|
pendingTransaction(): Promise<PendingTx | undefined>;
|
|
317
|
-
historyTransaction(
|
|
318
|
-
futureIntentions(
|
|
307
|
+
historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
|
|
308
|
+
futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
|
|
319
309
|
currentSequenceNumber(): Promise<number>;
|
|
320
310
|
nextSequenceNumber(): Promise<number>;
|
|
321
|
-
proposeIntention(input:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
txSubType: string;
|
|
325
|
-
intention: TxIntention;
|
|
326
|
-
sequenceNumber: number;
|
|
327
|
-
}): Promise<void>;
|
|
311
|
+
proposeIntention(input: Omit<IProposeIntentionRequest, 'signature' | 'msafeAddress'>): Promise<void>;
|
|
312
|
+
proposeCoinTransferIntention(intention: CoinTransferIntention): Promise<void>;
|
|
313
|
+
proposeObjectTransferIntention(intention: ObjectTransferIntention): Promise<void>;
|
|
328
314
|
voteForTransaction(digest: string, payload: string): Promise<void>;
|
|
329
315
|
proposePendingTransaction(intention: TxIntention): Promise<void>;
|
|
330
|
-
rejectCurrentTx(
|
|
316
|
+
rejectCurrentTx(): Promise<void>;
|
|
331
317
|
buildNextIntentionAndAddToPending(): Promise<void>;
|
|
332
318
|
skipNextFailedIntention(): Promise<void>;
|
|
333
|
-
simulateIntention(intention:
|
|
319
|
+
simulateIntention(intention: any): Promise<SimulationResult>;
|
|
334
320
|
executePendingTx(pending: PendingTx): Promise<_mysten_sui_js_client.SuiTransactionBlockResponse>;
|
|
335
321
|
get address(): string;
|
|
336
322
|
private get backend();
|
|
@@ -427,4 +413,4 @@ declare class Coin {
|
|
|
427
413
|
static getBalance(data: SuiObjectData): bigint | undefined;
|
|
428
414
|
}
|
|
429
415
|
|
|
430
|
-
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, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSAFE_APPLICATION, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationResult, TESTNET_RPC_URL, type TxIntention, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|
|
416
|
+
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, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSAFE_APPLICATION, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationResult, TESTNET_RPC_URL, type TxIntention, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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,
|
|
4
|
+
import { SuiClient, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, GasCostSummary, DryRunTransactionBlockResponse, CoinMetadata, SuiObjectDataOptions, SuiObjectResponse, SuiObjectData, CoinStruct } from '@mysten/sui.js/client';
|
|
5
5
|
import * as _msafe_sui3_utils from '@msafe/sui3-utils';
|
|
6
|
-
import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult,
|
|
6
|
+
import { IAuthLoginReq, JWTToken, IMSafeConfig, IUserInfoResp, UserMSafeStatus, IPageOptions, IPagedResult, IGetPendingTransactionRequest, GetPendingTransactionResponse, IGetHistoryTransactionsRequest, GetHistoryTransactionsResponse, IGetIntentionsRequest, GetTransactionIntentionsResponse, ICreateMSafeReq, IProposeIntentionRequest, IVoteTransactionRequest, IBuildTransactionRequest, ISkipIntentionRequest, IGetAddressBookResult, UpdateAddressBookEntry, TransactionType, MultiSigAccount, CoinTransferIntention, ObjectTransferIntention } from '@msafe/sui3-utils';
|
|
7
7
|
import * as _mysten_sui_js_cryptography from '@mysten/sui.js/cryptography';
|
|
8
|
-
import {
|
|
8
|
+
import { PublicKey, SerializedSignature } from '@mysten/sui.js/cryptography';
|
|
9
9
|
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
10
10
|
import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
|
|
11
11
|
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
@@ -43,79 +43,6 @@ declare class IntentionHelper {
|
|
|
43
43
|
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
interface PendingTx {
|
|
47
|
-
digest: string;
|
|
48
|
-
payload: string;
|
|
49
|
-
msafeAddress: string;
|
|
50
|
-
isRejectTx: boolean;
|
|
51
|
-
intention: TxIntention;
|
|
52
|
-
creator: string;
|
|
53
|
-
createdAt: Date;
|
|
54
|
-
sequenceNumber: number;
|
|
55
|
-
votes: PendingVote[];
|
|
56
|
-
rejectDigest: string;
|
|
57
|
-
rejectPayload: string;
|
|
58
|
-
rejectVotes: PendingVote[];
|
|
59
|
-
}
|
|
60
|
-
interface PendingVote {
|
|
61
|
-
userAddress: string;
|
|
62
|
-
signature: string;
|
|
63
|
-
timestamp: Date;
|
|
64
|
-
}
|
|
65
|
-
interface HistorySendTx {
|
|
66
|
-
digest: string;
|
|
67
|
-
payload: string;
|
|
68
|
-
msafeAddress: string;
|
|
69
|
-
sequenceNumber: number;
|
|
70
|
-
isRejectTx: boolean;
|
|
71
|
-
status: string;
|
|
72
|
-
creator: string;
|
|
73
|
-
createdAt: Date;
|
|
74
|
-
votes: HistoryVote[];
|
|
75
|
-
}
|
|
76
|
-
interface ReceiveTransaction {
|
|
77
|
-
digest: string;
|
|
78
|
-
payload: string;
|
|
79
|
-
txType: string;
|
|
80
|
-
txSubType: string;
|
|
81
|
-
timestamp: Date;
|
|
82
|
-
}
|
|
83
|
-
interface HistoryVote {
|
|
84
|
-
userAddress: string;
|
|
85
|
-
timestamp: Date;
|
|
86
|
-
}
|
|
87
|
-
interface FutureIntention {
|
|
88
|
-
intentionId: string;
|
|
89
|
-
intention: TxIntention;
|
|
90
|
-
sequenceNumber: number;
|
|
91
|
-
msafeAddress: string;
|
|
92
|
-
creator: string;
|
|
93
|
-
txType: string;
|
|
94
|
-
txSubType: string;
|
|
95
|
-
rawData: string;
|
|
96
|
-
processed: boolean;
|
|
97
|
-
status: string;
|
|
98
|
-
statusRemark?: string;
|
|
99
|
-
createdAt: Date;
|
|
100
|
-
}
|
|
101
|
-
interface ProposeIntention {
|
|
102
|
-
application: string;
|
|
103
|
-
txType: string;
|
|
104
|
-
txSubType: string;
|
|
105
|
-
intention: TxIntention;
|
|
106
|
-
sequenceNumber: number;
|
|
107
|
-
userAddress: string;
|
|
108
|
-
msafeAddress: string;
|
|
109
|
-
signature: SerializedSignature;
|
|
110
|
-
}
|
|
111
|
-
interface SimulationResult {
|
|
112
|
-
success: boolean;
|
|
113
|
-
errorMsg?: string;
|
|
114
|
-
gasPrice: bigint;
|
|
115
|
-
gasUsed: GasCostSummary;
|
|
116
|
-
dryRunResult: DryRunTransactionBlockResponse;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
46
|
interface IBackend {
|
|
120
47
|
authSign(input: IAuthLoginReq): Promise<JWTToken>;
|
|
121
48
|
verifyToken(jwt?: JWTToken): Promise<boolean>;
|
|
@@ -132,13 +59,13 @@ interface IBackend {
|
|
|
132
59
|
msafeAddress: string;
|
|
133
60
|
status: UserMSafeStatus;
|
|
134
61
|
}): Promise<void>;
|
|
135
|
-
getPendingTransactions(
|
|
136
|
-
getHistoryTransactions(
|
|
137
|
-
getFutureIntentions(
|
|
138
|
-
getCurrentSequenceNumber(
|
|
139
|
-
getNextSequenceNumber(
|
|
62
|
+
getPendingTransactions(input: IGetPendingTransactionRequest): Promise<GetPendingTransactionResponse>;
|
|
63
|
+
getHistoryTransactions(input: IGetHistoryTransactionsRequest): Promise<GetHistoryTransactionsResponse>;
|
|
64
|
+
getFutureIntentions(input: IGetIntentionsRequest): Promise<GetTransactionIntentionsResponse>;
|
|
65
|
+
getCurrentSequenceNumber(address: string): Promise<number>;
|
|
66
|
+
getNextSequenceNumber(address: string): Promise<number>;
|
|
140
67
|
createMSafeAccount(input: ICreateMSafeReq): Promise<void>;
|
|
141
|
-
proposeIntention(input:
|
|
68
|
+
proposeIntention(input: IProposeIntentionRequest): Promise<void>;
|
|
142
69
|
proposePendingTransaction(input: {
|
|
143
70
|
intention: TxIntention;
|
|
144
71
|
userAddress: string;
|
|
@@ -146,25 +73,10 @@ interface IBackend {
|
|
|
146
73
|
digest: string;
|
|
147
74
|
signature: SerializedSignature;
|
|
148
75
|
}): Promise<void>;
|
|
149
|
-
rejectCurrentTx(input:
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
signature: SerializedSignature;
|
|
154
|
-
}): Promise<void>;
|
|
155
|
-
voteForTransaction(input: {
|
|
156
|
-
txDigest: string;
|
|
157
|
-
msafeAddress: string;
|
|
158
|
-
userAddress: string;
|
|
159
|
-
signature: SerializedSignature;
|
|
160
|
-
}): Promise<void>;
|
|
161
|
-
buildNextIntentionAndAddToPending(input: {
|
|
162
|
-
msafeAddress: string;
|
|
163
|
-
}): Promise<void>;
|
|
164
|
-
skipNextFailedIntention(input: {
|
|
165
|
-
msafeAddress: string;
|
|
166
|
-
userAddress: string;
|
|
167
|
-
}): Promise<void>;
|
|
76
|
+
rejectCurrentTx(input: IVoteTransactionRequest): Promise<void>;
|
|
77
|
+
voteForTransaction(input: IVoteTransactionRequest): Promise<void>;
|
|
78
|
+
buildNextIntentionAndAddToPending(input: IBuildTransactionRequest): Promise<void>;
|
|
79
|
+
skipNextFailedIntention(input: ISkipIntentionRequest): Promise<void>;
|
|
168
80
|
processExecutedTransaction(digest: string): Promise<void>;
|
|
169
81
|
getAddressBookEntries(pagination?: IPageOptions): Promise<IGetAddressBookResult>;
|
|
170
82
|
updateAddressBook(input: {
|
|
@@ -254,6 +166,84 @@ declare class PublicKeyHelper {
|
|
|
254
166
|
private getPublicKeyFromChain;
|
|
255
167
|
}
|
|
256
168
|
|
|
169
|
+
interface PendingTx {
|
|
170
|
+
txType: TransactionType;
|
|
171
|
+
txSubType: string;
|
|
172
|
+
digest: string;
|
|
173
|
+
payload: string;
|
|
174
|
+
msafeAddress: string;
|
|
175
|
+
intention: TxIntention;
|
|
176
|
+
creator: string;
|
|
177
|
+
createdAt: Date;
|
|
178
|
+
sequenceNumber: number;
|
|
179
|
+
votes: PendingVote[];
|
|
180
|
+
rejectDigest: string;
|
|
181
|
+
rejectPayload: string;
|
|
182
|
+
rejectVotes: PendingVote[];
|
|
183
|
+
}
|
|
184
|
+
interface PendingVote {
|
|
185
|
+
userAddress: string;
|
|
186
|
+
signature: string;
|
|
187
|
+
timestamp: Date;
|
|
188
|
+
}
|
|
189
|
+
interface HistorySendTx {
|
|
190
|
+
digest: string;
|
|
191
|
+
payload: string;
|
|
192
|
+
msafeAddress: string;
|
|
193
|
+
sequenceNumber: number;
|
|
194
|
+
isRejectTx: boolean;
|
|
195
|
+
status: string;
|
|
196
|
+
creator: string;
|
|
197
|
+
createdAt: Date;
|
|
198
|
+
votes: HistoryVote[];
|
|
199
|
+
}
|
|
200
|
+
interface ReceiveTransaction {
|
|
201
|
+
digest: string;
|
|
202
|
+
payload: string;
|
|
203
|
+
txType: string;
|
|
204
|
+
txSubType: string;
|
|
205
|
+
timestamp: Date;
|
|
206
|
+
}
|
|
207
|
+
interface HistoryVote {
|
|
208
|
+
userAddress: string;
|
|
209
|
+
timestamp: Date;
|
|
210
|
+
}
|
|
211
|
+
interface FutureIntention {
|
|
212
|
+
intentionId: string;
|
|
213
|
+
intention: TxIntention;
|
|
214
|
+
sequenceNumber: number;
|
|
215
|
+
msafeAddress: string;
|
|
216
|
+
creator: string;
|
|
217
|
+
txType: string;
|
|
218
|
+
txSubType: string;
|
|
219
|
+
rawData: string;
|
|
220
|
+
processed: boolean;
|
|
221
|
+
status: string;
|
|
222
|
+
statusRemark?: string;
|
|
223
|
+
createdAt: Date;
|
|
224
|
+
}
|
|
225
|
+
interface ProposeIntention {
|
|
226
|
+
application: string;
|
|
227
|
+
txType: string;
|
|
228
|
+
txSubType: string;
|
|
229
|
+
intention: TxIntention;
|
|
230
|
+
sequenceNumber: number;
|
|
231
|
+
userAddress: string;
|
|
232
|
+
msafeAddress: string;
|
|
233
|
+
signature: SerializedSignature;
|
|
234
|
+
}
|
|
235
|
+
interface SimulationResult {
|
|
236
|
+
success: boolean;
|
|
237
|
+
errorMsg?: string;
|
|
238
|
+
gasPrice: bigint;
|
|
239
|
+
gasUsed: GasCostSummary;
|
|
240
|
+
dryRunResult: DryRunTransactionBlockResponse;
|
|
241
|
+
}
|
|
242
|
+
interface Pagination {
|
|
243
|
+
page?: string;
|
|
244
|
+
limit?: string;
|
|
245
|
+
}
|
|
246
|
+
|
|
257
247
|
interface CreateMSafeInfo {
|
|
258
248
|
name: string;
|
|
259
249
|
description?: string;
|
|
@@ -314,23 +304,19 @@ declare class MSafeAccount {
|
|
|
314
304
|
ownedCoins(): Promise<OwnedCoin[]>;
|
|
315
305
|
ownedObjects(options?: BatchObjectOptions): Promise<SuiObjectData[]>;
|
|
316
306
|
pendingTransaction(): Promise<PendingTx | undefined>;
|
|
317
|
-
historyTransaction(
|
|
318
|
-
futureIntentions(
|
|
307
|
+
historyTransaction(pagination?: Pagination): Promise<_msafe_sui3_utils.GetHistoryTransactionsResponse>;
|
|
308
|
+
futureIntentions(pagination?: Pagination): Promise<_msafe_sui3_utils.GetTransactionIntentionsResponse>;
|
|
319
309
|
currentSequenceNumber(): Promise<number>;
|
|
320
310
|
nextSequenceNumber(): Promise<number>;
|
|
321
|
-
proposeIntention(input:
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
txSubType: string;
|
|
325
|
-
intention: TxIntention;
|
|
326
|
-
sequenceNumber: number;
|
|
327
|
-
}): Promise<void>;
|
|
311
|
+
proposeIntention(input: Omit<IProposeIntentionRequest, 'signature' | 'msafeAddress'>): Promise<void>;
|
|
312
|
+
proposeCoinTransferIntention(intention: CoinTransferIntention): Promise<void>;
|
|
313
|
+
proposeObjectTransferIntention(intention: ObjectTransferIntention): Promise<void>;
|
|
328
314
|
voteForTransaction(digest: string, payload: string): Promise<void>;
|
|
329
315
|
proposePendingTransaction(intention: TxIntention): Promise<void>;
|
|
330
|
-
rejectCurrentTx(
|
|
316
|
+
rejectCurrentTx(): Promise<void>;
|
|
331
317
|
buildNextIntentionAndAddToPending(): Promise<void>;
|
|
332
318
|
skipNextFailedIntention(): Promise<void>;
|
|
333
|
-
simulateIntention(intention:
|
|
319
|
+
simulateIntention(intention: any): Promise<SimulationResult>;
|
|
334
320
|
executePendingTx(pending: PendingTx): Promise<_mysten_sui_js_client.SuiTransactionBlockResponse>;
|
|
335
321
|
get address(): string;
|
|
336
322
|
private get backend();
|
|
@@ -427,4 +413,4 @@ declare class Coin {
|
|
|
427
413
|
static getBalance(data: SuiObjectData): bigint | undefined;
|
|
428
414
|
}
|
|
429
415
|
|
|
430
|
-
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, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSAFE_APPLICATION, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationResult, TESTNET_RPC_URL, type TxIntention, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|
|
416
|
+
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, type IntentionCoinTransfer, IntentionHelper, type IntentionObjectTransfer, LOCAL_API_URL, LOCAL_SYNCING_URL, MAINNET_RPC_URL, MSAFE_APPLICATION, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, type Pagination, type PendingTx, type PendingVote, type ProposeIntention, type ReceiveTransaction, SUI_COIN, SignatureVerifier, type SimulationResult, TESTNET_RPC_URL, type TxIntention, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|