@msafe/sui3-sdk 0.0.5 → 0.0.6-pre-fdcc3ff.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 +258 -969
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +24 -89
- package/dist/index.d.ts +24 -89
- package/dist/index.js +251 -958
- package/dist/index.js.map +1 -1
- package/package.json +3 -1
- package/src/backend/BackendImpl.ts +196 -0
- package/src/backend/PseudoBackend.ts +25 -14
- package/src/backend/interface.ts +10 -10
- package/src/backend/types.ts +0 -21
- package/src/core/CreateHelper.ts +22 -12
- package/src/core/MSafeAccount.ts +9 -5
- package/src/core/MSafeClient.ts +2 -6
- package/src/globals/MSafeGlobals.ts +2 -1
- package/src/globals/const.ts +8 -1
- package/src/types/msafe.ts +0 -20
- package/src/utils/index.ts +0 -1
- package/src/utils/multi-sig.ts +0 -113
package/dist/index.d.cts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as _mysten_sui_js_src_cryptography from '@mysten/sui.js/src/cryptography';
|
|
2
|
-
import { PublicKey } from '@mysten/sui.js/src/cryptography';
|
|
2
|
+
import { PublicKey as PublicKey$1 } from '@mysten/sui.js/src/cryptography';
|
|
3
3
|
import { SuiClient, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, CoinStruct, CoinMetadata, SuiObjectData } from '@mysten/sui.js/client';
|
|
4
|
-
import
|
|
4
|
+
import * as _msafe_sui3_utils from '@msafe/sui3-utils';
|
|
5
|
+
import { AuthLoginRequest, MSafeAccountInfo, UserWithOwnedMSafe, CreateMSafeAccountInfoRequest, MultisigAccountManager } from '@msafe/sui3-utils';
|
|
6
|
+
import { PublicKey, SerializedSignature, SignatureScheme } from '@mysten/sui.js/cryptography';
|
|
5
7
|
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
6
8
|
import { ModelConfig } from '@msafe/sui3-model/common';
|
|
7
9
|
import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
|
|
8
10
|
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
9
11
|
import * as _mysten_sui_js_dist_cjs_client from '@mysten/sui.js/dist/cjs/client';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
type JWTToken = string;
|
|
12
14
|
|
|
13
15
|
interface IntentionCoinTransfer {
|
|
14
16
|
txType: 'CoinTransfer';
|
|
@@ -43,21 +45,6 @@ declare class IntentionHelper {
|
|
|
43
45
|
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
interface MSafeAccountInfo {
|
|
47
|
-
address: string;
|
|
48
|
-
ownersWithWeightPK: OwnerWithWeightPK[];
|
|
49
|
-
threshold: number;
|
|
50
|
-
name: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
creationNonce: number;
|
|
53
|
-
}
|
|
54
|
-
type OwnerWithWeightPK = OwnerWithWeight & {
|
|
55
|
-
publicKey: PublicKey;
|
|
56
|
-
};
|
|
57
|
-
interface OwnerWithWeight {
|
|
58
|
-
address: string;
|
|
59
|
-
weight: number;
|
|
60
|
-
}
|
|
61
48
|
interface PendingTx {
|
|
62
49
|
digest: string;
|
|
63
50
|
payload: string;
|
|
@@ -110,34 +97,11 @@ interface FutureIntention {
|
|
|
110
97
|
createdAt: Date;
|
|
111
98
|
}
|
|
112
99
|
|
|
113
|
-
type JWTToken = string;
|
|
114
|
-
interface CreateMSafeParams {
|
|
115
|
-
ownerWithWeight: OwnerWithWeightPK[];
|
|
116
|
-
threshold: number;
|
|
117
|
-
name: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
creationNonce: number;
|
|
120
|
-
signature: SerializedSignature;
|
|
121
|
-
}
|
|
122
|
-
interface UserWithOwnedMSafe {
|
|
123
|
-
address: string;
|
|
124
|
-
publicKey: string;
|
|
125
|
-
schema: string;
|
|
126
|
-
creationNonce: number;
|
|
127
|
-
ownedMSafe: MSafeAccountInfo[];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
100
|
interface IBackend {
|
|
131
|
-
|
|
132
|
-
authSign(input: {
|
|
133
|
-
address: string;
|
|
134
|
-
message: string;
|
|
135
|
-
signature: SerializedSignature;
|
|
136
|
-
walletType: string;
|
|
137
|
-
}): Promise<JWTToken>;
|
|
101
|
+
authSign(input: AuthLoginRequest): Promise<JWTToken>;
|
|
138
102
|
setJWTToken(token: JWTToken): void;
|
|
139
|
-
getPublicKey(address: string): Promise<PublicKey
|
|
140
|
-
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey
|
|
103
|
+
getPublicKey(address: string): Promise<PublicKey | undefined>;
|
|
104
|
+
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey | undefined)[]>;
|
|
141
105
|
getMSafeAccountInfo(msafeAddress: string): Promise<MSafeAccountInfo>;
|
|
142
106
|
getUserInfo(userAddress: string): Promise<UserWithOwnedMSafe>;
|
|
143
107
|
getPendingTransactions(msafeAddress: string): Promise<PendingTx[]>;
|
|
@@ -145,7 +109,7 @@ interface IBackend {
|
|
|
145
109
|
getFutureIntentions(msafeAddress: string): Promise<FutureIntention[]>;
|
|
146
110
|
getCurrentSequenceNumber(msafeAddress: string): Promise<number>;
|
|
147
111
|
getNextSequenceNumber(msafeAddress: string): Promise<number>;
|
|
148
|
-
createMSafeAccount(input:
|
|
112
|
+
createMSafeAccount(input: CreateMSafeAccountInfoRequest): Promise<void>;
|
|
149
113
|
proposeIntention(input: {
|
|
150
114
|
intention: TxIntention;
|
|
151
115
|
sequenceNumber: number;
|
|
@@ -194,6 +158,7 @@ interface MSafeConfig {
|
|
|
194
158
|
url: string;
|
|
195
159
|
};
|
|
196
160
|
backend: DBConfig;
|
|
161
|
+
apiURL: string;
|
|
197
162
|
}
|
|
198
163
|
interface MSafeConfigOptions {
|
|
199
164
|
suiClient?: {
|
|
@@ -207,6 +172,8 @@ declare const LOCAL_DATABASE_CONFIG: DBConfig;
|
|
|
207
172
|
declare const DEV_DATABASE_CONFIG: DBConfig;
|
|
208
173
|
declare const TESTNET_RPC_URL = "https://sui-testnet.blockvision.org/v1/2Sgk89ivT64MnKdcGzjmyjY2ndD";
|
|
209
174
|
declare const MAINNET_RPC_URL = "https://sui-mainnet.blockvision.org/v1/2Sgk7NPvqkd7mESYkxF01yX15l7";
|
|
175
|
+
declare const LOCAL_API_URL = "http://127.0.0.1:3000";
|
|
176
|
+
declare const DEV_API_URL = "http://13.56.226.148";
|
|
210
177
|
declare const ENV_CONFIGS: Map<MSafeEnv, MSafeConfig>;
|
|
211
178
|
declare function getMSafeConfig(env: MSafeEnv, options?: MSafeConfigOptions): MSafeConfig;
|
|
212
179
|
declare const AUTH_SIGN_MESSAGE = "Welcome to MSafe";
|
|
@@ -251,8 +218,8 @@ declare class PublicKeyHelper {
|
|
|
251
218
|
readonly globals: MSafeGlobals;
|
|
252
219
|
private knownPublicKeys;
|
|
253
220
|
constructor(globals: MSafeGlobals);
|
|
254
|
-
getPublicKey(address: string): Promise<PublicKey | undefined>;
|
|
255
|
-
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey | undefined)[]>;
|
|
221
|
+
getPublicKey(address: string): Promise<PublicKey$1 | undefined>;
|
|
222
|
+
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey$1 | undefined)[]>;
|
|
256
223
|
private _getPublicKey;
|
|
257
224
|
private getPublicKeyFromBackend;
|
|
258
225
|
private getPublicKeyFromChain;
|
|
@@ -302,42 +269,10 @@ interface ProposeIntentionData {
|
|
|
302
269
|
sn: number;
|
|
303
270
|
}
|
|
304
271
|
|
|
305
|
-
interface PublicKeyWithWeight {
|
|
306
|
-
publicKey: PublicKey$1;
|
|
307
|
-
weight: number;
|
|
308
|
-
}
|
|
309
|
-
interface MultiSigConfig {
|
|
310
|
-
threshold: number;
|
|
311
|
-
ownerWithWeight: PublicKeyWithWeight[];
|
|
312
|
-
creationNonce: number | undefined;
|
|
313
|
-
}
|
|
314
|
-
declare const NONCE_PK_PREFIX = "maven";
|
|
315
|
-
declare const NONCE_PREFIX_MAX_SIZE = 16;
|
|
316
|
-
declare const NONCE_PK_WEIGHT = 1;
|
|
317
|
-
declare const MAX_WEIGHT = 255;
|
|
318
|
-
declare const MIN_WEIGHT = 1;
|
|
319
|
-
declare const MAX_OWNER_WITH_NONCE = 9;
|
|
320
|
-
declare const MAX_OWNER_WITHOUT_NONCE = 10;
|
|
321
|
-
declare const MIN_THRESHOLD = 1;
|
|
322
|
-
declare class RawMultiSig {
|
|
323
|
-
readonly config: MultiSigConfig;
|
|
324
|
-
rawMsPK: MultiSigPublicKey;
|
|
325
|
-
constructor(config: MultiSigConfig);
|
|
326
|
-
static fromMSafeAccountInfo(info: MSafeAccountInfo): RawMultiSig;
|
|
327
|
-
get suiAddress(): string;
|
|
328
|
-
get publicKeys(): PublicKeyWithWeight[];
|
|
329
|
-
get threshold(): number;
|
|
330
|
-
combinePartialSignatures(signatures: SerializedSignature[]): SerializedSignature;
|
|
331
|
-
verifyPersonalMessage(messageStr: string, multiSigSignature: SerializedSignature): Promise<boolean>;
|
|
332
|
-
}
|
|
333
|
-
declare function getMultiSigPublicKey(config: MultiSigConfig): MultiSigPublicKey;
|
|
334
|
-
declare function makeNoncePublicKey(nonce: number): Ed25519PublicKey;
|
|
335
|
-
declare function validateMultiSigConfig(config: MultiSigConfig): void;
|
|
336
|
-
|
|
337
272
|
declare class MSafeAccount {
|
|
338
273
|
readonly globals: MSafeGlobals;
|
|
339
274
|
readonly info: MSafeAccountInfo;
|
|
340
|
-
|
|
275
|
+
multisigManager: MultisigAccountManager;
|
|
341
276
|
constructor(globals: MSafeGlobals, info: MSafeAccountInfo);
|
|
342
277
|
static new(globals: MSafeGlobals, address: string): Promise<MSafeAccount>;
|
|
343
278
|
pendingTransactions(): Promise<PendingTx[]>;
|
|
@@ -369,7 +304,7 @@ declare class MSafeClient {
|
|
|
369
304
|
wallet: IWallet;
|
|
370
305
|
jwtToken?: JWTToken;
|
|
371
306
|
}): Promise<JWTToken>;
|
|
372
|
-
userInfo(): Promise<UserWithOwnedMSafe>;
|
|
307
|
+
userInfo(): Promise<_msafe_sui3_utils.UserWithOwnedMSafe>;
|
|
373
308
|
createAccount(info: CreateMSafeAccountInfo): Promise<string>;
|
|
374
309
|
getMSafeAccount(info: MSafeAccountInfo): MSafeAccount;
|
|
375
310
|
getMSafeAccountFromAddress(msafeAddress: string): Promise<MSafeAccount>;
|
|
@@ -390,11 +325,11 @@ declare class SignatureVerifier {
|
|
|
390
325
|
message: Uint8Array;
|
|
391
326
|
messageType: 'TransactionBlock' | 'Personal';
|
|
392
327
|
signature: SerializedSignature;
|
|
393
|
-
}): Promise<PublicKey
|
|
328
|
+
}): Promise<PublicKey>;
|
|
394
329
|
static getPublicKeyFromPersonalSignature(input: {
|
|
395
330
|
messageStr: string;
|
|
396
331
|
signature: SerializedSignature;
|
|
397
|
-
}): Promise<PublicKey
|
|
332
|
+
}): Promise<PublicKey>;
|
|
398
333
|
static verifySignature(input: {
|
|
399
334
|
message: Uint8Array;
|
|
400
335
|
messageType: 'TransactionBlock' | 'Personal';
|
|
@@ -413,14 +348,14 @@ declare class SignatureVerifier {
|
|
|
413
348
|
}): Promise<boolean>;
|
|
414
349
|
}
|
|
415
350
|
declare class PublicKeySerde {
|
|
416
|
-
static ser(publicKey: PublicKey
|
|
351
|
+
static ser(publicKey: PublicKey): {
|
|
417
352
|
publicKey: string;
|
|
418
|
-
scheme: "ED25519" | "
|
|
353
|
+
scheme: "ED25519" | "Secp256k1" | "Secp256r1" | "MultiSig" | "ZkLogin";
|
|
419
354
|
};
|
|
420
355
|
static de(input: {
|
|
421
356
|
publicKey: string | Uint8Array;
|
|
422
357
|
scheme: SignatureScheme;
|
|
423
|
-
}): PublicKey
|
|
358
|
+
}): PublicKey;
|
|
424
359
|
}
|
|
425
360
|
|
|
426
361
|
declare class Formatter {
|
|
@@ -432,7 +367,7 @@ declare class Formatter {
|
|
|
432
367
|
}
|
|
433
368
|
|
|
434
369
|
declare const SUI_COIN = "0x2::sui::SUI";
|
|
435
|
-
declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey
|
|
370
|
+
declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey | undefined>;
|
|
436
371
|
declare function getAllCoins(input: {
|
|
437
372
|
suiClient: SuiClient;
|
|
438
373
|
owner: string;
|
|
@@ -453,4 +388,4 @@ declare class Coin {
|
|
|
453
388
|
static getBalance(data: SuiObjectData): bigint | undefined;
|
|
454
389
|
}
|
|
455
390
|
|
|
456
|
-
export { AUTH_SIGN_MESSAGE, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_DATABASE_CONFIG, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, IntentionHelper, LOCAL_DATABASE_CONFIG, MAINNET_RPC_URL,
|
|
391
|
+
export { AUTH_SIGN_MESSAGE, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_API_URL, DEV_DATABASE_CONFIG, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, IntentionHelper, LOCAL_API_URL, LOCAL_DATABASE_CONFIG, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, MessageHelper, type PendingTx, type PendingVote, PublicKeySerde, type ReceiveTransaction, SUI_COIN, SignatureVerifier, TESTNET_RPC_URL, type TxIntention, UNIT_DATABASE_CONFIG, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import * as _mysten_sui_js_src_cryptography from '@mysten/sui.js/src/cryptography';
|
|
2
|
-
import { PublicKey } from '@mysten/sui.js/src/cryptography';
|
|
2
|
+
import { PublicKey as PublicKey$1 } from '@mysten/sui.js/src/cryptography';
|
|
3
3
|
import { SuiClient, ExecuteTransactionRequestType, SuiTransactionBlockResponseOptions, SuiTransactionBlockResponse, CoinStruct, CoinMetadata, SuiObjectData } from '@mysten/sui.js/client';
|
|
4
|
-
import
|
|
4
|
+
import * as _msafe_sui3_utils from '@msafe/sui3-utils';
|
|
5
|
+
import { AuthLoginRequest, MSafeAccountInfo, UserWithOwnedMSafe, CreateMSafeAccountInfoRequest, MultisigAccountManager } from '@msafe/sui3-utils';
|
|
6
|
+
import { PublicKey, SerializedSignature, SignatureScheme } from '@mysten/sui.js/cryptography';
|
|
5
7
|
import * as _mysten_sui_js_dist_cjs_builder from '@mysten/sui.js/dist/cjs/builder';
|
|
6
8
|
import { ModelConfig } from '@msafe/sui3-model/common';
|
|
7
9
|
import { SignatureWithBytes } from '@mysten/sui.js/src/cryptography/keypair';
|
|
8
10
|
import { TransactionBlock } from '@mysten/sui.js/transactions';
|
|
9
11
|
import * as _mysten_sui_js_dist_cjs_client from '@mysten/sui.js/dist/cjs/client';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
+
|
|
13
|
+
type JWTToken = string;
|
|
12
14
|
|
|
13
15
|
interface IntentionCoinTransfer {
|
|
14
16
|
txType: 'CoinTransfer';
|
|
@@ -43,21 +45,6 @@ declare class IntentionHelper {
|
|
|
43
45
|
}): Promise<_mysten_sui_js_dist_cjs_builder.TransactionBlock>;
|
|
44
46
|
}
|
|
45
47
|
|
|
46
|
-
interface MSafeAccountInfo {
|
|
47
|
-
address: string;
|
|
48
|
-
ownersWithWeightPK: OwnerWithWeightPK[];
|
|
49
|
-
threshold: number;
|
|
50
|
-
name: string;
|
|
51
|
-
description?: string;
|
|
52
|
-
creationNonce: number;
|
|
53
|
-
}
|
|
54
|
-
type OwnerWithWeightPK = OwnerWithWeight & {
|
|
55
|
-
publicKey: PublicKey;
|
|
56
|
-
};
|
|
57
|
-
interface OwnerWithWeight {
|
|
58
|
-
address: string;
|
|
59
|
-
weight: number;
|
|
60
|
-
}
|
|
61
48
|
interface PendingTx {
|
|
62
49
|
digest: string;
|
|
63
50
|
payload: string;
|
|
@@ -110,34 +97,11 @@ interface FutureIntention {
|
|
|
110
97
|
createdAt: Date;
|
|
111
98
|
}
|
|
112
99
|
|
|
113
|
-
type JWTToken = string;
|
|
114
|
-
interface CreateMSafeParams {
|
|
115
|
-
ownerWithWeight: OwnerWithWeightPK[];
|
|
116
|
-
threshold: number;
|
|
117
|
-
name: string;
|
|
118
|
-
description?: string;
|
|
119
|
-
creationNonce: number;
|
|
120
|
-
signature: SerializedSignature;
|
|
121
|
-
}
|
|
122
|
-
interface UserWithOwnedMSafe {
|
|
123
|
-
address: string;
|
|
124
|
-
publicKey: string;
|
|
125
|
-
schema: string;
|
|
126
|
-
creationNonce: number;
|
|
127
|
-
ownedMSafe: MSafeAccountInfo[];
|
|
128
|
-
}
|
|
129
|
-
|
|
130
100
|
interface IBackend {
|
|
131
|
-
|
|
132
|
-
authSign(input: {
|
|
133
|
-
address: string;
|
|
134
|
-
message: string;
|
|
135
|
-
signature: SerializedSignature;
|
|
136
|
-
walletType: string;
|
|
137
|
-
}): Promise<JWTToken>;
|
|
101
|
+
authSign(input: AuthLoginRequest): Promise<JWTToken>;
|
|
138
102
|
setJWTToken(token: JWTToken): void;
|
|
139
|
-
getPublicKey(address: string): Promise<PublicKey
|
|
140
|
-
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey
|
|
103
|
+
getPublicKey(address: string): Promise<PublicKey | undefined>;
|
|
104
|
+
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey | undefined)[]>;
|
|
141
105
|
getMSafeAccountInfo(msafeAddress: string): Promise<MSafeAccountInfo>;
|
|
142
106
|
getUserInfo(userAddress: string): Promise<UserWithOwnedMSafe>;
|
|
143
107
|
getPendingTransactions(msafeAddress: string): Promise<PendingTx[]>;
|
|
@@ -145,7 +109,7 @@ interface IBackend {
|
|
|
145
109
|
getFutureIntentions(msafeAddress: string): Promise<FutureIntention[]>;
|
|
146
110
|
getCurrentSequenceNumber(msafeAddress: string): Promise<number>;
|
|
147
111
|
getNextSequenceNumber(msafeAddress: string): Promise<number>;
|
|
148
|
-
createMSafeAccount(input:
|
|
112
|
+
createMSafeAccount(input: CreateMSafeAccountInfoRequest): Promise<void>;
|
|
149
113
|
proposeIntention(input: {
|
|
150
114
|
intention: TxIntention;
|
|
151
115
|
sequenceNumber: number;
|
|
@@ -194,6 +158,7 @@ interface MSafeConfig {
|
|
|
194
158
|
url: string;
|
|
195
159
|
};
|
|
196
160
|
backend: DBConfig;
|
|
161
|
+
apiURL: string;
|
|
197
162
|
}
|
|
198
163
|
interface MSafeConfigOptions {
|
|
199
164
|
suiClient?: {
|
|
@@ -207,6 +172,8 @@ declare const LOCAL_DATABASE_CONFIG: DBConfig;
|
|
|
207
172
|
declare const DEV_DATABASE_CONFIG: DBConfig;
|
|
208
173
|
declare const TESTNET_RPC_URL = "https://sui-testnet.blockvision.org/v1/2Sgk89ivT64MnKdcGzjmyjY2ndD";
|
|
209
174
|
declare const MAINNET_RPC_URL = "https://sui-mainnet.blockvision.org/v1/2Sgk7NPvqkd7mESYkxF01yX15l7";
|
|
175
|
+
declare const LOCAL_API_URL = "http://127.0.0.1:3000";
|
|
176
|
+
declare const DEV_API_URL = "http://13.56.226.148";
|
|
210
177
|
declare const ENV_CONFIGS: Map<MSafeEnv, MSafeConfig>;
|
|
211
178
|
declare function getMSafeConfig(env: MSafeEnv, options?: MSafeConfigOptions): MSafeConfig;
|
|
212
179
|
declare const AUTH_SIGN_MESSAGE = "Welcome to MSafe";
|
|
@@ -251,8 +218,8 @@ declare class PublicKeyHelper {
|
|
|
251
218
|
readonly globals: MSafeGlobals;
|
|
252
219
|
private knownPublicKeys;
|
|
253
220
|
constructor(globals: MSafeGlobals);
|
|
254
|
-
getPublicKey(address: string): Promise<PublicKey | undefined>;
|
|
255
|
-
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey | undefined)[]>;
|
|
221
|
+
getPublicKey(address: string): Promise<PublicKey$1 | undefined>;
|
|
222
|
+
getPublicKeyBatch(addresses: string[]): Promise<(PublicKey$1 | undefined)[]>;
|
|
256
223
|
private _getPublicKey;
|
|
257
224
|
private getPublicKeyFromBackend;
|
|
258
225
|
private getPublicKeyFromChain;
|
|
@@ -302,42 +269,10 @@ interface ProposeIntentionData {
|
|
|
302
269
|
sn: number;
|
|
303
270
|
}
|
|
304
271
|
|
|
305
|
-
interface PublicKeyWithWeight {
|
|
306
|
-
publicKey: PublicKey$1;
|
|
307
|
-
weight: number;
|
|
308
|
-
}
|
|
309
|
-
interface MultiSigConfig {
|
|
310
|
-
threshold: number;
|
|
311
|
-
ownerWithWeight: PublicKeyWithWeight[];
|
|
312
|
-
creationNonce: number | undefined;
|
|
313
|
-
}
|
|
314
|
-
declare const NONCE_PK_PREFIX = "maven";
|
|
315
|
-
declare const NONCE_PREFIX_MAX_SIZE = 16;
|
|
316
|
-
declare const NONCE_PK_WEIGHT = 1;
|
|
317
|
-
declare const MAX_WEIGHT = 255;
|
|
318
|
-
declare const MIN_WEIGHT = 1;
|
|
319
|
-
declare const MAX_OWNER_WITH_NONCE = 9;
|
|
320
|
-
declare const MAX_OWNER_WITHOUT_NONCE = 10;
|
|
321
|
-
declare const MIN_THRESHOLD = 1;
|
|
322
|
-
declare class RawMultiSig {
|
|
323
|
-
readonly config: MultiSigConfig;
|
|
324
|
-
rawMsPK: MultiSigPublicKey;
|
|
325
|
-
constructor(config: MultiSigConfig);
|
|
326
|
-
static fromMSafeAccountInfo(info: MSafeAccountInfo): RawMultiSig;
|
|
327
|
-
get suiAddress(): string;
|
|
328
|
-
get publicKeys(): PublicKeyWithWeight[];
|
|
329
|
-
get threshold(): number;
|
|
330
|
-
combinePartialSignatures(signatures: SerializedSignature[]): SerializedSignature;
|
|
331
|
-
verifyPersonalMessage(messageStr: string, multiSigSignature: SerializedSignature): Promise<boolean>;
|
|
332
|
-
}
|
|
333
|
-
declare function getMultiSigPublicKey(config: MultiSigConfig): MultiSigPublicKey;
|
|
334
|
-
declare function makeNoncePublicKey(nonce: number): Ed25519PublicKey;
|
|
335
|
-
declare function validateMultiSigConfig(config: MultiSigConfig): void;
|
|
336
|
-
|
|
337
272
|
declare class MSafeAccount {
|
|
338
273
|
readonly globals: MSafeGlobals;
|
|
339
274
|
readonly info: MSafeAccountInfo;
|
|
340
|
-
|
|
275
|
+
multisigManager: MultisigAccountManager;
|
|
341
276
|
constructor(globals: MSafeGlobals, info: MSafeAccountInfo);
|
|
342
277
|
static new(globals: MSafeGlobals, address: string): Promise<MSafeAccount>;
|
|
343
278
|
pendingTransactions(): Promise<PendingTx[]>;
|
|
@@ -369,7 +304,7 @@ declare class MSafeClient {
|
|
|
369
304
|
wallet: IWallet;
|
|
370
305
|
jwtToken?: JWTToken;
|
|
371
306
|
}): Promise<JWTToken>;
|
|
372
|
-
userInfo(): Promise<UserWithOwnedMSafe>;
|
|
307
|
+
userInfo(): Promise<_msafe_sui3_utils.UserWithOwnedMSafe>;
|
|
373
308
|
createAccount(info: CreateMSafeAccountInfo): Promise<string>;
|
|
374
309
|
getMSafeAccount(info: MSafeAccountInfo): MSafeAccount;
|
|
375
310
|
getMSafeAccountFromAddress(msafeAddress: string): Promise<MSafeAccount>;
|
|
@@ -390,11 +325,11 @@ declare class SignatureVerifier {
|
|
|
390
325
|
message: Uint8Array;
|
|
391
326
|
messageType: 'TransactionBlock' | 'Personal';
|
|
392
327
|
signature: SerializedSignature;
|
|
393
|
-
}): Promise<PublicKey
|
|
328
|
+
}): Promise<PublicKey>;
|
|
394
329
|
static getPublicKeyFromPersonalSignature(input: {
|
|
395
330
|
messageStr: string;
|
|
396
331
|
signature: SerializedSignature;
|
|
397
|
-
}): Promise<PublicKey
|
|
332
|
+
}): Promise<PublicKey>;
|
|
398
333
|
static verifySignature(input: {
|
|
399
334
|
message: Uint8Array;
|
|
400
335
|
messageType: 'TransactionBlock' | 'Personal';
|
|
@@ -413,14 +348,14 @@ declare class SignatureVerifier {
|
|
|
413
348
|
}): Promise<boolean>;
|
|
414
349
|
}
|
|
415
350
|
declare class PublicKeySerde {
|
|
416
|
-
static ser(publicKey: PublicKey
|
|
351
|
+
static ser(publicKey: PublicKey): {
|
|
417
352
|
publicKey: string;
|
|
418
|
-
scheme: "ED25519" | "
|
|
353
|
+
scheme: "ED25519" | "Secp256k1" | "Secp256r1" | "MultiSig" | "ZkLogin";
|
|
419
354
|
};
|
|
420
355
|
static de(input: {
|
|
421
356
|
publicKey: string | Uint8Array;
|
|
422
357
|
scheme: SignatureScheme;
|
|
423
|
-
}): PublicKey
|
|
358
|
+
}): PublicKey;
|
|
424
359
|
}
|
|
425
360
|
|
|
426
361
|
declare class Formatter {
|
|
@@ -432,7 +367,7 @@ declare class Formatter {
|
|
|
432
367
|
}
|
|
433
368
|
|
|
434
369
|
declare const SUI_COIN = "0x2::sui::SUI";
|
|
435
|
-
declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey
|
|
370
|
+
declare function getPublicKeyFromChain(suiClient: SuiClient, address: string): Promise<PublicKey | undefined>;
|
|
436
371
|
declare function getAllCoins(input: {
|
|
437
372
|
suiClient: SuiClient;
|
|
438
373
|
owner: string;
|
|
@@ -453,4 +388,4 @@ declare class Coin {
|
|
|
453
388
|
static getBalance(data: SuiObjectData): bigint | undefined;
|
|
454
389
|
}
|
|
455
390
|
|
|
456
|
-
export { AUTH_SIGN_MESSAGE, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_DATABASE_CONFIG, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, IntentionHelper, LOCAL_DATABASE_CONFIG, MAINNET_RPC_URL,
|
|
391
|
+
export { AUTH_SIGN_MESSAGE, COIN_TYPE_ARG_REGEX, Coin, CoinHelper, CreateHelper, type CreateMSafeAccountInfo, type CreatePermissionInfo, type DBConfig, DEV_API_URL, DEV_DATABASE_CONFIG, ENV_CONFIGS, Formatter, type FutureIntention, HexToUint8Array, type HistorySendTx, type HistoryVote, type IWallet, IntentionHelper, LOCAL_API_URL, LOCAL_DATABASE_CONFIG, MAINNET_RPC_URL, MSafeAccount, MSafeClient, type MSafeConfig, type MSafeConfigOptions, MSafeEnv, MSafeGlobals, MessageHelper, type PendingTx, type PendingVote, PublicKeySerde, type ReceiveTransaction, SUI_COIN, SignatureVerifier, TESTNET_RPC_URL, type TxIntention, UNIT_DATABASE_CONFIG, Uint8ArrayToHex, getAllCoins, getMSafeConfig, getPublicKeyFromChain, stringToBuffer };
|