@dynamic-labs-wallet/browser 0.0.24 → 0.0.26
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 +41 -18
- package/index.esm.js +41 -18
- package/package.json +2 -2
- package/src/client.d.ts +6 -3
- package/src/client.d.ts.map +1 -1
- package/src/utils.d.ts +1 -0
- package/src/utils.d.ts.map +1 -1
package/index.cjs.js
CHANGED
|
@@ -50,6 +50,12 @@ const ensureBase64Padding = (str)=>{
|
|
|
50
50
|
return str.padEnd(Math.ceil(str.length / 4) * 4, '=');
|
|
51
51
|
};
|
|
52
52
|
const isBrowser = ()=>typeof window !== 'undefined';
|
|
53
|
+
const isHexString = (str)=>{
|
|
54
|
+
// Remove 0x prefix if present
|
|
55
|
+
const hex = str.startsWith('0x') ? str.slice(2) : str;
|
|
56
|
+
// Check if string contains only hex characters
|
|
57
|
+
return /^[0-9A-Fa-f]+$/.test(hex);
|
|
58
|
+
};
|
|
53
59
|
|
|
54
60
|
const getKey = async ({ password, salt })=>{
|
|
55
61
|
const passwordBytes = stringToBytes(password);
|
|
@@ -314,17 +320,18 @@ class DynamicWalletClient {
|
|
|
314
320
|
const keygenInitResults = await Promise.all(Array(clientThreshold).fill(null).map(()=>mpcSigner.initKeygen()));
|
|
315
321
|
return keygenInitResults;
|
|
316
322
|
}
|
|
317
|
-
async derivePublicKey({ chainName, keyShare }) {
|
|
323
|
+
async derivePublicKey({ chainName, keyShare, imported = false }) {
|
|
318
324
|
const mpcSigner = getMPCSigner({
|
|
319
325
|
chainName,
|
|
320
326
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
321
327
|
});
|
|
322
328
|
const chainConfig = core.getMPCChainConfig(chainName);
|
|
329
|
+
const derivationPath = imported ? undefined : new Uint32Array(chainConfig.derivationPath);
|
|
323
330
|
let publicKey;
|
|
324
331
|
if (mpcSigner instanceof web.Ecdsa) {
|
|
325
|
-
publicKey = await mpcSigner.derivePubkey(keyShare,
|
|
332
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, derivationPath);
|
|
326
333
|
} else if (mpcSigner instanceof web.Ed25519) {
|
|
327
|
-
publicKey = await mpcSigner.derivePubkey(keyShare,
|
|
334
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, derivationPath);
|
|
328
335
|
}
|
|
329
336
|
return publicKey;
|
|
330
337
|
}
|
|
@@ -351,7 +358,8 @@ class DynamicWalletClient {
|
|
|
351
358
|
const [clientKeygenResult] = clientKeygenResults;
|
|
352
359
|
const rawPublicKey = await this.derivePublicKey({
|
|
353
360
|
chainName,
|
|
354
|
-
keyShare: clientKeygenResult
|
|
361
|
+
keyShare: clientKeygenResult,
|
|
362
|
+
imported: false
|
|
355
363
|
});
|
|
356
364
|
return {
|
|
357
365
|
rawPublicKey,
|
|
@@ -397,20 +405,28 @@ class DynamicWalletClient {
|
|
|
397
405
|
});
|
|
398
406
|
return data;
|
|
399
407
|
}
|
|
400
|
-
async clientSign({ chainName, message, roomId, keyShare }) {
|
|
408
|
+
async clientSign({ chainName, message, roomId, keyShare, imported = false }) {
|
|
401
409
|
try {
|
|
402
410
|
const chainConfig = core.getMPCChainConfig(chainName);
|
|
403
411
|
const mpcSigner = getMPCSigner({
|
|
404
412
|
chainName,
|
|
405
413
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
406
414
|
});
|
|
407
|
-
const derivationPath = new Uint32Array(chainConfig.derivationPath);
|
|
415
|
+
const derivationPath = imported ? undefined : new Uint32Array(chainConfig.derivationPath);
|
|
408
416
|
let formattedMessage;
|
|
409
417
|
//note: Ecdsa can also be used by bitcoin, but only keccak256 is used by ethereum
|
|
410
418
|
if (mpcSigner instanceof web.Ecdsa) {
|
|
411
419
|
formattedMessage = web.MessageHash.keccak256(message);
|
|
412
|
-
} else if (mpcSigner instanceof web.Ed25519
|
|
413
|
-
|
|
420
|
+
} else if (mpcSigner instanceof web.Ed25519) {
|
|
421
|
+
if (typeof message === 'string') {
|
|
422
|
+
if (!isHexString(message)) {
|
|
423
|
+
formattedMessage = Buffer.from(message).toString('hex');
|
|
424
|
+
} else {
|
|
425
|
+
formattedMessage = Buffer.from(message, 'hex');
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
formattedMessage = message;
|
|
429
|
+
}
|
|
414
430
|
} else if (mpcSigner instanceof web.BIP340 && typeof message === 'string') {
|
|
415
431
|
formattedMessage = new TextEncoder().encode(message);
|
|
416
432
|
} else {
|
|
@@ -423,7 +439,8 @@ class DynamicWalletClient {
|
|
|
423
439
|
throw error;
|
|
424
440
|
}
|
|
425
441
|
}
|
|
426
|
-
|
|
442
|
+
//todo: need to modify with imported flag
|
|
443
|
+
async sign({ accountAddress, message, chainName, imported = false }) {
|
|
427
444
|
const wallet = await this.getWallet({
|
|
428
445
|
accountAddress
|
|
429
446
|
});
|
|
@@ -438,7 +455,8 @@ class DynamicWalletClient {
|
|
|
438
455
|
chainName,
|
|
439
456
|
message,
|
|
440
457
|
roomId: data.roomId,
|
|
441
|
-
keyShare: wallet.clientKeyShares[0]
|
|
458
|
+
keyShare: wallet.clientKeyShares[0],
|
|
459
|
+
imported
|
|
442
460
|
});
|
|
443
461
|
return signature;
|
|
444
462
|
}
|
|
@@ -762,24 +780,28 @@ class DynamicWalletClient {
|
|
|
762
780
|
thresholdSignatureScheme
|
|
763
781
|
});
|
|
764
782
|
const { threshold } = core.getTSSConfig(thresholdSignatureScheme);
|
|
765
|
-
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit, index)=>{
|
|
783
|
+
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map(async (currentInit, index)=>{
|
|
766
784
|
const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
|
|
767
785
|
if (index === 0) {
|
|
768
|
-
|
|
786
|
+
const otherKeyGenIds = [
|
|
769
787
|
...serverKeygenIds,
|
|
770
788
|
...otherClientKeygenIds
|
|
771
|
-
]
|
|
789
|
+
];
|
|
790
|
+
const importerKeygenResult = await mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, otherKeyGenIds);
|
|
791
|
+
return importerKeygenResult;
|
|
772
792
|
} else {
|
|
773
|
-
|
|
793
|
+
const recipientKeygenResult = await mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
|
|
774
794
|
...serverKeygenIds,
|
|
775
795
|
...otherClientKeygenIds
|
|
776
796
|
]);
|
|
797
|
+
return recipientKeygenResult;
|
|
777
798
|
}
|
|
778
799
|
}));
|
|
779
800
|
const [clientKeygenResult] = clientKeygenResults;
|
|
780
801
|
const rawPublicKey = await this.derivePublicKey({
|
|
781
802
|
chainName,
|
|
782
|
-
keyShare: clientKeygenResult
|
|
803
|
+
keyShare: clientKeygenResult,
|
|
804
|
+
imported: true
|
|
783
805
|
});
|
|
784
806
|
return {
|
|
785
807
|
rawPublicKey,
|
|
@@ -817,7 +839,7 @@ class DynamicWalletClient {
|
|
|
817
839
|
var _user_verifiedCredentials;
|
|
818
840
|
this.logger.debug('Wallet needs to be restored', this.walletMap[accountAddress]);
|
|
819
841
|
const user = await this.apiClient.getUser();
|
|
820
|
-
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address === accountAddress);
|
|
842
|
+
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
821
843
|
this.logger.debug('Restoring wallet', wallet);
|
|
822
844
|
const clientShares = wallet.walletProperties.keyShares.filter((ks)=>ks.backupLocation === 'dynamic');
|
|
823
845
|
this.logger.debug('clientShares', clientShares);
|
|
@@ -861,12 +883,13 @@ class DynamicWalletClient {
|
|
|
861
883
|
accountAddress: vc.address
|
|
862
884
|
}));
|
|
863
885
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
886
|
+
var _acc_wallet_accountAddress, _acc_wallet_accountAddress1;
|
|
864
887
|
acc[wallet.accountAddress] = {
|
|
865
888
|
walletId: wallet.walletId,
|
|
866
889
|
chainName: wallet.chainName,
|
|
867
890
|
accountAddress: wallet.accountAddress,
|
|
868
|
-
clientKeyShares: [],
|
|
869
|
-
thresholdSignatureScheme: undefined
|
|
891
|
+
clientKeyShares: ((_acc_wallet_accountAddress = acc[wallet.accountAddress]) == null ? void 0 : _acc_wallet_accountAddress.clientKeyShares) || [],
|
|
892
|
+
thresholdSignatureScheme: ((_acc_wallet_accountAddress1 = acc[wallet.accountAddress]) == null ? void 0 : _acc_wallet_accountAddress1.thresholdSignatureScheme) || undefined
|
|
870
893
|
};
|
|
871
894
|
return acc;
|
|
872
895
|
}, {});
|
package/index.esm.js
CHANGED
|
@@ -50,6 +50,12 @@ const ensureBase64Padding = (str)=>{
|
|
|
50
50
|
return str.padEnd(Math.ceil(str.length / 4) * 4, '=');
|
|
51
51
|
};
|
|
52
52
|
const isBrowser = ()=>typeof window !== 'undefined';
|
|
53
|
+
const isHexString = (str)=>{
|
|
54
|
+
// Remove 0x prefix if present
|
|
55
|
+
const hex = str.startsWith('0x') ? str.slice(2) : str;
|
|
56
|
+
// Check if string contains only hex characters
|
|
57
|
+
return /^[0-9A-Fa-f]+$/.test(hex);
|
|
58
|
+
};
|
|
53
59
|
|
|
54
60
|
const getKey = async ({ password, salt })=>{
|
|
55
61
|
const passwordBytes = stringToBytes(password);
|
|
@@ -314,17 +320,18 @@ class DynamicWalletClient {
|
|
|
314
320
|
const keygenInitResults = await Promise.all(Array(clientThreshold).fill(null).map(()=>mpcSigner.initKeygen()));
|
|
315
321
|
return keygenInitResults;
|
|
316
322
|
}
|
|
317
|
-
async derivePublicKey({ chainName, keyShare }) {
|
|
323
|
+
async derivePublicKey({ chainName, keyShare, imported = false }) {
|
|
318
324
|
const mpcSigner = getMPCSigner({
|
|
319
325
|
chainName,
|
|
320
326
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
321
327
|
});
|
|
322
328
|
const chainConfig = getMPCChainConfig(chainName);
|
|
329
|
+
const derivationPath = imported ? undefined : new Uint32Array(chainConfig.derivationPath);
|
|
323
330
|
let publicKey;
|
|
324
331
|
if (mpcSigner instanceof Ecdsa) {
|
|
325
|
-
publicKey = await mpcSigner.derivePubkey(keyShare,
|
|
332
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, derivationPath);
|
|
326
333
|
} else if (mpcSigner instanceof Ed25519) {
|
|
327
|
-
publicKey = await mpcSigner.derivePubkey(keyShare,
|
|
334
|
+
publicKey = await mpcSigner.derivePubkey(keyShare, derivationPath);
|
|
328
335
|
}
|
|
329
336
|
return publicKey;
|
|
330
337
|
}
|
|
@@ -351,7 +358,8 @@ class DynamicWalletClient {
|
|
|
351
358
|
const [clientKeygenResult] = clientKeygenResults;
|
|
352
359
|
const rawPublicKey = await this.derivePublicKey({
|
|
353
360
|
chainName,
|
|
354
|
-
keyShare: clientKeygenResult
|
|
361
|
+
keyShare: clientKeygenResult,
|
|
362
|
+
imported: false
|
|
355
363
|
});
|
|
356
364
|
return {
|
|
357
365
|
rawPublicKey,
|
|
@@ -397,20 +405,28 @@ class DynamicWalletClient {
|
|
|
397
405
|
});
|
|
398
406
|
return data;
|
|
399
407
|
}
|
|
400
|
-
async clientSign({ chainName, message, roomId, keyShare }) {
|
|
408
|
+
async clientSign({ chainName, message, roomId, keyShare, imported = false }) {
|
|
401
409
|
try {
|
|
402
410
|
const chainConfig = getMPCChainConfig(chainName);
|
|
403
411
|
const mpcSigner = getMPCSigner({
|
|
404
412
|
chainName,
|
|
405
413
|
baseRelayUrl: this.baseMPCRelayApiUrl
|
|
406
414
|
});
|
|
407
|
-
const derivationPath = new Uint32Array(chainConfig.derivationPath);
|
|
415
|
+
const derivationPath = imported ? undefined : new Uint32Array(chainConfig.derivationPath);
|
|
408
416
|
let formattedMessage;
|
|
409
417
|
//note: Ecdsa can also be used by bitcoin, but only keccak256 is used by ethereum
|
|
410
418
|
if (mpcSigner instanceof Ecdsa) {
|
|
411
419
|
formattedMessage = MessageHash.keccak256(message);
|
|
412
|
-
} else if (mpcSigner instanceof Ed25519
|
|
413
|
-
|
|
420
|
+
} else if (mpcSigner instanceof Ed25519) {
|
|
421
|
+
if (typeof message === 'string') {
|
|
422
|
+
if (!isHexString(message)) {
|
|
423
|
+
formattedMessage = Buffer.from(message).toString('hex');
|
|
424
|
+
} else {
|
|
425
|
+
formattedMessage = Buffer.from(message, 'hex');
|
|
426
|
+
}
|
|
427
|
+
} else {
|
|
428
|
+
formattedMessage = message;
|
|
429
|
+
}
|
|
414
430
|
} else if (mpcSigner instanceof BIP340 && typeof message === 'string') {
|
|
415
431
|
formattedMessage = new TextEncoder().encode(message);
|
|
416
432
|
} else {
|
|
@@ -423,7 +439,8 @@ class DynamicWalletClient {
|
|
|
423
439
|
throw error;
|
|
424
440
|
}
|
|
425
441
|
}
|
|
426
|
-
|
|
442
|
+
//todo: need to modify with imported flag
|
|
443
|
+
async sign({ accountAddress, message, chainName, imported = false }) {
|
|
427
444
|
const wallet = await this.getWallet({
|
|
428
445
|
accountAddress
|
|
429
446
|
});
|
|
@@ -438,7 +455,8 @@ class DynamicWalletClient {
|
|
|
438
455
|
chainName,
|
|
439
456
|
message,
|
|
440
457
|
roomId: data.roomId,
|
|
441
|
-
keyShare: wallet.clientKeyShares[0]
|
|
458
|
+
keyShare: wallet.clientKeyShares[0],
|
|
459
|
+
imported
|
|
442
460
|
});
|
|
443
461
|
return signature;
|
|
444
462
|
}
|
|
@@ -762,24 +780,28 @@ class DynamicWalletClient {
|
|
|
762
780
|
thresholdSignatureScheme
|
|
763
781
|
});
|
|
764
782
|
const { threshold } = getTSSConfig(thresholdSignatureScheme);
|
|
765
|
-
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map((currentInit, index)=>{
|
|
783
|
+
const clientKeygenResults = await Promise.all(clientKeygenInitResults.map(async (currentInit, index)=>{
|
|
766
784
|
const otherClientKeygenIds = clientKeygenInitResults.filter((init)=>init.keygenId !== currentInit.keygenId).map((init)=>init.keygenId);
|
|
767
785
|
if (index === 0) {
|
|
768
|
-
|
|
786
|
+
const otherKeyGenIds = [
|
|
769
787
|
...serverKeygenIds,
|
|
770
788
|
...otherClientKeygenIds
|
|
771
|
-
]
|
|
789
|
+
];
|
|
790
|
+
const importerKeygenResult = await mpcSigner.importPrivateKeyImporter(roomId, threshold, privateKey, currentInit, otherKeyGenIds);
|
|
791
|
+
return importerKeygenResult;
|
|
772
792
|
} else {
|
|
773
|
-
|
|
793
|
+
const recipientKeygenResult = await mpcSigner.importPrivateKeyRecipient(roomId, threshold, currentInit, [
|
|
774
794
|
...serverKeygenIds,
|
|
775
795
|
...otherClientKeygenIds
|
|
776
796
|
]);
|
|
797
|
+
return recipientKeygenResult;
|
|
777
798
|
}
|
|
778
799
|
}));
|
|
779
800
|
const [clientKeygenResult] = clientKeygenResults;
|
|
780
801
|
const rawPublicKey = await this.derivePublicKey({
|
|
781
802
|
chainName,
|
|
782
|
-
keyShare: clientKeygenResult
|
|
803
|
+
keyShare: clientKeygenResult,
|
|
804
|
+
imported: true
|
|
783
805
|
});
|
|
784
806
|
return {
|
|
785
807
|
rawPublicKey,
|
|
@@ -817,7 +839,7 @@ class DynamicWalletClient {
|
|
|
817
839
|
var _user_verifiedCredentials;
|
|
818
840
|
this.logger.debug('Wallet needs to be restored', this.walletMap[accountAddress]);
|
|
819
841
|
const user = await this.apiClient.getUser();
|
|
820
|
-
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address === accountAddress);
|
|
842
|
+
const wallet = (_user_verifiedCredentials = user.verifiedCredentials) == null ? void 0 : _user_verifiedCredentials.find((vc)=>vc.address.toLowerCase() === accountAddress.toLowerCase());
|
|
821
843
|
this.logger.debug('Restoring wallet', wallet);
|
|
822
844
|
const clientShares = wallet.walletProperties.keyShares.filter((ks)=>ks.backupLocation === 'dynamic');
|
|
823
845
|
this.logger.debug('clientShares', clientShares);
|
|
@@ -861,12 +883,13 @@ class DynamicWalletClient {
|
|
|
861
883
|
accountAddress: vc.address
|
|
862
884
|
}));
|
|
863
885
|
this.walletMap = wallets.reduce((acc, wallet)=>{
|
|
886
|
+
var _acc_wallet_accountAddress, _acc_wallet_accountAddress1;
|
|
864
887
|
acc[wallet.accountAddress] = {
|
|
865
888
|
walletId: wallet.walletId,
|
|
866
889
|
chainName: wallet.chainName,
|
|
867
890
|
accountAddress: wallet.accountAddress,
|
|
868
|
-
clientKeyShares: [],
|
|
869
|
-
thresholdSignatureScheme: undefined
|
|
891
|
+
clientKeyShares: ((_acc_wallet_accountAddress = acc[wallet.accountAddress]) == null ? void 0 : _acc_wallet_accountAddress.clientKeyShares) || [],
|
|
892
|
+
thresholdSignatureScheme: ((_acc_wallet_accountAddress1 = acc[wallet.accountAddress]) == null ? void 0 : _acc_wallet_accountAddress1.thresholdSignatureScheme) || undefined
|
|
870
893
|
};
|
|
871
894
|
return acc;
|
|
872
895
|
}, {});
|
package/package.json
CHANGED
package/src/client.d.ts
CHANGED
|
@@ -31,9 +31,10 @@ export declare class DynamicWalletClient {
|
|
|
31
31
|
chainName: string;
|
|
32
32
|
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
33
33
|
}): Promise<ClientInitKeygenResult[]>;
|
|
34
|
-
derivePublicKey({ chainName, keyShare, }: {
|
|
34
|
+
derivePublicKey({ chainName, keyShare, imported, }: {
|
|
35
35
|
chainName: string;
|
|
36
36
|
keyShare: ClientKeyShare;
|
|
37
|
+
imported: boolean;
|
|
37
38
|
}): Promise<EcdsaPublicKey | Uint8Array | undefined>;
|
|
38
39
|
clientKeyGen({ chainName, roomId, serverKeygenIds, clientKeygenInitResults, thresholdSignatureScheme, }: {
|
|
39
40
|
chainName: string;
|
|
@@ -56,16 +57,18 @@ export declare class DynamicWalletClient {
|
|
|
56
57
|
walletId: string;
|
|
57
58
|
message: string | Uint8Array;
|
|
58
59
|
}): Promise<any>;
|
|
59
|
-
clientSign({ chainName, message, roomId, keyShare, }: {
|
|
60
|
+
clientSign({ chainName, message, roomId, keyShare, imported, }: {
|
|
60
61
|
chainName: string;
|
|
61
62
|
message: string | Uint8Array;
|
|
62
63
|
roomId: string;
|
|
63
64
|
keyShare: ClientKeyShare;
|
|
65
|
+
imported?: boolean;
|
|
64
66
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
65
|
-
sign({ accountAddress, message, chainName, }: {
|
|
67
|
+
sign({ accountAddress, message, chainName, imported, }: {
|
|
66
68
|
accountAddress?: string;
|
|
67
69
|
message: string | Uint8Array;
|
|
68
70
|
chainName: string;
|
|
71
|
+
imported?: boolean;
|
|
69
72
|
}): Promise<Uint8Array | EcdsaSignature>;
|
|
70
73
|
refreshWalletAccountShares({ accountAddress, chainName, }: {
|
|
71
74
|
accountAddress: string;
|
package/src/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAYrE,OAAO,EAGL,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../packages/src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,wBAAwB,EACxB,gBAAgB,EAIjB,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EAIL,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAElB,cAAc,EACf,MAAM,eAAe,CAAC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ClB,SAAS,EAAE,cAAc,EAAE,CAAC;QAC5B,cAAc,EAAE,MAAM,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;IAsBK,4BAA4B,CAAC,EACjC,cAAc,EACd,IAAsB,EACtB,QAAQ,GACT,EAAE;QACD,cAAc,EAAE,MAAM,CAAC;QACvB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,cAAc,EAAE,GAAG,IAAI,CAAC;IA2B9B,mBAAmB,CAAC,EACxB,SAAS,EACT,UAAU,EACV,wBAAwB,GACzB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,wBAAwB,EAAE,wBAAwB,CAAC;KACpD,GAAG,OAAO,CAAC;QACV,YAAY,EAAE,cAAc,GAAG,UAAU,GAAG,SAAS,CAAC;QACtD,eAAe,EAAE,cAAc,EAAE,CAAC;KACnC,CAAC;IAkEI,qBAAqB,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAarE,kBAAkB,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IAKlE,SAAS,CAAC,EAAE,cAAc,EAAE,EAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAA;KAAE;IA6DzD,UAAU;CA0BjB"}
|
package/src/utils.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ export declare const stringToBytes: (str: string) => Uint8Array;
|
|
|
3
3
|
export declare const base64ToBytes: (base64: string) => Uint8Array;
|
|
4
4
|
export declare const ensureBase64Padding: (str: string) => string;
|
|
5
5
|
export declare const isBrowser: () => boolean;
|
|
6
|
+
export declare const isHexString: (str: string) => boolean;
|
|
6
7
|
//# sourceMappingURL=utils.d.ts.map
|
package/src/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../packages/src/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,QAAS,UAAU,WAE5C,CAAC;AAEF,eAAO,MAAM,aAAa,QAAS,MAAM,eAExC,CAAC;AAEF,eAAO,MAAM,aAAa,WAAY,MAAM,eAE3C,CAAC;AAGF,eAAO,MAAM,mBAAmB,QAAS,MAAM,KAAG,MAEjD,CAAC;AAEF,eAAO,MAAM,SAAS,eAAsC,CAAC;AAE7D,eAAO,MAAM,WAAW,QAAS,MAAM,YAKtC,CAAC"}
|