@dynamic-labs-wallet/sui 0.0.122 → 0.0.123
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/index.cjs.js +9 -6
- package/index.esm.js +9 -6
- package/package.json +2 -2
- package/src/client/client.d.ts +6 -3
- package/src/client/client.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -160,7 +160,7 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
160
160
|
throw error;
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
|
|
163
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
164
164
|
if (!accountAddress) {
|
|
165
165
|
throw new Error(browser.ERROR_ACCOUNT_ADDRESS_REQUIRED);
|
|
166
166
|
}
|
|
@@ -171,7 +171,8 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
171
171
|
accountAddress: accountAddress,
|
|
172
172
|
chainName: this.chainName,
|
|
173
173
|
password,
|
|
174
|
-
signedSessionId
|
|
174
|
+
signedSessionId,
|
|
175
|
+
mfaToken
|
|
175
176
|
});
|
|
176
177
|
const formattedSignature = await this.formatSignature(signatureEd25519, accountAddress);
|
|
177
178
|
await this.verifyMessageSignature({
|
|
@@ -185,7 +186,7 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
185
186
|
throw new Error(browser.ERROR_SIGN_MESSAGE);
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
|
-
async signTransaction({ transaction, senderAddress, password = undefined, signedSessionId }) {
|
|
189
|
+
async signTransaction({ transaction, senderAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
189
190
|
if (!senderAddress) {
|
|
190
191
|
throw new Error(browser.ERROR_ACCOUNT_ADDRESS_REQUIRED);
|
|
191
192
|
}
|
|
@@ -196,7 +197,8 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
196
197
|
accountAddress: senderAddress,
|
|
197
198
|
chainName: this.chainName,
|
|
198
199
|
password,
|
|
199
|
-
signedSessionId
|
|
200
|
+
signedSessionId,
|
|
201
|
+
mfaToken
|
|
200
202
|
});
|
|
201
203
|
const formattedSignature = await this.formatSignature(signatureEd25519, senderAddress);
|
|
202
204
|
await this.verifyTransactionSignature({
|
|
@@ -353,13 +355,14 @@ class DynamicSuiWalletClient extends browser.DynamicWalletClient {
|
|
|
353
355
|
* @param accountAddress The account address to export the private key for
|
|
354
356
|
* @param password The password for encrypted backup shares
|
|
355
357
|
* @returns The private key in hex format
|
|
356
|
-
*/ async exportPrivateKey({ accountAddress, password = undefined, signedSessionId }) {
|
|
358
|
+
*/ async exportPrivateKey({ accountAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
357
359
|
try {
|
|
358
360
|
const { derivedPrivateKey } = await this.exportKey({
|
|
359
361
|
accountAddress,
|
|
360
362
|
chainName: this.chainName,
|
|
361
363
|
password,
|
|
362
|
-
signedSessionId
|
|
364
|
+
signedSessionId,
|
|
365
|
+
mfaToken
|
|
363
366
|
});
|
|
364
367
|
if (!derivedPrivateKey) {
|
|
365
368
|
throw new Error('Derived private key is undefined');
|
package/index.esm.js
CHANGED
|
@@ -158,7 +158,7 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
158
158
|
throw error;
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
async signMessage({ message, accountAddress, password = undefined, signedSessionId }) {
|
|
161
|
+
async signMessage({ message, accountAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
162
162
|
if (!accountAddress) {
|
|
163
163
|
throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
|
|
164
164
|
}
|
|
@@ -169,7 +169,8 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
169
169
|
accountAddress: accountAddress,
|
|
170
170
|
chainName: this.chainName,
|
|
171
171
|
password,
|
|
172
|
-
signedSessionId
|
|
172
|
+
signedSessionId,
|
|
173
|
+
mfaToken
|
|
173
174
|
});
|
|
174
175
|
const formattedSignature = await this.formatSignature(signatureEd25519, accountAddress);
|
|
175
176
|
await this.verifyMessageSignature({
|
|
@@ -183,7 +184,7 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
183
184
|
throw new Error(ERROR_SIGN_MESSAGE);
|
|
184
185
|
}
|
|
185
186
|
}
|
|
186
|
-
async signTransaction({ transaction, senderAddress, password = undefined, signedSessionId }) {
|
|
187
|
+
async signTransaction({ transaction, senderAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
187
188
|
if (!senderAddress) {
|
|
188
189
|
throw new Error(ERROR_ACCOUNT_ADDRESS_REQUIRED);
|
|
189
190
|
}
|
|
@@ -194,7 +195,8 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
194
195
|
accountAddress: senderAddress,
|
|
195
196
|
chainName: this.chainName,
|
|
196
197
|
password,
|
|
197
|
-
signedSessionId
|
|
198
|
+
signedSessionId,
|
|
199
|
+
mfaToken
|
|
198
200
|
});
|
|
199
201
|
const formattedSignature = await this.formatSignature(signatureEd25519, senderAddress);
|
|
200
202
|
await this.verifyTransactionSignature({
|
|
@@ -351,13 +353,14 @@ class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
351
353
|
* @param accountAddress The account address to export the private key for
|
|
352
354
|
* @param password The password for encrypted backup shares
|
|
353
355
|
* @returns The private key in hex format
|
|
354
|
-
*/ async exportPrivateKey({ accountAddress, password = undefined, signedSessionId }) {
|
|
356
|
+
*/ async exportPrivateKey({ accountAddress, password = undefined, signedSessionId, mfaToken }) {
|
|
355
357
|
try {
|
|
356
358
|
const { derivedPrivateKey } = await this.exportKey({
|
|
357
359
|
accountAddress,
|
|
358
360
|
chainName: this.chainName,
|
|
359
361
|
password,
|
|
360
|
-
signedSessionId
|
|
362
|
+
signedSessionId,
|
|
363
|
+
mfaToken
|
|
361
364
|
});
|
|
362
365
|
if (!derivedPrivateKey) {
|
|
363
366
|
throw new Error('Derived private key is undefined');
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/sui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.123",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/browser": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/browser": "0.0.123",
|
|
8
8
|
"@mysten/sui": "1.26.0",
|
|
9
9
|
"@noble/hashes": "1.7.1",
|
|
10
10
|
"bech32-converting": "^1.0.9"
|
package/src/client/client.d.ts
CHANGED
|
@@ -22,17 +22,19 @@ export declare class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
22
22
|
private formatSignature;
|
|
23
23
|
private verifyMessageSignature;
|
|
24
24
|
private verifyTransactionSignature;
|
|
25
|
-
signMessage({ message, accountAddress, password, signedSessionId, }: {
|
|
25
|
+
signMessage({ message, accountAddress, password, signedSessionId, mfaToken, }: {
|
|
26
26
|
message: string;
|
|
27
27
|
accountAddress: string;
|
|
28
28
|
password?: string;
|
|
29
29
|
signedSessionId: string;
|
|
30
|
+
mfaToken?: string;
|
|
30
31
|
}): Promise<string>;
|
|
31
|
-
signTransaction({ transaction, senderAddress, password, signedSessionId, }: {
|
|
32
|
+
signTransaction({ transaction, senderAddress, password, signedSessionId, mfaToken, }: {
|
|
32
33
|
transaction: string;
|
|
33
34
|
senderAddress: string;
|
|
34
35
|
password?: string;
|
|
35
36
|
signedSessionId: string;
|
|
37
|
+
mfaToken?: string;
|
|
36
38
|
}): Promise<string>;
|
|
37
39
|
deriveAccountAddress({ rawPublicKey }: {
|
|
38
40
|
rawPublicKey: string;
|
|
@@ -86,10 +88,11 @@ export declare class DynamicSuiWalletClient extends DynamicWalletClient {
|
|
|
86
88
|
* @param password The password for encrypted backup shares
|
|
87
89
|
* @returns The private key in hex format
|
|
88
90
|
*/
|
|
89
|
-
exportPrivateKey({ accountAddress, password, signedSessionId, }: {
|
|
91
|
+
exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, }: {
|
|
90
92
|
accountAddress: string;
|
|
91
93
|
password?: string;
|
|
92
94
|
signedSessionId: string;
|
|
95
|
+
mfaToken?: string;
|
|
93
96
|
}): Promise<string>;
|
|
94
97
|
getSuiWallets(): Promise<any>;
|
|
95
98
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EAWzB,MAAM,8BAA8B,CAAC;AAWtC,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,GACb,EAAE,wBAAwB;IAYrB,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,eAAe,GAChB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;KAClC,CAAC;IAsEI,kCAAkC,CAAC,EACvC,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,cAAc,CAAC;KAChC;IAYD;;OAEG;YACW,eAAe;YAoCf,sBAAsB;YA6BtB,0BAA0B;IA6BlC,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,EACd,QAAoB,EACpB,eAAe,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,wBAAwB,EAWzB,MAAM,8BAA8B,CAAC;AAWtC,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;gBAEf,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,kBAAkB,EAClB,UAAU,EACV,KAAK,EACL,YAAY,GACb,EAAE,wBAAwB;IAYrB,mBAAmB,CAAC,EACxB,wBAAwB,EACxB,QAAoB,EACpB,OAAO,EACP,eAAe,GAChB,EAAE;QACD,wBAAwB,EAAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;KAClC,CAAC;IAsEI,kCAAkC,CAAC,EACvC,SAAS,EACT,cAAc,GACf,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,cAAc,EAAE,cAAc,CAAC;KAChC;IAYD;;OAEG;YACW,eAAe;YAoCf,sBAAsB;YA6BtB,0BAA0B;IA6BlC,WAAW,CAAC,EAChB,OAAO,EACP,cAAc,EACd,QAAoB,EACpB,eAAe,EACf,QAAQ,GACT,EAAE;QACD,OAAO,EAAE,MAAM,CAAC;QAChB,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,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