@dynamic-labs-wallet/node-ton 0.0.319 → 0.0.320

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/node-ton",
3
- "version": "0.0.319",
3
+ "version": "0.0.320",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/node": "0.0.319",
7
+ "@dynamic-labs-wallet/node": "0.0.320",
8
8
  "@ton/crypto": "^3.3.0",
9
9
  "@ton/ton": "^16.0.0"
10
10
  },
@@ -1,136 +0,0 @@
1
- import { DynamicWalletClient, type DynamicWalletClientProps, type Ed25519KeygenResult, type ServerKeyShare, type ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';
2
- export declare class DynamicTonWalletClient extends DynamicWalletClient {
3
- readonly chainName = "TON";
4
- constructor({ environmentId, baseApiUrl, baseMPCRelayApiUrl, debug, enableMPCAccelerator, logger, }: DynamicWalletClientProps);
5
- /**
6
- * Creates a new wallet account and stores the key shares in the wallet map.
7
- * @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
8
- * @param password - The password to use for the wallet.
9
- * @param onError - The function to call if an error occurs.
10
- * @param backUpToClientShareService - Whether to back up the external server key shares to the client share service. By default, it is false.
11
- * @returns The account address, public key hex, raw public key, external server key shares, and wallet id.
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
- publicKeyHex: string;
21
- rawPublicKey: Uint8Array | string;
22
- walletId: string;
23
- /** @deprecated Use externalKeySharesWithBackupStatus instead */
24
- externalServerKeyShares: ServerKeyShare[];
25
- externalKeySharesWithBackupStatus: Array<{
26
- share: ServerKeyShare;
27
- backedUpToClientKeyShareService: boolean;
28
- }>;
29
- }>;
30
- /**
31
- * Signs a message using MPC
32
- * @param message - The message to sign
33
- * @param accountAddress - The account address to sign with
34
- * @param password - The password for encrypted backup shares
35
- * @param externalServerKeyShares - The external server key shares
36
- * @param onError - The function to call if an error occurs
37
- * @returns The signature as a base64 string
38
- */
39
- signMessage({ message, accountAddress, password, externalServerKeyShares, onError, }: {
40
- message: string;
41
- accountAddress: string;
42
- password?: string;
43
- externalServerKeyShares?: ServerKeyShare[];
44
- onError?: (error: Error) => void;
45
- }): Promise<string>;
46
- /**
47
- * Signs a transaction using MPC
48
- * @param senderAddress - The sender address
49
- * @param transaction - The serialized transaction to sign
50
- * @param password - The password for encrypted backup shares
51
- * @param externalServerKeyShares - The external server key shares
52
- * @param onError - The function to call if an error occurs
53
- * @returns The signature as a base64 string
54
- */
55
- signTransaction({ senderAddress, transaction, password, externalServerKeyShares, onError, }: {
56
- senderAddress: string;
57
- transaction: string;
58
- password?: string;
59
- externalServerKeyShares?: ServerKeyShare[];
60
- onError?: (error: Error) => void;
61
- }): Promise<string>;
62
- /**
63
- * Exports the private key for a given account address
64
- * @param accountAddress - The account address to export the private key for
65
- * @param password - The password for encrypted backup shares
66
- * @param externalServerKeyShares - The external server key shares
67
- * @returns The private key as a hex string
68
- */
69
- exportPrivateKey({ accountAddress, password, externalServerKeyShares, }: {
70
- accountAddress: string;
71
- password?: string;
72
- externalServerKeyShares?: ServerKeyShare[];
73
- }): Promise<string>;
74
- /**
75
- * Exports the private key offline using key shares
76
- * @param keyShares - The key shares to export the private key for
77
- * @param derivationPath - The derivation path
78
- * @returns The derived private key
79
- */
80
- offlineExportPrivateKey({ keyShares, derivationPath, }: {
81
- keyShares: Ed25519KeygenResult[];
82
- derivationPath?: string;
83
- }): Promise<{
84
- derivedPrivateKey: string | undefined;
85
- }>;
86
- /**
87
- * Imports a private key and stores the key shares in the wallet map.
88
- * @param privateKey - The private key to import.
89
- * @param chainName - The chain name to use for the wallet.
90
- * @param thresholdSignatureScheme - The threshold signature scheme to use for the wallet.
91
- * @param password - The password to use for the wallet.
92
- * @param onError - The function to call if an error occurs.
93
- * @param backUpToClientShareService - Whether to back up the external server key shares to the client share service.
94
- * @param publicAddressCheck - Optional public address to verify against the derived address.
95
- * @returns The account address, public key hex, raw public key, and external server key shares.
96
- */
97
- importPrivateKey({ privateKey, chainName, thresholdSignatureScheme, password, onError, backUpToClientShareService, publicAddressCheck, }: {
98
- privateKey: string;
99
- chainName: string;
100
- thresholdSignatureScheme: ThresholdSignatureScheme;
101
- password?: string;
102
- onError?: (error: Error) => void;
103
- backUpToClientShareService?: boolean;
104
- publicAddressCheck?: string;
105
- }): Promise<{
106
- accountAddress: string;
107
- publicKeyHex: string;
108
- rawPublicKey: Uint8Array | string | undefined;
109
- /** @deprecated Use externalKeySharesWithBackupStatus instead */
110
- externalServerKeyShares: ServerKeyShare[];
111
- externalKeySharesWithBackupStatus: Array<{
112
- share: ServerKeyShare;
113
- backedUpToClientKeyShareService: boolean;
114
- }>;
115
- }>;
116
- /**
117
- * Derives the public key from a private key
118
- * @param privateKeyHex - The private key as a hex string
119
- * @returns The public key as a hex string
120
- */
121
- getPublicKeyFromPrivateKey(privateKeyHex: string): string;
122
- /**
123
- * Derives a TON address from a public key
124
- * TON addresses are derived from the wallet contract state init
125
- */
126
- deriveTonAddress: ({ publicKeyHex, workchain }: {
127
- publicKeyHex: string;
128
- workchain?: number;
129
- }) => string;
130
- /**
131
- * Gets all TON wallets
132
- * @returns Array of TON wallets
133
- */
134
- getTonWallets(): Promise<import("@dynamic-labs-wallet/node").WalletProperties[]>;
135
- }
136
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,wBAAwB,EAG9B,MA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EAAE,cAAc,EAAE,CAAC;QAC1C,iCAAiC,EAAE,KAAK,CAAC;YACvC,KAAK,EAAE,cAAc,CAAC;YACtB,+BAA+B,EAAE,OAAO,CAAC;SAC1C,CAAC,CAAC;KACJ,CAAC;IAgGF;;;;OAIG;IACH,0BAA0B,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IAoBzD;;;OAGG;IACH,gBAAgB,gCAAqC;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,KAAG,MAAM,CAiBxG;IAEF;;;OAGG;IACG,aAAa;CAKpB"}
@@ -1,8 +0,0 @@
1
- export declare const ERROR_KEYGEN_FAILED = "Error with keygen";
2
- export declare const ERROR_CREATE_WALLET_ACCOUNT = "Error creating ton wallet account";
3
- export declare const ERROR_IMPORT_PRIVATE_KEY = "Error importing private key";
4
- export declare const ERROR_EXPORT_PRIVATE_KEY = "Error exporting private key";
5
- export declare const ERROR_SIGN_MESSAGE = "Error signing message";
6
- export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "Account address is required";
7
- export declare const ERROR_SIGN_TRANSACTION = "Error signing transaction";
8
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,sCAAsC,CAAC;AAE/E,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,8BAA8B,CAAC"}
@@ -1,3 +0,0 @@
1
- export * from './client.js';
2
- export * from './constants.js';
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC"}
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './client/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,mBAAmB,CAAC"}