@tatumio/wallet-sdk 0.0.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.
Files changed (95) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +174 -0
  3. package/dist/chains.d.ts +38 -0
  4. package/dist/chains.d.ts.map +1 -0
  5. package/dist/chains.js +109 -0
  6. package/dist/chains.js.map +1 -0
  7. package/dist/constants/index.d.ts +3 -0
  8. package/dist/constants/index.d.ts.map +1 -0
  9. package/dist/constants/index.js +3 -0
  10. package/dist/constants/index.js.map +1 -0
  11. package/dist/constants/paths.d.ts +3 -0
  12. package/dist/constants/paths.d.ts.map +1 -0
  13. package/dist/constants/paths.js +3 -0
  14. package/dist/constants/paths.js.map +1 -0
  15. package/dist/constants/urls.d.ts +13 -0
  16. package/dist/constants/urls.d.ts.map +1 -0
  17. package/dist/constants/urls.js +13 -0
  18. package/dist/constants/urls.js.map +1 -0
  19. package/dist/errors.d.ts +9 -0
  20. package/dist/errors.d.ts.map +1 -0
  21. package/dist/errors.js +15 -0
  22. package/dist/errors.js.map +1 -0
  23. package/dist/http.d.ts +31 -0
  24. package/dist/http.d.ts.map +1 -0
  25. package/dist/http.js +123 -0
  26. package/dist/http.js.map +1 -0
  27. package/dist/index.d.ts +17 -0
  28. package/dist/index.d.ts.map +1 -0
  29. package/dist/index.js +9 -0
  30. package/dist/index.js.map +1 -0
  31. package/dist/operation.d.ts +8 -0
  32. package/dist/operation.d.ts.map +1 -0
  33. package/dist/operation.js +26 -0
  34. package/dist/operation.js.map +1 -0
  35. package/dist/path.d.ts +3 -0
  36. package/dist/path.d.ts.map +1 -0
  37. package/dist/path.js +10 -0
  38. package/dist/path.js.map +1 -0
  39. package/dist/portal/client-api.d.ts +73 -0
  40. package/dist/portal/client-api.d.ts.map +1 -0
  41. package/dist/portal/client-api.js +63 -0
  42. package/dist/portal/client-api.js.map +1 -0
  43. package/dist/portal/custodian.d.ts +92 -0
  44. package/dist/portal/custodian.d.ts.map +1 -0
  45. package/dist/portal/custodian.js +84 -0
  46. package/dist/portal/custodian.js.map +1 -0
  47. package/dist/portal/enclave-api.d.ts +53 -0
  48. package/dist/portal/enclave-api.d.ts.map +1 -0
  49. package/dist/portal/enclave-api.js +70 -0
  50. package/dist/portal/enclave-api.js.map +1 -0
  51. package/dist/portal/transport.d.ts +13 -0
  52. package/dist/portal/transport.d.ts.map +1 -0
  53. package/dist/portal/transport.js +27 -0
  54. package/dist/portal/transport.js.map +1 -0
  55. package/dist/portal/types/client.d.ts +74 -0
  56. package/dist/portal/types/client.d.ts.map +1 -0
  57. package/dist/portal/types/client.js +2 -0
  58. package/dist/portal/types/client.js.map +1 -0
  59. package/dist/portal/types/custodian.d.ts +39 -0
  60. package/dist/portal/types/custodian.d.ts.map +1 -0
  61. package/dist/portal/types/custodian.js +2 -0
  62. package/dist/portal/types/custodian.js.map +1 -0
  63. package/dist/portal/types/enclave.d.ts +64 -0
  64. package/dist/portal/types/enclave.d.ts.map +1 -0
  65. package/dist/portal/types/enclave.js +2 -0
  66. package/dist/portal/types/enclave.js.map +1 -0
  67. package/dist/portal/types/index.d.ts +5 -0
  68. package/dist/portal/types/index.d.ts.map +1 -0
  69. package/dist/portal/types/index.js +5 -0
  70. package/dist/portal/types/index.js.map +1 -0
  71. package/dist/portal/types/shared.d.ts +163 -0
  72. package/dist/portal/types/shared.d.ts.map +1 -0
  73. package/dist/portal/types/shared.js +2 -0
  74. package/dist/portal/types/shared.js.map +1 -0
  75. package/dist/portal/wallets-client.d.ts +105 -0
  76. package/dist/portal/wallets-client.d.ts.map +1 -0
  77. package/dist/portal/wallets-client.js +126 -0
  78. package/dist/portal/wallets-client.js.map +1 -0
  79. package/dist/sdk.d.ts +35 -0
  80. package/dist/sdk.d.ts.map +1 -0
  81. package/dist/sdk.js +41 -0
  82. package/dist/sdk.js.map +1 -0
  83. package/dist/tatum/api-client.d.ts +12 -0
  84. package/dist/tatum/api-client.d.ts.map +1 -0
  85. package/dist/tatum/api-client.js +35 -0
  86. package/dist/tatum/api-client.js.map +1 -0
  87. package/dist/tatum/provider.d.ts +17 -0
  88. package/dist/tatum/provider.d.ts.map +1 -0
  89. package/dist/tatum/provider.js +41 -0
  90. package/dist/tatum/provider.js.map +1 -0
  91. package/dist/types.d.ts +33 -0
  92. package/dist/types.d.ts.map +1 -0
  93. package/dist/types.js +2 -0
  94. package/dist/types.js.map +1 -0
  95. package/package.json +62 -0
