@dynamic-labs-wallet/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/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/svm",
3
- "version": "0.0.317",
3
+ "version": "0.0.319-beta.1",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/browser": "0.0.317",
7
+ "@dynamic-labs-wallet/browser": "0.0.319-beta.1",
8
8
  "@solana/web3.js": "^1.98.2",
9
9
  "bs58": "^6.0.0",
10
10
  "@dynamic-labs/sdk-api-core": "^0.0.900"
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './svm/index.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
@@ -1,115 +0,0 @@
1
- import { DynamicWalletClient, type DynamicWalletClientInternalOptions, type DynamicWalletClientProps, type Ed25519KeygenResult, type ThresholdSignatureScheme, type TraceContext, type RequestWithElevatedAccessToken } from '@dynamic-labs-wallet/browser';
2
- import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
3
- export declare class DynamicSvmWalletClient extends DynamicWalletClient {
4
- readonly chainName = "SVM";
5
- accountAddress?: string;
6
- constructor({ environmentId, authToken, backupServiceAuthToken, baseApiUrl, baseMPCRelayApiUrl, storageKey, debug, featureFlags, authMode, sdkVersion, forwardMPCClient, logger, }: DynamicWalletClientProps, internalOptions?: DynamicWalletClientInternalOptions);
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, signedSessionId, traceContext, }: {
14
- thresholdSignatureScheme: ThresholdSignatureScheme;
15
- password?: string;
16
- signedSessionId: string;
17
- traceContext?: TraceContext;
18
- }): Promise<{
19
- accountAddress: string;
20
- rawPublicKey: Uint8Array | string;
21
- }>;
22
- deriveAccountAddress(rawPublicKey: string | Uint8Array): Promise<{
23
- accountAddress: string;
24
- }>;
25
- /**
26
- * This function takes a message and returns it after being signed with MPC
27
- *
28
- * @param message The message to sign (Uint8Array)
29
- * @param accountAddress Solana address (base58 encoded)
30
- * @param password The password for encrypted backup shares
31
- */
32
- signMessage({ message, accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, onError, traceContext, }: {
33
- message: string;
34
- accountAddress: string;
35
- password?: string;
36
- signedSessionId: string;
37
- mfaToken?: string;
38
- elevatedAccessToken?: string;
39
- onError?: (error: Error) => void;
40
- traceContext?: TraceContext;
41
- }): Promise<string>;
42
- signTransaction({ senderAddress, transaction, password, signedSessionId, mfaToken, elevatedAccessToken, chainId, context, onError, traceContext, }: {
43
- senderAddress: string;
44
- transaction: string;
45
- password?: string;
46
- signedSessionId: string;
47
- mfaToken?: string;
48
- elevatedAccessToken?: string;
49
- chainId?: string;
50
- context?: SignMessageContext;
51
- onError?: (error: Error) => void;
52
- traceContext?: TraceContext;
53
- }): Promise<string>;
54
- private prepareTransactionForSigning;
55
- private buildSignParams;
56
- /**
57
- * Exports the private key for a given account address
58
- *
59
- * @param accountAddress The account address to export the private key for
60
- * @param password The password for encrypted backup shares
61
- * @returns The private key
62
- */
63
- exportPrivateKey({ accountAddress, password, signedSessionId, mfaToken, elevatedAccessToken, }: RequestWithElevatedAccessToken<{
64
- accountAddress: string;
65
- password?: string;
66
- signedSessionId: string;
67
- mfaToken?: string;
68
- }>): Promise<string>;
69
- /**
70
- * Exports the private key for a given account address
71
- *
72
- * @param keyShares The key shares to export the private key for
73
- * @returns The private key
74
- */
75
- offlineExportPrivateKey({ keyShares, derivationPath, }: {
76
- keyShares: Ed25519KeygenResult[];
77
- derivationPath?: string;
78
- }): Promise<{
79
- derivedPrivateKey: string | undefined;
80
- }>;
81
- /**
82
- * Converts the private key to a hex string
83
- *
84
- * @param privateKey The private key to convert
85
- * @returns The hex string
86
- */
87
- decodePrivateKeyForSolana(privateKey: string): string;
88
- getPublicKeyFromPrivateKey(privateKey: string): string;
89
- encodePublicKey(publicKey: Uint8Array): string;
90
- /**
91
- * Imports the private key for a given account address
92
- *
93
- * @param privateKey The private key to import
94
- * @param chainName The chain name to import the private key for
95
- * @param thresholdSignatureScheme The threshold signature scheme to use
96
- * @param password The password for encrypted backup shares
97
- * @returns The account address, raw public key, and client key shares
98
- */
99
- importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, signedSessionId, publicAddressCheck, legacyWalletId, }: {
100
- privateKey: string;
101
- chainName: string;
102
- thresholdSignatureScheme: ThresholdSignatureScheme;
103
- password?: string;
104
- onError?: (error: Error) => void;
105
- signedSessionId: string;
106
- publicAddressCheck?: string;
107
- /** ID of the legacy embedded wallet being upgraded to v3 */
108
- legacyWalletId?: string;
109
- }): Promise<{
110
- accountAddress: string;
111
- rawPublicKey: Uint8Array | undefined;
112
- }>;
113
- getSvmWallets(): Promise<any>;
114
- }
115
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/svm/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EAQnB,KAAK,kCAAkC,EACvC,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,8BAA8B,EACpC,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAerE,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,QAAQ,CAAC,SAAS,SAAS;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;gBAGtB,EACE,aAAa,EACb,SAAS,EACT,sBAAsB,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AAE,wBAAwB,CAAC;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;QACjC,eAAe,EAAE,MAAM,CAAC;QACxB,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,4DAA4D;QAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;KACzB,GAAG,OAAO,CAAC;QACV,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,UAAU,GAAG,SAAS,CAAC;KACtC,CAAC;IAwEI,aAAa;CAKpB"}
@@ -1,2 +0,0 @@
1
- export declare const ERROR_CREATE_WALLET_ACCOUNT = "Error creating svm wallet account";
2
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/svm/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,sCAAsC,CAAC"}
@@ -1,2 +0,0 @@
1
- export * from './client.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/svm/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
@@ -1,24 +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 sendTransaction({ signedTransaction, rpcUrl, }: {
21
- signedTransaction: Uint8Array;
22
- rpcUrl?: string;
23
- }): Promise<string>;
24
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/svm/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,SAAS,EAAiB,WAAW,EAAE,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE/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,wBAAsB,eAAe,CAAC,EACpC,iBAAiB,EACjB,MAAwC,GACzC,EAAE;IACD,iBAAiB,EAAE,UAAU,CAAC;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,mBAIA"}