@dynamic-labs-wallet/node-svm 0.0.317 → 0.0.319-beta.1
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 +6 -4
- package/index.esm.js +6 -4
- package/package.json +2 -2
- package/src/client/base58.d.ts +0 -3
- package/src/client/base58.d.ts.map +0 -1
- package/src/client/client.d.ts +0 -101
- package/src/client/client.d.ts.map +0 -1
- package/src/client/constants.d.ts +0 -2
- package/src/client/constants.d.ts.map +0 -1
- package/src/client/index.d.ts +0 -5
- package/src/client/index.d.ts.map +0 -1
- package/src/client/utils.d.ts +0 -29
- package/src/client/utils.d.ts.map +0 -1
- package/src/delegatedClient.d.ts +0 -79
- package/src/delegatedClient.d.ts.map +0 -1
- package/src/index.d.ts +0 -3
- package/src/index.d.ts.map +0 -1
package/index.cjs.js
CHANGED
|
@@ -135,7 +135,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
135
135
|
throw new Error('Error creating wallet account');
|
|
136
136
|
}
|
|
137
137
|
const { accountAddress } = await this.deriveAccountAddress(rawPublicKey);
|
|
138
|
-
await this.storeEncryptedBackupByWalletWithRetry({
|
|
138
|
+
const externalKeySharesWithBackupStatus = await this.storeEncryptedBackupByWalletWithRetry({
|
|
139
139
|
accountAddress,
|
|
140
140
|
externalServerKeyShares,
|
|
141
141
|
password,
|
|
@@ -144,7 +144,8 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
144
144
|
return {
|
|
145
145
|
accountAddress,
|
|
146
146
|
rawPublicKey,
|
|
147
|
-
externalServerKeyShares
|
|
147
|
+
externalServerKeyShares,
|
|
148
|
+
externalKeySharesWithBackupStatus
|
|
148
149
|
};
|
|
149
150
|
} catch (error) {
|
|
150
151
|
logError$1({
|
|
@@ -359,7 +360,7 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
359
360
|
if (accountAddress !== publicKey) {
|
|
360
361
|
throw new Error(`Public key mismatch: derived address ${accountAddress} !== public key ${publicKey}`);
|
|
361
362
|
}
|
|
362
|
-
await this.storeEncryptedBackupByWalletWithRetry({
|
|
363
|
+
const externalKeySharesWithBackupStatus = await this.storeEncryptedBackupByWalletWithRetry({
|
|
363
364
|
accountAddress,
|
|
364
365
|
externalServerKeyShares,
|
|
365
366
|
password,
|
|
@@ -368,7 +369,8 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
368
369
|
return {
|
|
369
370
|
accountAddress,
|
|
370
371
|
rawPublicKey: rawPublicKey,
|
|
371
|
-
externalServerKeyShares
|
|
372
|
+
externalServerKeyShares,
|
|
373
|
+
externalKeySharesWithBackupStatus
|
|
372
374
|
};
|
|
373
375
|
}
|
|
374
376
|
async getSvmWallets() {
|
package/index.esm.js
CHANGED
|
@@ -133,7 +133,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
133
133
|
throw new Error('Error creating wallet account');
|
|
134
134
|
}
|
|
135
135
|
const { accountAddress } = await this.deriveAccountAddress(rawPublicKey);
|
|
136
|
-
await this.storeEncryptedBackupByWalletWithRetry({
|
|
136
|
+
const externalKeySharesWithBackupStatus = await this.storeEncryptedBackupByWalletWithRetry({
|
|
137
137
|
accountAddress,
|
|
138
138
|
externalServerKeyShares,
|
|
139
139
|
password,
|
|
@@ -142,7 +142,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
142
142
|
return {
|
|
143
143
|
accountAddress,
|
|
144
144
|
rawPublicKey,
|
|
145
|
-
externalServerKeyShares
|
|
145
|
+
externalServerKeyShares,
|
|
146
|
+
externalKeySharesWithBackupStatus
|
|
146
147
|
};
|
|
147
148
|
} catch (error) {
|
|
148
149
|
logError$1({
|
|
@@ -357,7 +358,7 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
357
358
|
if (accountAddress !== publicKey) {
|
|
358
359
|
throw new Error(`Public key mismatch: derived address ${accountAddress} !== public key ${publicKey}`);
|
|
359
360
|
}
|
|
360
|
-
await this.storeEncryptedBackupByWalletWithRetry({
|
|
361
|
+
const externalKeySharesWithBackupStatus = await this.storeEncryptedBackupByWalletWithRetry({
|
|
361
362
|
accountAddress,
|
|
362
363
|
externalServerKeyShares,
|
|
363
364
|
password,
|
|
@@ -366,7 +367,8 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
366
367
|
return {
|
|
367
368
|
accountAddress,
|
|
368
369
|
rawPublicKey: rawPublicKey,
|
|
369
|
-
externalServerKeyShares
|
|
370
|
+
externalServerKeyShares,
|
|
371
|
+
externalKeySharesWithBackupStatus
|
|
370
372
|
};
|
|
371
373
|
}
|
|
372
374
|
async getSvmWallets() {
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs-wallet/node-svm",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.319-beta.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"@dynamic-labs-wallet/node": "0.0.
|
|
7
|
+
"@dynamic-labs-wallet/node": "0.0.319-beta.1",
|
|
8
8
|
"@solana/web3.js": "^1.98.2"
|
|
9
9
|
},
|
|
10
10
|
"publishConfig": {
|
package/src/client/base58.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base58.d.ts","sourceRoot":"","sources":["../../src/client/base58.ts"],"names":[],"mappings":"AAOA,wBAAgB,YAAY,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAkCvD;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAmCpD"}
|
package/src/client/client.d.ts
DELETED
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
import { type ServerKeyShare, DynamicWalletClient, type Ed25519KeygenResult, type ThresholdSignatureScheme, type DynamicWalletClientProps } from '@dynamic-labs-wallet/node';
|
|
2
|
-
import { type Transaction, VersionedTransaction } from '@solana/web3.js';
|
|
3
|
-
export declare class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
4
|
-
readonly chainName = "SVM";
|
|
5
|
-
accountAddress?: string;
|
|
6
|
-
constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, enableMPCAccelerator, logger, debug, }: DynamicWalletClientProps);
|
|
7
|
-
/**
|
|
8
|
-
* Creates a wallet account on the Solana chain
|
|
9
|
-
*
|
|
10
|
-
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
11
|
-
* @returns The account address, public key hex, raw public key, and client key shares
|
|
12
|
-
*/
|
|
13
|
-
createWalletAccount({ thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
14
|
-
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
15
|
-
password?: string;
|
|
16
|
-
onError?: (error: Error) => void;
|
|
17
|
-
backUpToClientShareService?: boolean;
|
|
18
|
-
}): Promise<{
|
|
19
|
-
accountAddress: string;
|
|
20
|
-
rawPublicKey: Uint8Array | string;
|
|
21
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
22
|
-
}>;
|
|
23
|
-
deriveAccountAddress(rawPublicKey: string | Uint8Array): Promise<{
|
|
24
|
-
accountAddress: string;
|
|
25
|
-
}>;
|
|
26
|
-
/**
|
|
27
|
-
* This function takes a message and returns it after being signed with MPC
|
|
28
|
-
*
|
|
29
|
-
* @param message The message to sign (Uint8Array)
|
|
30
|
-
* @param accountAddress Solana address (base58 encoded)
|
|
31
|
-
* @param password The password for encrypted backup shares
|
|
32
|
-
*/
|
|
33
|
-
signMessage({ message, accountAddress, password, externalServerKeyShares, }: {
|
|
34
|
-
message: string | Uint8Array;
|
|
35
|
-
accountAddress: string;
|
|
36
|
-
password?: string;
|
|
37
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
38
|
-
}): Promise<string>;
|
|
39
|
-
signTransaction({ senderAddress, transaction, password, externalServerKeyShares, }: {
|
|
40
|
-
senderAddress: string;
|
|
41
|
-
transaction: VersionedTransaction | Transaction | string;
|
|
42
|
-
password?: string;
|
|
43
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
44
|
-
}): Promise<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Exports the private key for a given account address
|
|
47
|
-
*
|
|
48
|
-
* @param accountAddress The account address to export the private key for
|
|
49
|
-
* @param password The password for encrypted backup shares
|
|
50
|
-
* @returns The private key
|
|
51
|
-
*/
|
|
52
|
-
exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
|
|
53
|
-
accountAddress: string;
|
|
54
|
-
password?: string;
|
|
55
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
56
|
-
}): Promise<string>;
|
|
57
|
-
/**
|
|
58
|
-
* Exports the private key for a given account address
|
|
59
|
-
*
|
|
60
|
-
* @param keyShares The key shares to export the private key for
|
|
61
|
-
* @returns The private key
|
|
62
|
-
*/
|
|
63
|
-
offlineExportPrivateKey({ keyShares, derivationPath, }: {
|
|
64
|
-
keyShares: Ed25519KeygenResult[];
|
|
65
|
-
derivationPath?: string;
|
|
66
|
-
}): Promise<{
|
|
67
|
-
derivedPrivateKey: string | undefined;
|
|
68
|
-
}>;
|
|
69
|
-
/**
|
|
70
|
-
* Converts the private key to a hex string
|
|
71
|
-
*
|
|
72
|
-
* @param privateKey The private key to convert
|
|
73
|
-
* @returns The hex string
|
|
74
|
-
*/
|
|
75
|
-
decodePrivateKeyForSolana(privateKey: string): string;
|
|
76
|
-
getPublicKeyFromPrivateKey(privateKey: string): string;
|
|
77
|
-
encodePublicKey(publicKey: Uint8Array): string;
|
|
78
|
-
/**
|
|
79
|
-
* Imports the private key for a given account address
|
|
80
|
-
*
|
|
81
|
-
* @param privateKey The private key to import
|
|
82
|
-
* @param chainName The chain name to import the private key for
|
|
83
|
-
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
84
|
-
* @param password The password for encrypted backup shares
|
|
85
|
-
* @returns The account address, raw public key, and client key shares
|
|
86
|
-
*/
|
|
87
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
88
|
-
privateKey: string;
|
|
89
|
-
chainName: string;
|
|
90
|
-
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
91
|
-
password?: string;
|
|
92
|
-
onError?: (error: Error) => void;
|
|
93
|
-
backUpToClientShareService?: boolean;
|
|
94
|
-
}): Promise<{
|
|
95
|
-
accountAddress: string;
|
|
96
|
-
rawPublicKey: Uint8Array | string | undefined;
|
|
97
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
98
|
-
}>;
|
|
99
|
-
getSvmWallets(): Promise<import("@dynamic-labs-wallet/node").WalletProperties[]>;
|
|
100
|
-
}
|
|
101
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,sCAAsC,CAAC"}
|
package/src/client/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
|
package/src/client/utils.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PublicKey, Transaction, type VersionedTransaction } from '@solana/web3.js';
|
|
2
|
-
export declare function getBalance({ address, rpcUrl }: {
|
|
3
|
-
address: string;
|
|
4
|
-
rpcUrl?: string;
|
|
5
|
-
}): Promise<number>;
|
|
6
|
-
export declare function createSolanaTransaction({ senderSolanaAddress, amount, to, rpcUrl, }: {
|
|
7
|
-
senderSolanaAddress: string;
|
|
8
|
-
amount: number;
|
|
9
|
-
to: string;
|
|
10
|
-
rpcUrl?: string;
|
|
11
|
-
}): Promise<{
|
|
12
|
-
transaction: Transaction;
|
|
13
|
-
serializedTransaction: Buffer;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const addSignatureToTransaction: ({ transaction, signature, signerPublicKey, }: {
|
|
16
|
-
transaction: Transaction | VersionedTransaction;
|
|
17
|
-
signature: Uint8Array;
|
|
18
|
-
signerPublicKey: PublicKey;
|
|
19
|
-
}) => VersionedTransaction | Transaction;
|
|
20
|
-
export declare function attachSignature({ transaction, signatureBase58, senderAddress, }: {
|
|
21
|
-
transaction: Transaction | VersionedTransaction;
|
|
22
|
-
signatureBase58: string;
|
|
23
|
-
senderAddress: string;
|
|
24
|
-
}): VersionedTransaction | Transaction;
|
|
25
|
-
export declare function sendTransaction({ signedTransaction, rpcUrl, }: {
|
|
26
|
-
signedTransaction: Uint8Array;
|
|
27
|
-
rpcUrl?: string;
|
|
28
|
-
}): Promise<string>;
|
|
29
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/client/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,SAAS,EAAiB,WAAW,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAG/G,wBAAsB,UAAU,CAAC,EAAE,OAAO,EAAE,MAAuB,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,mBAI1G;AAED,wBAAsB,uBAAuB,CAAC,EAC5C,mBAAmB,EACnB,MAAM,EACN,EAAE,EACF,MAAwC,GACzC,EAAE;IACD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;;;GAwBA;AAED,eAAO,MAAM,yBAAyB,iDAInC;IACD,WAAW,EAAE,WAAW,GAAG,oBAAoB,CAAC;IAChD,SAAS,EAAE,UAAU,CAAC;IACtB,eAAe,EAAE,SAAS,CAAC;CAC5B,KAAG,oBAAoB,GAAG,WAG1B,CAAC;AAEF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,eAAe,EACf,aAAa,GACd,EAAE;IACD,WAAW,EAAE,WAAW,GAAG,oBAAoB,CAAC;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,oBAAoB,GAAG,WAAW,CAQrC;AAED,wBAAsB,eAAe,CAAC,EACpC,iBAAiB,EACjB,MAAwC,GACzC,EAAE;IACD,iBAAiB,EAAE,UAAU,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,mBAIA"}
|
package/src/delegatedClient.d.ts
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import type { DelegatedWalletClient, ServerKeyShare } from '@dynamic-labs-wallet/node';
|
|
2
|
-
import type { Transaction } from '@solana/web3.js';
|
|
3
|
-
import { VersionedTransaction } from '@solana/web3.js';
|
|
4
|
-
export type DelegatedSvmClientConfig = {
|
|
5
|
-
environmentId: string;
|
|
6
|
-
baseApiUrl?: string;
|
|
7
|
-
baseMPCRelayApiUrl?: string;
|
|
8
|
-
apiKey: string;
|
|
9
|
-
debug?: boolean;
|
|
10
|
-
};
|
|
11
|
-
export type DelegatedSvmWalletClient = DelegatedWalletClient & {
|
|
12
|
-
readonly chainName: 'SVM';
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Creates a delegated SVM wallet client for functional operations
|
|
16
|
-
*/
|
|
17
|
-
export declare const createDelegatedSvmWalletClient: ({ environmentId, baseApiUrl, baseMPCRelayApiUrl, apiKey, debug, }: DelegatedSvmClientConfig) => DelegatedSvmWalletClient;
|
|
18
|
-
/**
|
|
19
|
-
* Signs a message using delegated signing for SVM
|
|
20
|
-
*/
|
|
21
|
-
export declare const delegatedSignMessage: (client: DelegatedSvmWalletClient, { walletId, walletApiKey, keyShare, message, isFormatted, }: {
|
|
22
|
-
walletId: string;
|
|
23
|
-
walletApiKey: string;
|
|
24
|
-
keyShare: ServerKeyShare;
|
|
25
|
-
message: string;
|
|
26
|
-
isFormatted?: boolean;
|
|
27
|
-
}) => Promise<string>;
|
|
28
|
-
/**
|
|
29
|
-
* Signs a transaction using delegated signing for SVM
|
|
30
|
-
*
|
|
31
|
-
* @param client - The delegated SVM wallet client
|
|
32
|
-
* @param options - Signing options
|
|
33
|
-
* @param options.walletId - The wallet ID
|
|
34
|
-
* @param options.walletApiKey - The wallet API key
|
|
35
|
-
* @param options.keyShare - The server key share
|
|
36
|
-
* @param options.transaction - The transaction to sign (VersionedTransaction or Transaction)
|
|
37
|
-
* @param options.signerAddress - Optional. The address that should sign the transaction.
|
|
38
|
-
* If not provided, defaults to the first signer (VersionedTransaction)
|
|
39
|
-
* or fee payer (Transaction). Use this for gasless transactions where
|
|
40
|
-
* a separate fee payer pays the fees.
|
|
41
|
-
*
|
|
42
|
-
* @returns The partially signed transaction with the signature attached for the specified signer
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* // Standard transaction where sender is also fee payer
|
|
46
|
-
* const signedTx = await delegatedSignTransaction(client, {
|
|
47
|
-
* walletId,
|
|
48
|
-
* walletApiKey,
|
|
49
|
-
* keyShare,
|
|
50
|
-
* transaction,
|
|
51
|
-
* });
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* // Gasless transaction with separate fee payer
|
|
55
|
-
* const transaction = new Transaction();
|
|
56
|
-
* transaction.feePayer = feePayerPublicKey; // Set the actual fee payer
|
|
57
|
-
* transaction.add(instruction); // Instruction that requires sender signature
|
|
58
|
-
*
|
|
59
|
-
* const signedTx = await delegatedSignTransaction(client, {
|
|
60
|
-
* walletId,
|
|
61
|
-
* walletApiKey,
|
|
62
|
-
* keyShare,
|
|
63
|
-
* transaction,
|
|
64
|
-
* signerAddress: senderAddress, // Explicitly specify who signs
|
|
65
|
-
* });
|
|
66
|
-
*
|
|
67
|
-
*/
|
|
68
|
-
export declare const delegatedSignTransaction: (client: DelegatedSvmWalletClient, { walletId, walletApiKey, keyShare, transaction, signerAddress, }: {
|
|
69
|
-
walletId: string;
|
|
70
|
-
walletApiKey: string;
|
|
71
|
-
keyShare: any;
|
|
72
|
-
transaction: VersionedTransaction | Transaction;
|
|
73
|
-
signerAddress?: string;
|
|
74
|
-
}) => Promise<VersionedTransaction | Transaction>;
|
|
75
|
-
/**
|
|
76
|
-
* Revoke delegation - delegates to the node package
|
|
77
|
-
*/
|
|
78
|
-
export declare const revokeDelegation: (client: DelegatedSvmWalletClient, params: any) => Promise<void>;
|
|
79
|
-
//# sourceMappingURL=delegatedClient.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delegatedClient.d.ts","sourceRoot":"","sources":["../../packages/src/delegatedClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAOvF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAa,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAMlE,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG;IAC7D,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,8BAA8B,sEAMxC,wBAAwB,KAAG,wBAe7B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,wBAAwB,+DAO7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,cAAc,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,KACA,OAAO,CAAC,MAAM,CAwBhB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,eAAO,MAAM,wBAAwB,WAC3B,wBAAwB,qEAO7B;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,GAAG,CAAC;IACd,WAAW,EAAE,oBAAoB,GAAG,WAAW,CAAC;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,KACA,OAAO,CAAC,oBAAoB,GAAG,WAAW,CAmE5C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,WAAkB,wBAAwB,UAAU,GAAG,kBAEnF,CAAC"}
|
package/src/index.d.ts
DELETED
package/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
|