@@ -0,0 +1,74 @@
1
+ import type { WalletChain } from '../../chains.js';
2
+ import type { EjectableBackupShares } from './shared.js';
3
+ export interface EvaluateTransactionToken {
4
+ address: string;
5
+ decimals: number;
6
+ symbol: string;
7
+ }
8
+ export interface EvaluateTransactionInput {
9
+ toAddress: string;
10
+ /** Native amount in base units (wei for EVM, lamports for Solana). */
11
+ value: string;
12
+ /** Calldata for contract interactions. */
13
+ data?: string;
14
+ /** Present when interacting with a token rather than the native asset. */
15
+ token?: EvaluateTransactionToken;
16
+ }
17
+ export type EvaluateTransactionOperationType = 'validation' | 'simulation' | 'all';
18
+ export interface EvaluateTransactionBody {
19
+ /** Network name, e.g. 'ethereum', 'solana'. */
20
+ network: string;
21
+ transaction: EvaluateTransactionInput;
22
+ /** Defaults to 'all' server-side. */
23
+ operationType?: EvaluateTransactionOperationType;
24
+ }
25
+ export type EvaluateTransactionQuery = {
26
+ chainId: WalletChain;
27
+ };
28
+ export interface TransactionBalanceChange {
29
+ token?: EvaluateTransactionToken;
30
+ amount?: string;
31
+ type?: 'IN' | 'OUT';
32
+ }
33
+ export interface TransactionEvaluation {
34
+ balanceChanges?: TransactionBalanceChange[];
35
+ riskScore?: number;
36
+ classification?: string;
37
+ }
38
+ /** Shape varies by chain; EVM returns `evaluation`, Bitcoin returns `unsignedTx`. */
39
+ export interface EvaluateTransactionResponse {
40
+ evaluation?: TransactionEvaluation;
41
+ unsignedTx?: {
42
+ data?: string;
43
+ recentBlockhash?: string;
44
+ };
45
+ }
46
+ export interface UpdateSigningSharePairsBody {
47
+ signingSharePairIds: string[];
48
+ status: 'STORED_CLIENT';
49
+ }
50
+ export interface UpdateBackupSharePairsBody {
51
+ backupSharePairIds: string[];
52
+ status: 'STORED_CLIENT_BACKUP_SHARE' | 'STORED_CLIENT_BACKUP_SHARE_KEY';
53
+ }
54
+ /**
55
+ * Body for storing a single client-encrypted backup share against its pair.
56
+ * Sent once per curve (SECP256K1, ED25519) as part of the Portal-Managed
57
+ * backup flow. Endpoint returns 204 No Content.
58
+ */
59
+ export interface StoreBackupShareBody {
60
+ /** Ciphertext produced by encrypting the curve's backup share. */
61
+ clientCipherText: string;
62
+ }
63
+ /** Response of GET .../backup-share-pairs/{id}/cipher-text. */
64
+ export interface BackupShareCipherTextResponse {
65
+ cipherText: string;
66
+ }
67
+ export type EjectableBackupSharesBackupMethod = 'GDRIVE' | 'ICLOUD' | 'PASSWORD' | 'PASSKEY';
68
+ export type ClientEjectableBackupSharesQuery = {
69
+ backupMethod: EjectableBackupSharesBackupMethod;
70
+ };
71
+ export interface ClientEjectableBackupSharesResponse {
72
+ data?: EjectableBackupShares;
73
+ }
74
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/portal/types/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAGzD,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AACD,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,sEAAsE;IACtE,KAAK,EAAE,MAAM,CAAC;IACd,0CAA0C;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,0EAA0E;IAC1E,KAAK,CAAC,EAAE,wBAAwB,C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GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7F,MAAM,MAAM,gCAAgC,GAAG;IAC7C,YAAY,EAAE,iCAAiC,CAAC;CACjD,CAAC;AACF,MAAM,WAAW,mCAAmC;IAClD,IAAI,CAAC,EAAE,qBAAqB,CAAC;CAC9B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../src/portal/types/client.ts"],"names":[],"mappings":""}
@@ -0,0 +1,39 @@
1
+ import type { ClientDetails } from './shared.js';
2
+ export interface CreateClientBody {
3
+ isAccountAbstracted?: boolean;
4
+ }
5
+ export interface CreateClientResponse {
6
+ id?: string;
7
+ clientApiKey?: string;
8
+ clientSessionToken?: string;
9
+ isAccountAbstracted?: boolean;
10
+ }
11
+ /** Body for minting a Client Session Token (CST). */
12
+ export interface CreateClientSessionBody {
13
+ isAccountAbstracted?: boolean;
14
+ }
15
+ export interface CreateClientSessionResponse {
16
+ id?: string;
17
+ clientSessionToken?: string;
18
+ isAccountAbstracted?: boolean;
19
+ }
20
+ export type ListClientsQuery = {
21
+ cursor?: string;
22
+ take?: number;
23
+ };
24
+ export interface ListClientsResponse {
25
+ results?: ClientDetails[];
26
+ metadata?: {
27
+ cursor?: string | null;
28
+ take?: number;
29
+ total?: number;
30
+ };
31
+ }
32
+ export interface EnableEjectBody {
33
+ walletId: string;
34
+ ejectableUntil?: string;
35
+ }
36
+ export interface EnableEjectResponse {
37
+ ejectableUntil?: string;
38
+ }
39
+ //# sourceMappingURL=custodian.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custodian.d.ts","sourceRoot":"","sources":["../../../src/portal/types/custodian.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGjD,MAAM,WAAW,gBAAgB;IAC/B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AACD,MAAM,WAAW,oBAAoB;IACnC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AACD,MAAM,WAAW,2BAA2B;IAC1C,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAGD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AACF,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,aAAa,EAAE,CAAC;IAC1B,QAAQ,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACtE;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AACD,MAAM,WAAW,mBAAmB;IAClC,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=custodian.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"custodian.js","sourceRoot":"","sources":["../../../src/portal/types/custodian.ts"],"names":[],"mappings":""}
@@ -0,0 +1,64 @@
1
+ import type { WalletChain } from '../../chains.js';
2
+ import type { CurveShares } from './shared.js';
3
+ export type GenerateWalletResponse = CurveShares;
4
+ export interface BackupWalletBody {
5
+ /** JSON-stringified /v1/generate response. */
6
+ generateResponse: string;
7
+ }
8
+ export type BackupWalletResponse = CurveShares;
9
+ export interface RecoverWalletBody {
10
+ /** JSON-stringified /v1/backup response. */
11
+ backupResponse: string;
12
+ }
13
+ export type RecoverWalletResponse = CurveShares;
14
+ export interface SignBody {
15
+ method: string;
16
+ params: object | unknown[];
17
+ share: string;
18
+ chainId: WalletChain;
19
+ to: string;
20
+ rpcUrl?: string;
21
+ metadataStr?: string;
22
+ sponsorGas?: boolean;
23
+ presignature?: string;
24
+ presignatureId?: string;
25
+ }
26
+ export interface SignResponse {
27
+ data: string;
28
+ }
29
+ /**
30
+ * Body for raw-signing a hex digest with a specific curve
31
+ * (POST /v1/raw/sign/{curve}). No chain/RPC context — signs the digest directly.
32
+ */
33
+ export interface RawSignBody {
34
+ /** Hex string of the digest to sign, without a leading `0x`. */
35
+ params: string;
36
+ /** MPC share for the requested curve. */
37
+ share: string;
38
+ }
39
+ export interface RawSignResponse {
40
+ data: string;
41
+ }
42
+ export interface SendAssetsBody {
43
+ share: string;
44
+ chain: WalletChain;
45
+ to: string;
46
+ token: string;
47
+ amount: string;
48
+ rpcUrl?: string;
49
+ nonce?: string;
50
+ metadataStr?: string;
51
+ sponsorGas?: boolean;
52
+ presignature?: string;
53
+ presignatureId?: string;
54
+ }
55
+ export interface SendAssetsResponse {
56
+ transactionHash: string;
57
+ metadata: {
58
+ amount: string;
59
+ rawAmount: string;
60
+ tokenAddress: string;
61
+ tokenDecimals: number;
62
+ };
63
+ }
64
+ //# sourceMappingURL=enclave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enclave.d.ts","sourceRoot":"","sources":["../../../src/portal/types/enclave.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,MAAM,sBAAsB,GAAG,WAAW,CAAC;AAEjD,MAAM,WAAW,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AAM,CAAC;CACzB;AACD,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,QAAQ,EAAE;QACR,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=enclave.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enclave.js","sourceRoot":"","sources":["../../../src/portal/types/enclave.ts"],"names":[],"mappings":""}
@@ -0,0 +1,5 @@
1
+ export * from './shared.js';
2
+ export * from './custodian.js';
3
+ export * from './client.js';
4
+ export * from './enclave.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/portal/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,5 @@
1
+ export * from './shared.js';
2
+ export * from './custodian.js';
3
+ export * from './client.js';
4
+ export * from './enclave.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/portal/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
@@ -0,0 +1,163 @@
1
+ import type { RequestOptions } from '../../types.js';
2
+ /**
3
+ * Per-operation options for typed Portal methods. Narrows the shared
4
+ * RequestOptions: when a type param is `never` the field is forbidden, otherwise
5
+ * required (Query defaults to forbidden). `headers` and `signal` stay available.
6
+ */
7
+ export type PortalRequestOptions<Body = never, Path = never, Query = never> = Omit<RequestOptions, 'body' | 'path' | 'query'> & ([Body] extends [never] ? {
8
+ body?: never;
9
+ } : {
10
+ body: Body;
11
+ }) & ([Path] extends [never] ? {
12
+ path?: never;
13
+ } : {
14
+ path: Path;
15
+ }) & ([Query] extends [never] ? {
16
+ query?: never;
17
+ } : {
18
+ query: Query;
19
+ });
20
+ export interface WalletShare {
21
+ share: string;
22
+ id: string;
23
+ }
24
+ /** Curve-keyed shares returned by generate/backup/recover. */
25
+ export interface CurveShares {
26
+ SECP256K1: WalletShare;
27
+ ED25519: WalletShare;
28
+ }
29
+ export type Curve = 'SECP256K1' | 'ED25519';
30
+ export interface BackupSharePair {
31
+ backupMethod?: 'CUSTOM' | 'GDRIVE' | 'ICLOUD' | 'PASSWORD' | 'PASSKEY' | 'UNKNOWN';
32
+ createdAt?: string;
33
+ id?: string;
34
+ status?: 'completed' | 'incomplete' | 'STORED_CLIENT_BACKUP_SHARE' | 'STORED_CLIENT_BACKUP_SHARE_KEY' | 'STORED_CUSTODIAN_BACKUP_SHARE' | 'UNKNOWN';
35
+ }
36
+ export interface SigningSharePair {
37
+ createdAt?: string;
38
+ id?: string;
39
+ status?: 'completed' | 'incomplete' | 'STORED_DATABASE' | 'STORED_CLIENT';
40
+ }
41
+ export interface Wallet {
42
+ createdAt?: string;
43
+ curve?: Curve;
44
+ id?: string;
45
+ ejectableUntil?: string | null;
46
+ publicKey?: string | null;
47
+ backupSharePairs?: BackupSharePair[];
48
+ signingSharePairs?: SigningSharePair[];
49
+ }
50
+ /** Full client object (GET client / list results). All fields optional per spec. */
51
+ export interface ClientDetails {
52
+ createdAt?: string;
53
+ custodian?: {
54
+ id?: string;
55
+ name?: string;
56
+ };
57
+ ejectedAt?: string | null;
58
+ environment?: {
59
+ id?: string;
60
+ name?: string;
61
+ backupWithPortalEnabled?: boolean;
62
+ isMultiBackupEnabled?: boolean;
63
+ };
64
+ id?: string;
65
+ isAccountAbstracted?: boolean;
66
+ metadata?: {
67
+ namespaces?: Record<string, {
68
+ address?: string;
69
+ curve?: Curve;
70
+ }>;
71
+ };
72
+ wallets?: Wallet[];
73
+ }
74
+ export interface EjectableBackupShares {
75
+ encryptedClientBackupShare?: string | null;
76
+ custodianBackupShare?: string;
77
+ }
78
+ export interface Eip155TransactionResult {
79
+ transaction?: {
80
+ from?: string;
81
+ to?: string;
82
+ data?: string;
83
+ value?: string;
84
+ };
85
+ metadata?: {
86
+ amount?: string;
87
+ fromAddress?: string;
88
+ toAddress?: string;
89
+ tokenAddress?: string;
90
+ tokenDecimals?: number;
91
+ tokenSymbol?: string;
92
+ rawAmount?: string;
93
+ };
94
+ }
95
+ export interface SolanaTransactionResult {
96
+ transaction?: string;
97
+ metadata?: {
98
+ amount?: string;
99
+ fromAddress?: string;
100
+ toAddress?: string;
101
+ tokenMintAddress?: string;
102
+ tokenDecimals?: number;
103
+ tokenProgramId?: string;
104
+ tokenExtensions?: string[];
105
+ tokenSymbol?: string;
106
+ rawAmount?: string;
107
+ lastValidBlockHeight?: string;
108
+ serializedTransactionBase64Encoded?: string;
109
+ serializedTransactionBase58Encoded?: string;
110
+ };
111
+ }
112
+ export interface BitcoinTransactionResult {
113
+ transaction?: {
114
+ publicKey?: string;
115
+ rawTxHex?: string;
116
+ signatureHashes?: string[];
117
+ };
118
+ metadata?: {
119
+ chainId?: string;
120
+ amount?: string;
121
+ fromAddress?: string;
122
+ toAddress?: string;
123
+ rawAmount?: string;
124
+ tokenDecimals?: number;
125
+ tokenSymbol?: string;
126
+ feeInSatoshis?: string;
127
+ changeInSatoshis?: string;
128
+ };
129
+ }
130
+ export interface StellarTransactionResult {
131
+ transaction?: {
132
+ xdr?: string;
133
+ networkPassphrase?: string;
134
+ };
135
+ metadata?: {
136
+ amount?: string;
137
+ fromAddress?: string;
138
+ toAddress?: string;
139
+ assetCode?: string;
140
+ assetIssuer?: string | null;
141
+ rawAmount?: string;
142
+ };
143
+ }
144
+ export interface TronTransactionResult {
145
+ transaction?: {
146
+ id?: string;
147
+ network?: 'mainnet' | 'nile' | 'shasta';
148
+ };
149
+ metadata?: {
150
+ amount?: string;
151
+ fromAddress?: string;
152
+ toAddress?: string;
153
+ tokenSymbol?: string;
154
+ contractAddress?: string | null;
155
+ };
156
+ }
157
+ export type BuildTransactionResponse = Eip155TransactionResult | SolanaTransactionResult | BitcoinTransactionResult | StellarTransactionResult | TronTransactionResult;
158
+ export interface BuildTransactionBody {
159
+ to: string;
160
+ token: string;
161
+ amount: string;
162
+ }
163
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/portal/types/shared.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAErD;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,CAAC,IAAI,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,IACxE,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC,GAC7C,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,GAC5D,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,GAC5D,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,GAAG;IAAE,KAAK,CAAC,EAAE,KAAK,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CAAC,CAAC;AAGrE,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,8DAA8D;AAC9D,MAAM,WAAW,WAAW;IAC1B,SAAS,EAAE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,IAAI,CAAC;QAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE;QAAE,EAAE,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAA;KAAE,CAAC;IACvE,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;KACjC,CAAC;CACH;AAED,MAAM,MAAM,wBAAwB,GAChC,uBAAuB,GACvB,uBAAuB,GACvB,wBAAwB,GACxB,wBAAwB,GACxB,qBAAqB,CAAC;AAE1B,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/portal/types/shared.ts"],"names":[],"mappings":""}
@@ -0,0 +1,105 @@
1
+ import type { ClientOperation } from './client-api.js';
2
+ import type { EnclaveOperation } from './enclave-api.js';
3
+ import type { Curve } from './types/index.js';
4
+ import type { WalletChain } from '../chains.js';
5
+ import type { PortalTatumProvider } from '../tatum/provider.js';
6
+ import type { RequestOptions, WalletsSDKConfig } from '../types.js';
7
+ import type { BackupShareCipherTextResponse, BackupWalletBody, BackupWalletResponse, BuildTransactionBody, BuildTransactionResponse, ClientDetails, ClientEjectableBackupSharesQuery, ClientEjectableBackupSharesResponse, EvaluateTransactionBody, EvaluateTransactionQuery, EvaluateTransactionResponse, GenerateWalletResponse, PortalRequestOptions, RawSignBody, RawSignResponse, RecoverWalletBody, RecoverWalletResponse, SendAssetsBody, SendAssetsResponse, SignBody, SignResponse, StoreBackupShareBody, UpdateBackupSharePairsBody, UpdateSigningSharePairsBody } from './types/index.js';
8
+ export interface InitClientConfig {
9
+ token: string;
10
+ }
11
+ export type WalletsClientRequestOptions = RequestOptions;
12
+ /**
13
+ * Client-scoped Portal operations for a single Portal client.
14
+ *
15
+ * Obtain via {@link TatumWalletsSdk.initClient}. Calls authenticate with the
16
+ * client's Portal API key / Client Session Token. It is a thin facade over two
17
+ * internal layers — the client REST API ({@link ClientApi}, `/clients/me/...`)
18
+ * and the Enclave MPC API ({@link EnclaveApi}, wallet generation/signing/sending/
19
+ * backup/recovery, which operate on key shares).
20
+ */
21
+ export declare class WalletsClient {
22
+ private readonly clientApi;
23
+ private readonly enclaveApi;
24
+ constructor(clientConfig: InitClientConfig, provider: PortalTatumProvider, sdkConfig: WalletsSDKConfig);
25
+ /**
26
+ * Escape hatch: dispatch any client REST operation by name with raw options.
27
+ * Prefer the typed methods; use this only for not-yet-modeled behavior.
28
+ */
29
+ request<TResponse = unknown>(operationName: ClientOperation, options?: WalletsClientRequestOptions): Promise<TResponse>;
30
+ /**
31
+ * Escape hatch: dispatch any Enclave MPC operation by name. Auto-injects a
32
+ * Tatum-resolved `rpcUrl` (from the body's `chain`/`chainId`) when one is
33
+ * not already present. Prefer the typed enclave methods below.
34
+ */
35
+ enclaveRequest<TResponse = unknown>(operationName: EnclaveOperation, options?: WalletsClientRequestOptions): Promise<TResponse>;
36
+ /** Fetch this client's details — wallets, addresses, and share-pair statuses. */
37
+ getClientDetails<TResponse = ClientDetails>(options?: PortalRequestOptions): Promise<TResponse>;
38
+ /**
39
+ * Build an unsigned asset-transfer transaction on the given chain. Sign and
40
+ * submit it separately via {@link sign} (or {@link sendAssets} to do both).
41
+ */
42
+ buildTransaction<TResponse = BuildTransactionResponse>(options: PortalRequestOptions<BuildTransactionBody, {
43
+ chain: WalletChain;
44
+ }>): Promise<TResponse>;
45
+ /** Simulate and/or validate a transaction before signing (balance changes, risk score). */
46
+ evaluateTransaction<TResponse = EvaluateTransactionResponse>(options: PortalRequestOptions<EvaluateTransactionBody, never, EvaluateTransactionQuery>): Promise<TResponse>;
47
+ /** Confirm the client has stored its signing shares by updating their pair statuses. */
48
+ updateSigningSharePairs<TResponse = void>(options: PortalRequestOptions<UpdateSigningSharePairsBody>): Promise<TResponse>;
49
+ /**
50
+ * Mark backup share pairs stored — the final step of a backup, after
51
+ * {@link storeEncryptedBackupShare} (Portal-Managed) or storing on your own backend.
52
+ */
53
+ updateBackupSharePairs<TResponse = void>(options: PortalRequestOptions<UpdateBackupSharePairsBody>): Promise<TResponse>;
54
+ /**
55
+ * Store a client-encrypted backup share against its pair (Portal-Managed
56
+ * backups). Call once per curve with that curve's ciphertext, then mark the
57
+ * pairs stored via {@link updateBackupSharePairs}.
58
+ */
59
+ storeEncryptedBackupShare<TResponse = void>(options: PortalRequestOptions<StoreBackupShareBody, {
60
+ backupSharePairId: string;
61
+ }>): Promise<TResponse>;
62
+ /** Retrieve a previously stored client-encrypted backup share ciphertext. */
63
+ getBackupShareCipherText<TResponse = BackupShareCipherTextResponse>(options: PortalRequestOptions<never, {
64
+ backupSharePairId: string;
65
+ }>): Promise<TResponse>;
66
+ /** Fetch this wallet's ejectable backup shares for the given backup method. */
67
+ getEjectableBackupShares<TResponse = ClientEjectableBackupSharesResponse>(options: PortalRequestOptions<never, {
68
+ walletId: string;
69
+ }, ClientEjectableBackupSharesQuery>): Promise<TResponse>;
70
+ /** Finalize an eject for a wallet after the client has reconstructed its key. */
71
+ completeEject<TResponse = void>(options: PortalRequestOptions<never, {
72
+ walletId: string;
73
+ }>): Promise<TResponse>;
74
+ /**
75
+ * Generate a new MPC wallet (Enclave API), producing one signing share per
76
+ * curve (`SECP256K1` and `ED25519`). Returns the shares to store client-side.
77
+ */
78
+ generateWallet<TResponse = GenerateWalletResponse>(options?: PortalRequestOptions): Promise<TResponse>;
79
+ /**
80
+ * Produce backup shares from the generate response (Enclave API). Encrypt and
81
+ * persist them, then call {@link updateBackupSharePairs} to complete the backup.
82
+ */
83
+ backupWallet<TResponse = BackupWalletResponse>(options: PortalRequestOptions<BackupWalletBody>): Promise<TResponse>;
84
+ /** Reconstruct signing shares from a (decrypted) backup response (Enclave API). */
85
+ recoverWallet<TResponse = RecoverWalletResponse>(options: PortalRequestOptions<RecoverWalletBody>): Promise<TResponse>;
86
+ /**
87
+ * Sign (and, for transaction methods, submit) via the Enclave API using the
88
+ * given RPC `method` — e.g. `eth_sendTransaction`, `personal_sign`,
89
+ * `sol_signTransaction`, `stellar_sendTransaction`, `tron_sendTransaction`.
90
+ */
91
+ sign<TResponse = SignResponse>(options: PortalRequestOptions<SignBody>): Promise<TResponse>;
92
+ /**
93
+ * Raw-sign a hex digest with the given curve. No chain/RPC context — the
94
+ * digest is signed directly (SECP256K1 for EVM, ED25519 for Solana, etc.).
95
+ */
96
+ rawSign<TResponse = RawSignResponse>(options: PortalRequestOptions<RawSignBody, {
97
+ curve: Curve;
98
+ }>): Promise<TResponse>;
99
+ /**
100
+ * Build, sign, and broadcast an asset transfer in one call (Enclave API).
101
+ * A Tatum-resolved `rpcUrl` is injected from `chain` when omitted.
102
+ */
103
+ sendAssets<TResponse = SendAssetsResponse>(options: PortalRequestOptions<SendAssetsBody>): Promise<TResponse>;
104
+ }
105
+ //# sourceMappingURL=wallets-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wallets-client.d.ts","sourceRoot":"","sources":["../../src/portal/wallets-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK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AAC,GACzD,OAAO,CAAC,SAAS,CAAC;IAMrB;;;OAGG;IACH,cAAc,CAAC,SAAS,GAAG,sBAAsB,EAAE,OAAO,CAAC,EAAE,oBAAoB,GAAG,OAAO,CAAC,SAAS,CAAC;IAItG;;;OAGG;IACH,YAAY,CAAC,SAAS,GAAG,oBAAoB,EAC3C,OAAO,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,GAC9C,OAAO,CAAC,SAAS,CAAC;IAIrB,mFAAmF;IACnF,aAAa,CAAC,SAAS,GAAG,qBAAqB,EAC7C,OAAO,EAAE,oBAAoB,CAAC,iBAAiB,CAAC,GAC/C,OAAO,CAAC,SAAS,CAAC;IAIrB;;;;OAIG;IACH,IAAI,CAAC,SAAS,GAAG,YAAY,EAAE,OAAO,EAAE,oBAAoB,CAAC,QAAQ,CAAC,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3F;;;OAGG;IACH,OAAO,CAAC,SAAS,GAAG,eAAe,EACjC,OAAO,EAAE,oBAAoB,CAAC,WAAW,EAAE;QAAE,KAAK,EAAE,KAAK,CAAA;KAAE,CAAC,GAC3D,OAAO,CAAC,SAAS,CAAC;IAIrB;;;OAGG;IACH,UAAU,CAAC,SAAS,GAAG,kBAAkB,EACvC,OAAO,EAAE,oBAAoB,CAAC,cAAc,CAAC,GAC5C,OAAO,CAAC,SAAS,CAAC;CAGtB"}
@@ -0,0 +1,126 @@
1
+ import { ClientApi } from './client-api.js';
2
+ import { EnclaveApi } from './enclave-api.js';
3
+ /**
4
+ * Client-scoped Portal operations for a single Portal client.
5
+ *
6
+ * Obtain via {@link TatumWalletsSdk.initClient}. Calls authenticate with the
7
+ * client's Portal API key / Client Session Token. It is a thin facade over two
8
+ * internal layers — the client REST API ({@link ClientApi}, `/clients/me/...`)
9
+ * and the Enclave MPC API ({@link EnclaveApi}, wallet generation/signing/sending/
10
+ * backup/recovery, which operate on key shares).
11
+ */
12
+ export class WalletsClient {
13
+ clientApi;
14
+ enclaveApi;
15
+ constructor(clientConfig, provider, sdkConfig) {
16
+ if (!clientConfig.token) {
17
+ throw new Error('Client token is required');
18
+ }
19
+ this.clientApi = new ClientApi(clientConfig.token, sdkConfig);
20
+ this.enclaveApi = new EnclaveApi(clientConfig.token, provider, sdkConfig);
21
+ }
22
+ /**
23
+ * Escape hatch: dispatch any client REST operation by name with raw options.
24
+ * Prefer the typed methods; use this only for not-yet-modeled behavior.
25
+ */
26
+ request(operationName, options = {}) {
27
+ return this.clientApi.request(operationName, options);
28
+ }
29
+ /**
30
+ * Escape hatch: dispatch any Enclave MPC operation by name. Auto-injects a
31
+ * Tatum-resolved `rpcUrl` (from the body's `chain`/`chainId`) when one is
32
+ * not already present. Prefer the typed enclave methods below.
33
+ */
34
+ enclaveRequest(operationName, options = {}) {
35
+ return this.enclaveApi.request(operationName, options);
36
+ }
37
+ // ── client REST layer ──────────────────────────────────────────────
38
+ /** Fetch this client's details — wallets, addresses, and share-pair statuses. */
39
+ getClientDetails(options) {
40
+ return this.clientApi.getClientDetails(options);
41
+ }
42
+ /**
43
+ * Build an unsigned asset-transfer transaction on the given chain. Sign and
44
+ * submit it separately via {@link sign} (or {@link sendAssets} to do both).
45
+ */
46
+ buildTransaction(options) {
47
+ return this.clientApi.buildTransaction(options);
48
+ }
49
+ /** Simulate and/or validate a transaction before signing (balance changes, risk score). */
50
+ evaluateTransaction(options) {
51
+ return this.clientApi.evaluateTransaction(options);
52
+ }
53
+ /** Confirm the client has stored its signing shares by updating their pair statuses. */
54
+ updateSigningSharePairs(options) {
55
+ return this.clientApi.updateSigningSharePairs(options);
56
+ }
57
+ /**
58
+ * Mark backup share pairs stored — the final step of a backup, after
59
+ * {@link storeEncryptedBackupShare} (Portal-Managed) or storing on your own backend.
60
+ */
61
+ updateBackupSharePairs(options) {
62
+ return this.clientApi.updateBackupSharePairs(options);
63
+ }
64
+ /**
65
+ * Store a client-encrypted backup share against its pair (Portal-Managed
66
+ * backups). Call once per curve with that curve's ciphertext, then mark the
67
+ * pairs stored via {@link updateBackupSharePairs}.
68
+ */
69
+ storeEncryptedBackupShare(options) {
70
+ return this.clientApi.storeEncryptedBackupShare(options);
71
+ }
72
+ /** Retrieve a previously stored client-encrypted backup share ciphertext. */
73
+ getBackupShareCipherText(options) {
74
+ return this.clientApi.getBackupShareCipherText(options);
75
+ }
76
+ /** Fetch this wallet's ejectable backup shares for the given backup method. */
77
+ getEjectableBackupShares(options) {
78
+ return this.clientApi.getEjectableBackupShares(options);
79
+ }
80
+ /** Finalize an eject for a wallet after the client has reconstructed its key. */
81
+ completeEject(options) {
82
+ return this.clientApi.completeEject(options);
83
+ }
84
+ // ── enclave MPC layer ──────────────────────────────────────────────
85
+ /**
86
+ * Generate a new MPC wallet (Enclave API), producing one signing share per
87
+ * curve (`SECP256K1` and `ED25519`). Returns the shares to store client-side.
88
+ */
89
+ generateWallet(options) {
90
+ return this.enclaveApi.generateWallet(options);
91
+ }
92
+ /**
93
+ * Produce backup shares from the generate response (Enclave API). Encrypt and
94
+ * persist them, then call {@link updateBackupSharePairs} to complete the backup.
95
+ */
96
+ backupWallet(options) {
97
+ return this.enclaveApi.backupWallet(options);
98
+ }
99
+ /** Reconstruct signing shares from a (decrypted) backup response (Enclave API). */
100
+ recoverWallet(options) {
101
+ return this.enclaveApi.recoverWallet(options);
102
+ }
103
+ /**
104
+ * Sign (and, for transaction methods, submit) via the Enclave API using the
105
+ * given RPC `method` — e.g. `eth_sendTransaction`, `personal_sign`,
106
+ * `sol_signTransaction`, `stellar_sendTransaction`, `tron_sendTransaction`.
107
+ */
108
+ sign(options) {
109
+ return this.enclaveApi.sign(options);
110
+ }
111
+ /**
112
+ * Raw-sign a hex digest with the given curve. No chain/RPC context — the
113
+ * digest is signed directly (SECP256K1 for EVM, ED25519 for Solana, etc.).
114
+ */
115
+ rawSign(options) {
116
+ return this.enclaveApi.rawSign(options);
117
+ }
118
+ /**
119
+ * Build, sign, and broadcast an asset transfer in one call (Enclave API).
120
+ * A Tatum-resolved `rpcUrl` is injected from `chain` when omitted.
121
+ */
122
+ sendAssets(options) {
123
+ return this.enclaveApi.sendAssets(options);
124
+ }
125
+ }
126
+ //# sourceMappingURL=wallets-client.js.map