@dynamic-labs-wallet/node-svm 0.0.319 → 0.0.321
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 +10 -2
- package/index.esm.js +10 -2
- 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 -111
- 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
|
@@ -276,7 +276,10 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
276
276
|
if (!derivedPrivateKey) {
|
|
277
277
|
throw new Error('Derived private key is undefined');
|
|
278
278
|
}
|
|
279
|
-
|
|
279
|
+
// MPC export returns a hex-encoded 64-byte Ed25519 keypair (private + public).
|
|
280
|
+
// Solana ecosystem expects base58-encoded keypairs.
|
|
281
|
+
const keyBytes = new Uint8Array(Buffer.from(derivedPrivateKey, 'hex'));
|
|
282
|
+
return encodeBase58(keyBytes);
|
|
280
283
|
}
|
|
281
284
|
/**
|
|
282
285
|
* Exports the private key for a given account address
|
|
@@ -289,8 +292,13 @@ class DynamicSvmWalletClient extends node.DynamicWalletClient {
|
|
|
289
292
|
keyShares,
|
|
290
293
|
derivationPath
|
|
291
294
|
});
|
|
295
|
+
if (!derivedPrivateKey) {
|
|
296
|
+
throw new Error('Derived private key is undefined');
|
|
297
|
+
}
|
|
298
|
+
// MPC export returns hex-encoded Ed25519 keypair; convert to base58 for Solana.
|
|
299
|
+
const keyBytes = new Uint8Array(Buffer.from(derivedPrivateKey, 'hex'));
|
|
292
300
|
return {
|
|
293
|
-
derivedPrivateKey
|
|
301
|
+
derivedPrivateKey: encodeBase58(keyBytes)
|
|
294
302
|
};
|
|
295
303
|
}
|
|
296
304
|
/**
|
package/index.esm.js
CHANGED
|
@@ -274,7 +274,10 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
274
274
|
if (!derivedPrivateKey) {
|
|
275
275
|
throw new Error('Derived private key is undefined');
|
|
276
276
|
}
|
|
277
|
-
|
|
277
|
+
// MPC export returns a hex-encoded 64-byte Ed25519 keypair (private + public).
|
|
278
|
+
// Solana ecosystem expects base58-encoded keypairs.
|
|
279
|
+
const keyBytes = new Uint8Array(Buffer.from(derivedPrivateKey, 'hex'));
|
|
280
|
+
return encodeBase58(keyBytes);
|
|
278
281
|
}
|
|
279
282
|
/**
|
|
280
283
|
* Exports the private key for a given account address
|
|
@@ -287,8 +290,13 @@ class DynamicSvmWalletClient extends DynamicWalletClient {
|
|
|
287
290
|
keyShares,
|
|
288
291
|
derivationPath
|
|
289
292
|
});
|
|
293
|
+
if (!derivedPrivateKey) {
|
|
294
|
+
throw new Error('Derived private key is undefined');
|
|
295
|
+
}
|
|
296
|
+
// MPC export returns hex-encoded Ed25519 keypair; convert to base58 for Solana.
|
|
297
|
+
const keyBytes = new Uint8Array(Buffer.from(derivedPrivateKey, 'hex'));
|
|
290
298
|
return {
|
|
291
|
-
derivedPrivateKey
|
|
299
|
+
derivedPrivateKey: encodeBase58(keyBytes)
|
|
292
300
|
};
|
|
293
301
|
}
|
|
294
302
|
/**
|
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.321",
|
|
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.321",
|
|
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,111 +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
|
-
/** @deprecated Use externalKeySharesWithBackupStatus instead */
|
|
22
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
23
|
-
externalKeySharesWithBackupStatus: Array<{
|
|
24
|
-
share: ServerKeyShare;
|
|
25
|
-
backedUpToClientKeyShareService: boolean;
|
|
26
|
-
}>;
|
|
27
|
-
}>;
|
|
28
|
-
deriveAccountAddress(rawPublicKey: string | Uint8Array): Promise<{
|
|
29
|
-
accountAddress: string;
|
|
30
|
-
}>;
|
|
31
|
-
/**
|
|
32
|
-
* This function takes a message and returns it after being signed with MPC
|
|
33
|
-
*
|
|
34
|
-
* @param message The message to sign (Uint8Array)
|
|
35
|
-
* @param accountAddress Solana address (base58 encoded)
|
|
36
|
-
* @param password The password for encrypted backup shares
|
|
37
|
-
*/
|
|
38
|
-
signMessage({ message, accountAddress, password, externalServerKeyShares, }: {
|
|
39
|
-
message: string | Uint8Array;
|
|
40
|
-
accountAddress: string;
|
|
41
|
-
password?: string;
|
|
42
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
43
|
-
}): Promise<string>;
|
|
44
|
-
signTransaction({ senderAddress, transaction, password, externalServerKeyShares, }: {
|
|
45
|
-
senderAddress: string;
|
|
46
|
-
transaction: VersionedTransaction | Transaction | string;
|
|
47
|
-
password?: string;
|
|
48
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
49
|
-
}): Promise<string>;
|
|
50
|
-
/**
|
|
51
|
-
* Exports the private key for a given account address
|
|
52
|
-
*
|
|
53
|
-
* @param accountAddress The account address to export the private key for
|
|
54
|
-
* @param password The password for encrypted backup shares
|
|
55
|
-
* @returns The private key
|
|
56
|
-
*/
|
|
57
|
-
exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
|
|
58
|
-
accountAddress: string;
|
|
59
|
-
password?: string;
|
|
60
|
-
externalServerKeyShares?: ServerKeyShare[];
|
|
61
|
-
}): Promise<string>;
|
|
62
|
-
/**
|
|
63
|
-
* Exports the private key for a given account address
|
|
64
|
-
*
|
|
65
|
-
* @param keyShares The key shares to export the private key for
|
|
66
|
-
* @returns The private key
|
|
67
|
-
*/
|
|
68
|
-
offlineExportPrivateKey({ keyShares, derivationPath, }: {
|
|
69
|
-
keyShares: Ed25519KeygenResult[];
|
|
70
|
-
derivationPath?: string;
|
|
71
|
-
}): Promise<{
|
|
72
|
-
derivedPrivateKey: string | undefined;
|
|
73
|
-
}>;
|
|
74
|
-
/**
|
|
75
|
-
* Converts the private key to a hex string
|
|
76
|
-
*
|
|
77
|
-
* @param privateKey The private key to convert
|
|
78
|
-
* @returns The hex string
|
|
79
|
-
*/
|
|
80
|
-
decodePrivateKeyForSolana(privateKey: string): string;
|
|
81
|
-
getPublicKeyFromPrivateKey(privateKey: string): string;
|
|
82
|
-
encodePublicKey(publicKey: Uint8Array): string;
|
|
83
|
-
/**
|
|
84
|
-
* Imports the private key for a given account address
|
|
85
|
-
*
|
|
86
|
-
* @param privateKey The private key to import
|
|
87
|
-
* @param chainName The chain name to import the private key for
|
|
88
|
-
* @param thresholdSignatureScheme The threshold signature scheme to use
|
|
89
|
-
* @param password The password for encrypted backup shares
|
|
90
|
-
* @returns The account address, raw public key, and client key shares
|
|
91
|
-
*/
|
|
92
|
-
importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, backUpToClientShareService, }: {
|
|
93
|
-
privateKey: string;
|
|
94
|
-
chainName: string;
|
|
95
|
-
thresholdSignatureScheme: ThresholdSignatureScheme;
|
|
96
|
-
password?: string;
|
|
97
|
-
onError?: (error: Error) => void;
|
|
98
|
-
backUpToClientShareService?: boolean;
|
|
99
|
-
}): Promise<{
|
|
100
|
-
accountAddress: string;
|
|
101
|
-
rawPublicKey: Uint8Array | string | undefined;
|
|
102
|
-
/** @deprecated Use externalKeySharesWithBackupStatus instead */
|
|
103
|
-
externalServerKeyShares: ServerKeyShare[];
|
|
104
|
-
externalKeySharesWithBackupStatus: Array<{
|
|
105
|
-
share: ServerKeyShare;
|
|
106
|
-
backedUpToClientKeyShareService: boolean;
|
|
107
|
-
}>;
|
|
108
|
-
}>;
|
|
109
|
-
getSvmWallets(): Promise<import("@dynamic-labs-wallet/node").WalletProperties[]>;
|
|
110
|
-
}
|
|
111
|
-
//# 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"}
|