near-kit 0.0.0 → 0.2.0
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/LICENSE +21 -0
- package/README.md +473 -2
- package/dist/contracts/contract.d.ts +63 -0
- package/dist/contracts/contract.d.ts.map +1 -0
- package/dist/contracts/contract.js +42 -0
- package/dist/contracts/contract.js.map +1 -0
- package/dist/contracts/index.d.ts +5 -0
- package/dist/contracts/index.d.ts.map +1 -0
- package/dist/contracts/index.js +5 -0
- package/dist/contracts/index.js.map +1 -0
- package/dist/core/actions.d.ts +193 -0
- package/dist/core/actions.d.ts.map +1 -0
- package/dist/core/actions.js +195 -0
- package/dist/core/actions.js.map +1 -0
- package/dist/core/config-schemas.d.ts +179 -0
- package/dist/core/config-schemas.d.ts.map +1 -0
- package/dist/core/config-schemas.js +169 -0
- package/dist/core/config-schemas.js.map +1 -0
- package/dist/core/constants.d.ts +43 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +49 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/near.d.ts +301 -0
- package/dist/core/near.d.ts.map +1 -0
- package/dist/core/near.js +504 -0
- package/dist/core/near.js.map +1 -0
- package/dist/core/nonce-manager.d.ts +39 -0
- package/dist/core/nonce-manager.d.ts.map +1 -0
- package/dist/core/nonce-manager.js +73 -0
- package/dist/core/nonce-manager.js.map +1 -0
- package/dist/core/rpc/rpc-error-handler.d.ts +60 -0
- package/dist/core/rpc/rpc-error-handler.d.ts.map +1 -0
- package/dist/core/rpc/rpc-error-handler.js +324 -0
- package/dist/core/rpc/rpc-error-handler.js.map +1 -0
- package/dist/core/rpc/rpc-schemas.d.ts +1812 -0
- package/dist/core/rpc/rpc-schemas.d.ts.map +1 -0
- package/dist/core/rpc/rpc-schemas.js +424 -0
- package/dist/core/rpc/rpc-schemas.js.map +1 -0
- package/dist/core/rpc/rpc.d.ts +117 -0
- package/dist/core/rpc/rpc.d.ts.map +1 -0
- package/dist/core/rpc/rpc.js +325 -0
- package/dist/core/rpc/rpc.js.map +1 -0
- package/dist/core/schema.d.ts +1188 -0
- package/dist/core/schema.d.ts.map +1 -0
- package/dist/core/schema.js +396 -0
- package/dist/core/schema.js.map +1 -0
- package/dist/core/transaction.d.ts +390 -0
- package/dist/core/transaction.d.ts.map +1 -0
- package/dist/core/transaction.js +653 -0
- package/dist/core/transaction.js.map +1 -0
- package/dist/core/types.d.ts +271 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +9 -0
- package/dist/core/types.js.map +1 -0
- package/dist/errors/index.d.ts +226 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +366 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/keys/credential-schemas.d.ts +98 -0
- package/dist/keys/credential-schemas.d.ts.map +1 -0
- package/dist/keys/credential-schemas.js +128 -0
- package/dist/keys/credential-schemas.js.map +1 -0
- package/dist/keys/file-keystore.d.ts +130 -0
- package/dist/keys/file-keystore.d.ts.map +1 -0
- package/dist/keys/file-keystore.js +266 -0
- package/dist/keys/file-keystore.js.map +1 -0
- package/dist/keys/in-memory-keystore.d.ts +71 -0
- package/dist/keys/in-memory-keystore.d.ts.map +1 -0
- package/dist/keys/in-memory-keystore.js +85 -0
- package/dist/keys/in-memory-keystore.js.map +1 -0
- package/dist/keys/index.d.ts +14 -0
- package/dist/keys/index.d.ts.map +1 -0
- package/dist/keys/index.js +20 -0
- package/dist/keys/index.js.map +1 -0
- package/dist/keys/native-keystore.d.ts +111 -0
- package/dist/keys/native-keystore.d.ts.map +1 -0
- package/dist/keys/native-keystore.js +167 -0
- package/dist/keys/native-keystore.js.map +1 -0
- package/dist/keys/rotating-keystore.d.ts +207 -0
- package/dist/keys/rotating-keystore.d.ts.map +1 -0
- package/dist/keys/rotating-keystore.js +240 -0
- package/dist/keys/rotating-keystore.js.map +1 -0
- package/dist/sandbox/index.d.ts +6 -0
- package/dist/sandbox/index.d.ts.map +1 -0
- package/dist/sandbox/index.js +5 -0
- package/dist/sandbox/index.js.map +1 -0
- package/dist/sandbox/sandbox.d.ts +55 -0
- package/dist/sandbox/sandbox.d.ts.map +1 -0
- package/dist/sandbox/sandbox.js +341 -0
- package/dist/sandbox/sandbox.js.map +1 -0
- package/dist/utils/amount.d.ts +76 -0
- package/dist/utils/amount.d.ts.map +1 -0
- package/dist/utils/amount.js +137 -0
- package/dist/utils/amount.js.map +1 -0
- package/dist/utils/gas.d.ts +69 -0
- package/dist/utils/gas.d.ts.map +1 -0
- package/dist/utils/gas.js +92 -0
- package/dist/utils/gas.js.map +1 -0
- package/dist/utils/index.d.ts +14 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +14 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/key.d.ts +117 -0
- package/dist/utils/key.d.ts.map +1 -0
- package/dist/utils/key.js +270 -0
- package/dist/utils/key.js.map +1 -0
- package/dist/utils/nep413.d.ts +97 -0
- package/dist/utils/nep413.d.ts.map +1 -0
- package/dist/utils/nep413.js +154 -0
- package/dist/utils/nep413.js.map +1 -0
- package/dist/utils/validation.d.ts +114 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +150 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/wallets/adapters.d.ts +119 -0
- package/dist/wallets/adapters.d.ts.map +1 -0
- package/dist/wallets/adapters.js +267 -0
- package/dist/wallets/adapters.js.map +1 -0
- package/dist/wallets/index.d.ts +11 -0
- package/dist/wallets/index.d.ts.map +1 -0
- package/dist/wallets/index.js +2 -0
- package/dist/wallets/index.js.map +1 -0
- package/dist/wallets/types.d.ts +99 -0
- package/dist/wallets/types.d.ts.map +1 -0
- package/dist/wallets/types.js +10 -0
- package/dist/wallets/types.js.map +1 -0
- package/package.json +78 -7
- package/index.js +0 -1
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error classes for the NEAR client library.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* All errors in this module extend {@link NearError}, which carries a stable
|
|
6
|
+
* `code` string and optional `data` field. Many errors also expose a
|
|
7
|
+
* `retryable` flag to indicate whether the operation is safe to retry.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Base error class for all NEAR-related errors.
|
|
11
|
+
*
|
|
12
|
+
* Provides a stable `code` and optional `data` payload for structured error
|
|
13
|
+
* handling. Concrete error subclasses in this module narrow down specific
|
|
14
|
+
* failure scenarios (network issues, contract panics, invalid transactions, etc.).
|
|
15
|
+
*/
|
|
16
|
+
export class NearError extends Error {
|
|
17
|
+
constructor(message, code, data) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.name = "NearError";
|
|
20
|
+
this.code = code;
|
|
21
|
+
this.data = data;
|
|
22
|
+
Object.setPrototypeOf(this, NearError.prototype);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Thrown when an account has insufficient balance for an operation
|
|
27
|
+
*/
|
|
28
|
+
export class InsufficientBalanceError extends NearError {
|
|
29
|
+
constructor(required, available) {
|
|
30
|
+
super(`Insufficient balance: required ${required} NEAR, available ${available} NEAR`, "INSUFFICIENT_BALANCE");
|
|
31
|
+
this.name = "InsufficientBalanceError";
|
|
32
|
+
this.required = required;
|
|
33
|
+
this.available = available;
|
|
34
|
+
Object.setPrototypeOf(this, InsufficientBalanceError.prototype);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Thrown when a contract function call fails
|
|
39
|
+
*/
|
|
40
|
+
export class FunctionCallError extends NearError {
|
|
41
|
+
constructor(contractId, methodName, panic, logs = []) {
|
|
42
|
+
const methodPart = methodName ? `.${methodName}` : "";
|
|
43
|
+
const message = panic
|
|
44
|
+
? `Contract call failed: ${contractId}${methodPart} - ${panic}`
|
|
45
|
+
: `Contract call failed: ${contractId}${methodPart}`;
|
|
46
|
+
super(message, "FUNCTION_CALL_ERROR");
|
|
47
|
+
this.name = "FunctionCallError";
|
|
48
|
+
this.contractId = contractId;
|
|
49
|
+
if (methodName !== undefined) {
|
|
50
|
+
this.methodName = methodName;
|
|
51
|
+
}
|
|
52
|
+
this.logs = logs;
|
|
53
|
+
if (panic !== undefined) {
|
|
54
|
+
this.panic = panic;
|
|
55
|
+
}
|
|
56
|
+
Object.setPrototypeOf(this, FunctionCallError.prototype);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Thrown when a network request fails
|
|
61
|
+
*/
|
|
62
|
+
export class NetworkError extends NearError {
|
|
63
|
+
constructor(message, statusCode, retryable = true) {
|
|
64
|
+
super(message, "NETWORK_ERROR", { statusCode });
|
|
65
|
+
this.name = "NetworkError";
|
|
66
|
+
if (statusCode !== undefined) {
|
|
67
|
+
this.statusCode = statusCode;
|
|
68
|
+
}
|
|
69
|
+
this.retryable = retryable;
|
|
70
|
+
Object.setPrototypeOf(this, NetworkError.prototype);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Thrown when a key is invalid or malformed
|
|
75
|
+
*/
|
|
76
|
+
export class InvalidKeyError extends NearError {
|
|
77
|
+
constructor(message) {
|
|
78
|
+
super(message, "INVALID_KEY");
|
|
79
|
+
this.name = "InvalidKeyError";
|
|
80
|
+
Object.setPrototypeOf(this, InvalidKeyError.prototype);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Thrown when an account does not exist
|
|
85
|
+
*/
|
|
86
|
+
export class AccountDoesNotExistError extends NearError {
|
|
87
|
+
constructor(accountId) {
|
|
88
|
+
super(`Account does not exist: ${accountId}`, "ACCOUNT_NOT_FOUND");
|
|
89
|
+
this.name = "AccountDoesNotExistError";
|
|
90
|
+
this.accountId = accountId;
|
|
91
|
+
Object.setPrototypeOf(this, AccountDoesNotExistError.prototype);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Thrown when an access key does not exist
|
|
96
|
+
*/
|
|
97
|
+
export class AccessKeyDoesNotExistError extends NearError {
|
|
98
|
+
constructor(accountId, publicKey) {
|
|
99
|
+
super(`Access key does not exist: ${publicKey} for account ${accountId}`, "ACCESS_KEY_NOT_FOUND");
|
|
100
|
+
this.name = "AccessKeyDoesNotExistError";
|
|
101
|
+
this.accountId = accountId;
|
|
102
|
+
this.publicKey = publicKey;
|
|
103
|
+
Object.setPrototypeOf(this, AccessKeyDoesNotExistError.prototype);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Thrown when an account ID is invalid
|
|
108
|
+
*/
|
|
109
|
+
export class InvalidAccountIdError extends NearError {
|
|
110
|
+
constructor(accountId, reason) {
|
|
111
|
+
const message = reason
|
|
112
|
+
? `Invalid account ID: ${accountId} - ${reason}`
|
|
113
|
+
: `Invalid account ID: ${accountId}`;
|
|
114
|
+
super(message, "INVALID_ACCOUNT_ID");
|
|
115
|
+
this.name = "InvalidAccountIdError";
|
|
116
|
+
this.accountId = accountId;
|
|
117
|
+
Object.setPrototypeOf(this, InvalidAccountIdError.prototype);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Thrown when transaction signing fails
|
|
122
|
+
*/
|
|
123
|
+
export class SignatureError extends NearError {
|
|
124
|
+
constructor(message) {
|
|
125
|
+
super(message, "SIGNATURE_ERROR");
|
|
126
|
+
this.name = "SignatureError";
|
|
127
|
+
Object.setPrototypeOf(this, SignatureError.prototype);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Thrown when gas limit is exceeded
|
|
132
|
+
*/
|
|
133
|
+
export class GasLimitExceededError extends NearError {
|
|
134
|
+
constructor(gasUsed, gasLimit) {
|
|
135
|
+
super(`Gas limit exceeded: used ${gasUsed}, limit ${gasLimit}`, "GAS_LIMIT_EXCEEDED");
|
|
136
|
+
this.name = "GasLimitExceededError";
|
|
137
|
+
this.gasUsed = gasUsed;
|
|
138
|
+
this.gasLimit = gasLimit;
|
|
139
|
+
Object.setPrototypeOf(this, GasLimitExceededError.prototype);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Thrown when a transaction times out
|
|
144
|
+
*/
|
|
145
|
+
export class TransactionTimeoutError extends NearError {
|
|
146
|
+
constructor(transactionHash) {
|
|
147
|
+
super(`Transaction timed out: ${transactionHash}`, "TRANSACTION_TIMEOUT");
|
|
148
|
+
this.name = "TransactionTimeoutError";
|
|
149
|
+
this.transactionHash = transactionHash;
|
|
150
|
+
Object.setPrototypeOf(this, TransactionTimeoutError.prototype);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Thrown when wallet operations fail
|
|
155
|
+
*/
|
|
156
|
+
export class WalletError extends NearError {
|
|
157
|
+
constructor(message) {
|
|
158
|
+
super(message, "WALLET_ERROR");
|
|
159
|
+
this.name = "WalletError";
|
|
160
|
+
Object.setPrototypeOf(this, WalletError.prototype);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Thrown when a requested block cannot be found
|
|
165
|
+
* Suggests using an archival node for old blocks
|
|
166
|
+
*/
|
|
167
|
+
export class UnknownBlockError extends NearError {
|
|
168
|
+
constructor(blockReference) {
|
|
169
|
+
super(`Block not found: ${blockReference}. It may have been garbage-collected. Try an archival node for blocks older than 5 epochs.`, "UNKNOWN_BLOCK");
|
|
170
|
+
this.name = "UnknownBlockError";
|
|
171
|
+
this.blockReference = blockReference;
|
|
172
|
+
Object.setPrototypeOf(this, UnknownBlockError.prototype);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Thrown when account ID format is invalid
|
|
177
|
+
*/
|
|
178
|
+
export class InvalidAccountError extends NearError {
|
|
179
|
+
constructor(accountId) {
|
|
180
|
+
super(`Invalid account ID format: ${accountId}`, "INVALID_ACCOUNT");
|
|
181
|
+
this.name = "InvalidAccountError";
|
|
182
|
+
this.accountId = accountId;
|
|
183
|
+
Object.setPrototypeOf(this, InvalidAccountError.prototype);
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Thrown when the requested shard is not available on this node
|
|
188
|
+
*/
|
|
189
|
+
export class ShardUnavailableError extends NearError {
|
|
190
|
+
constructor(message) {
|
|
191
|
+
super(message ||
|
|
192
|
+
"The requested shard is not tracked by this node. Try a different node.", "UNAVAILABLE_SHARD");
|
|
193
|
+
this.retryable = true;
|
|
194
|
+
this.name = "ShardUnavailableError";
|
|
195
|
+
Object.setPrototypeOf(this, ShardUnavailableError.prototype);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Thrown when the node is still syncing
|
|
200
|
+
*/
|
|
201
|
+
export class NodeNotSyncedError extends NearError {
|
|
202
|
+
constructor(message) {
|
|
203
|
+
super(message ||
|
|
204
|
+
"Node is still syncing. Wait for sync to complete or try a different node.", "NOT_SYNCED");
|
|
205
|
+
this.retryable = true;
|
|
206
|
+
this.name = "NodeNotSyncedError";
|
|
207
|
+
Object.setPrototypeOf(this, NodeNotSyncedError.prototype);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Thrown when an account has no contract deployed
|
|
212
|
+
*/
|
|
213
|
+
export class ContractNotDeployedError extends NearError {
|
|
214
|
+
constructor(accountId) {
|
|
215
|
+
super(`No contract deployed on account: ${accountId}`, "NO_CONTRACT_CODE");
|
|
216
|
+
this.name = "ContractNotDeployedError";
|
|
217
|
+
this.accountId = accountId;
|
|
218
|
+
Object.setPrototypeOf(this, ContractNotDeployedError.prototype);
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Thrown when contract state is too large to return
|
|
223
|
+
*/
|
|
224
|
+
export class ContractStateTooLargeError extends NearError {
|
|
225
|
+
constructor(accountId) {
|
|
226
|
+
super(`Contract state too large (>50kb) for account ${accountId}. Try a node with larger limits.`, "TOO_LARGE_CONTRACT_STATE");
|
|
227
|
+
this.name = "ContractStateTooLargeError";
|
|
228
|
+
this.accountId = accountId;
|
|
229
|
+
Object.setPrototypeOf(this, ContractStateTooLargeError.prototype);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
/**
|
|
233
|
+
* Thrown when a view function call execution fails
|
|
234
|
+
*/
|
|
235
|
+
export class ContractExecutionError extends NearError {
|
|
236
|
+
constructor(contractId, methodName, details) {
|
|
237
|
+
const message = methodName
|
|
238
|
+
? `Contract execution failed: ${contractId}.${methodName}`
|
|
239
|
+
: `Contract execution failed: ${contractId}`;
|
|
240
|
+
super(message, "CONTRACT_EXECUTION_ERROR", details);
|
|
241
|
+
this.name = "ContractExecutionError";
|
|
242
|
+
this.contractId = contractId;
|
|
243
|
+
if (methodName !== undefined) {
|
|
244
|
+
this.methodName = methodName;
|
|
245
|
+
}
|
|
246
|
+
if (details !== undefined) {
|
|
247
|
+
this.details = details;
|
|
248
|
+
}
|
|
249
|
+
Object.setPrototypeOf(this, ContractExecutionError.prototype);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Thrown when a chunk cannot be found
|
|
254
|
+
*/
|
|
255
|
+
export class UnknownChunkError extends NearError {
|
|
256
|
+
constructor(chunkReference) {
|
|
257
|
+
super(`Chunk not found: ${chunkReference}. It may have been garbage-collected. Try an archival node.`, "UNKNOWN_CHUNK");
|
|
258
|
+
this.name = "UnknownChunkError";
|
|
259
|
+
this.chunkReference = chunkReference;
|
|
260
|
+
Object.setPrototypeOf(this, UnknownChunkError.prototype);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
/**
|
|
264
|
+
* Thrown when an invalid shard ID is provided
|
|
265
|
+
*/
|
|
266
|
+
export class InvalidShardIdError extends NearError {
|
|
267
|
+
constructor(shardId) {
|
|
268
|
+
super(`Invalid shard ID: ${shardId}. Provide a valid shard ID within the network's range.`, "INVALID_SHARD_ID");
|
|
269
|
+
this.name = "InvalidShardIdError";
|
|
270
|
+
this.shardId = shardId;
|
|
271
|
+
Object.setPrototypeOf(this, InvalidShardIdError.prototype);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Thrown when an epoch cannot be found
|
|
276
|
+
*/
|
|
277
|
+
export class UnknownEpochError extends NearError {
|
|
278
|
+
constructor(blockReference) {
|
|
279
|
+
super(`Epoch not found for block: ${blockReference}. The block may be invalid or too old. Try an archival node.`, "UNKNOWN_EPOCH");
|
|
280
|
+
this.name = "UnknownEpochError";
|
|
281
|
+
this.blockReference = blockReference;
|
|
282
|
+
Object.setPrototypeOf(this, UnknownEpochError.prototype);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Thrown when transaction nonce is invalid
|
|
287
|
+
* This happens when a transaction uses a nonce that has already been used
|
|
288
|
+
*/
|
|
289
|
+
export class InvalidNonceError extends NearError {
|
|
290
|
+
constructor(txNonce, akNonce) {
|
|
291
|
+
super(`Invalid transaction nonce: transaction nonce ${txNonce} must be greater than access key nonce ${akNonce}`, "INVALID_NONCE");
|
|
292
|
+
this.retryable = true; // Can retry with updated nonce
|
|
293
|
+
this.name = "InvalidNonceError";
|
|
294
|
+
this.txNonce = txNonce;
|
|
295
|
+
this.akNonce = akNonce;
|
|
296
|
+
Object.setPrototypeOf(this, InvalidNonceError.prototype);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Thrown when a transaction is invalid
|
|
301
|
+
* Check details for specific reasons like ShardCongested or ShardStuck
|
|
302
|
+
*/
|
|
303
|
+
export class InvalidTransactionError extends NearError {
|
|
304
|
+
constructor(message, details) {
|
|
305
|
+
super(message, "INVALID_TRANSACTION", details);
|
|
306
|
+
this.name = "InvalidTransactionError";
|
|
307
|
+
this.details = details;
|
|
308
|
+
// Check if this is a retryable transaction error
|
|
309
|
+
const detailsObj = details;
|
|
310
|
+
this.shardCongested = !!detailsObj?.ShardCongested;
|
|
311
|
+
this.shardStuck = !!detailsObj?.ShardStuck;
|
|
312
|
+
this.retryable = this.shardCongested || this.shardStuck;
|
|
313
|
+
Object.setPrototypeOf(this, InvalidTransactionError.prototype);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Thrown when a receipt cannot be found
|
|
318
|
+
*/
|
|
319
|
+
export class UnknownReceiptError extends NearError {
|
|
320
|
+
constructor(receiptId) {
|
|
321
|
+
super(`Receipt not found: ${receiptId}. It may not have been observed on this node.`, "UNKNOWN_RECEIPT");
|
|
322
|
+
this.name = "UnknownReceiptError";
|
|
323
|
+
this.receiptId = receiptId;
|
|
324
|
+
Object.setPrototypeOf(this, UnknownReceiptError.prototype);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Thrown when request parameters cannot be parsed
|
|
329
|
+
*/
|
|
330
|
+
export class ParseError extends NearError {
|
|
331
|
+
constructor(message, details) {
|
|
332
|
+
super(`Request validation failed: ${message}. Check that all parameters are valid.`, "PARSE_ERROR", details);
|
|
333
|
+
this.name = "ParseError";
|
|
334
|
+
Object.setPrototypeOf(this, ParseError.prototype);
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Thrown when a request times out (408)
|
|
339
|
+
* This is always retryable - resubmit the identical transaction
|
|
340
|
+
*/
|
|
341
|
+
export class TimeoutError extends NearError {
|
|
342
|
+
constructor(message, transactionHash) {
|
|
343
|
+
super(message ||
|
|
344
|
+
"Request timed out. The transaction may still be processed. Resubmit the identical transaction.", "TIMEOUT_ERROR");
|
|
345
|
+
this.retryable = true;
|
|
346
|
+
this.name = "TimeoutError";
|
|
347
|
+
if (transactionHash !== undefined) {
|
|
348
|
+
this.transactionHash = transactionHash;
|
|
349
|
+
}
|
|
350
|
+
Object.setPrototypeOf(this, TimeoutError.prototype);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Thrown when the RPC server encounters an internal error (500)
|
|
355
|
+
* This is always retryable
|
|
356
|
+
*/
|
|
357
|
+
export class InternalServerError extends NearError {
|
|
358
|
+
constructor(message, details) {
|
|
359
|
+
super(message ||
|
|
360
|
+
"Internal server error. The node may be overloaded. Try again or use a different node.", "INTERNAL_ERROR", details);
|
|
361
|
+
this.retryable = true;
|
|
362
|
+
this.name = "InternalServerError";
|
|
363
|
+
Object.setPrototypeOf(this, InternalServerError.prototype);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/errors/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAIlC,YAAY,OAAe,EAAE,IAAY,EAAE,IAAc;QACvD,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,WAAW,CAAA;QACvB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAC,SAAS,CAAC,CAAA;IAClD,CAAC;CACF;AAED;;GAEG;AACH,MAAM,OAAO,wBAAyB,SAAQ,SAAS;IAIrD,YAAY,QAAgB,EAAE,SAAiB;QAC7C,KAAK,CACH,kCAAkC,QAAQ,oBAAoB,SAAS,OAAO,EAC9E,sBAAsB,CACvB,CAAA;QACD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAA;QACtC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,MAAM,CAAC,cAAc,CA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uitive TypeScript library for interacting with NEAR Protocol
|
|
3
|
+
*/
|
|
4
|
+
export type { Contract, ContractMethods } from "./contracts/contract.js";
|
|
5
|
+
export { DelegateAction, SignedDelegate, } from "./core/actions.js";
|
|
6
|
+
export { Near } from "./core/near.js";
|
|
7
|
+
export { DELEGATE_ACTION_PREFIX, type SignedDelegateAction, serializeDelegateAction, serializeSignedDelegate, } from "./core/schema.js";
|
|
8
|
+
export { TransactionBuilder } from "./core/transaction.js";
|
|
9
|
+
export type { CallOptions, FinalExecutionOutcome, KeyConfig, KeyPair, KeyStore, NearConfig, NetworkConfig, PublicKey, SendOptions, Signature, SignedMessage, SignMessageParams, TxExecutionStatus, WalletAccount, WalletConnection, WalletSignInOptions, } from "./core/types.js";
|
|
10
|
+
export { AccessKeyDoesNotExistError, AccountDoesNotExistError, FunctionCallError, GasLimitExceededError, InsufficientBalanceError, InvalidAccountIdError, InvalidKeyError, NearError, NetworkError, SignatureError, TransactionTimeoutError, WalletError, } from "./errors/index.js";
|
|
11
|
+
export type { LegacyCredential, NearCliCredential, Network, } from "./keys/index.js";
|
|
12
|
+
export { InMemoryKeyStore, RotatingKeyStore, } from "./keys/index.js";
|
|
13
|
+
export type { SandboxOptions } from "./sandbox/index.js";
|
|
14
|
+
export { Amount, formatAmount, formatGas, Gas, generateKey, generateNep413Nonce, generateSeedPhrase, isPrivateKey, isValidAccountId, isValidPublicKey, type PrivateKey, parseAmount, parseGas, parseKey, parseSeedPhrase, validatePrivateKey, verifyNep413Signature, } from "./utils/index.js";
|
|
15
|
+
export { fromHotConnect, fromWalletSelector } from "./wallets/index.js";
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,YAAY,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAExE,OAAO,EACL,cAAc,EACd,c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
|
+
/**
|
|
2
|
+
* near-kit - A simple, intuitive TypeScript library for interacting with NEAR Protocol
|
|
3
|
+
*/
|
|
4
|
+
// Delegate actions
|
|
5
|
+
export { DelegateAction, SignedDelegate, } from "./core/actions.js";
|
|
6
|
+
// Main class
|
|
7
|
+
export { Near } from "./core/near.js";
|
|
8
|
+
export { DELEGATE_ACTION_PREFIX, serializeDelegateAction, serializeSignedDelegate, } from "./core/schema.js";
|
|
9
|
+
export { TransactionBuilder } from "./core/transaction.js";
|
|
10
|
+
// Errors
|
|
11
|
+
export { AccessKeyDoesNotExistError, AccountDoesNotExistError, FunctionCallError, GasLimitExceededError, InsufficientBalanceError, InvalidAccountIdError, InvalidKeyError, NearError, NetworkError, SignatureError, TransactionTimeoutError, WalletError, } from "./errors/index.js";
|
|
12
|
+
// Key stores
|
|
13
|
+
export { InMemoryKeyStore, RotatingKeyStore,
|
|
14
|
+
// Node.js-only keystores not exported by default (browser environments don't support them)
|
|
15
|
+
// For Node.js/Bun:
|
|
16
|
+
// import { FileKeyStore } from "near-kit/keys/file"
|
|
17
|
+
// import { NativeKeyStore } from "near-kit/keys/native"
|
|
18
|
+
} from "./keys/index.js";
|
|
19
|
+
// Utilities
|
|
20
|
+
export { Amount, formatAmount, formatGas, Gas, generateKey, generateNep413Nonce, generateSeedPhrase, isPrivateKey, isValidAccountId, isValidPublicKey, parseAmount, parseGas, parseKey, parseSeedPhrase, validatePrivateKey, verifyNep413Signature, } from "./utils/index.js";
|
|
21
|
+
// Wallet adapters
|
|
22
|
+
export { fromHotConnect, fromWalletSelector } from "./wallets/index.js";
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,mBAAmB;AACnB,OAAO,EACL,cAAc,EACd,cAAc,GACf,MAAM,mBAAmB,CAAA;AAC1B,aAAa;AACb,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AACrC,OAAO,EACL,sBAAsB,EAEtB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAoB1D,SAAS;AACT,OAAO,EACL,0BAA0B,EAC1B,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,qBAAqB,EACrB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,uBAAuB,EACvB,WAAW,GACZ,MAAM,mBAAmB,CAAA;AAO1B,aAAa;AACb,OAAO,EACL,gBAAgB,EAChB,gBAAgB;AAChB,2FAA2F;AAC3F,mBAAmB;AACnB,sDAAsD;AACtD,0DAA0D;EAC3D,MAAM,iBAAiB,CAAA;AAIxB,YAAY;AACZ,OAAO,EACL,MAAM,EACN,YAAY,EACZ,SAAS,EACT,GAAG,EACH,WAAW,EACX,mBAAmB,EACnB,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,gBAAgB,EAEhB,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,eAAe,EACf,kBAAkB,EAClB,qBAAqB,GACtB,MAAM,kBAAkB,CAAA;AACzB,kBAAkB;AAClB,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for NEAR CLI credential file formats
|
|
3
|
+
*
|
|
4
|
+
* NEAR CLI stores credentials in `~/.near-credentials/` with the following structure:
|
|
5
|
+
*
|
|
6
|
+
* ## Directory Structure
|
|
7
|
+
* ```
|
|
8
|
+
* ~/.near-credentials/
|
|
9
|
+
* ├── mainnet/
|
|
10
|
+
* │ ├── account.near.json # Single key per account
|
|
11
|
+
* │ └── account.near/ # Multiple keys per account
|
|
12
|
+
* │ └── ed25519_PublicKeyBase58.json
|
|
13
|
+
* ├── testnet/
|
|
14
|
+
* │ └── account.testnet.json
|
|
15
|
+
* └── implicit/
|
|
16
|
+
* └── accountId.json
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ## File Format
|
|
20
|
+
* Each credential file contains:
|
|
21
|
+
* - `account_id` (optional): Named account ID
|
|
22
|
+
* - `public_key`: Public key in format "ed25519:Base58EncodedKey"
|
|
23
|
+
* - `private_key`: Private key in format "ed25519:Base58EncodedKey"
|
|
24
|
+
* - `seed_phrase_hd_path` (optional): BIP32 derivation path (e.g., "m/44'/397'/0'")
|
|
25
|
+
* - `master_seed_phrase` (optional): BIP39 seed phrase
|
|
26
|
+
* - `implicit_account_id` (optional): Implicit account ID (hex of public key)
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/near/near-cli
|
|
29
|
+
*/
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
/**
|
|
32
|
+
* Schema for NEAR CLI credential file
|
|
33
|
+
*
|
|
34
|
+
* This matches the format used by near-cli and near-cli-rs for storing
|
|
35
|
+
* account credentials on the filesystem.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```json
|
|
39
|
+
* {
|
|
40
|
+
* "account_id": "example.testnet",
|
|
41
|
+
* "public_key": "ed25519:8nFkHgRePSGD9UsK3Hx6234567890abcdefghijklmnop",
|
|
42
|
+
* "private_key": "ed25519:3D4c2v8K5x...",
|
|
43
|
+
* "seed_phrase_hd_path": "m/44'/397'/0'",
|
|
44
|
+
* "master_seed_phrase": "word1 word2 word3 ...",
|
|
45
|
+
* "implicit_account_id": "1234567890abcdef..."
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export declare const NearCliCredentialSchema: z.ZodObject<{
|
|
50
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
51
|
+
public_key: z.ZodString;
|
|
52
|
+
private_key: z.ZodString;
|
|
53
|
+
seed_phrase_hd_path: z.ZodOptional<z.ZodString>;
|
|
54
|
+
master_seed_phrase: z.ZodOptional<z.ZodString>;
|
|
55
|
+
implicit_account_id: z.ZodOptional<z.ZodString>;
|
|
56
|
+
}, z.core.$strip>;
|
|
57
|
+
/**
|
|
58
|
+
* TypeScript type for NEAR CLI credential
|
|
59
|
+
*/
|
|
60
|
+
export type NearCliCredential = z.infer<typeof NearCliCredentialSchema>;
|
|
61
|
+
/**
|
|
62
|
+
* Legacy format used by some tools (uses "secret_key" instead of "private_key")
|
|
63
|
+
* This is supported for reading only, not writing
|
|
64
|
+
*/
|
|
65
|
+
export declare const LegacyCredentialSchema: z.ZodObject<{
|
|
66
|
+
account_id: z.ZodOptional<z.ZodString>;
|
|
67
|
+
public_key: z.ZodString;
|
|
68
|
+
secret_key: z.ZodString;
|
|
69
|
+
seed_phrase_hd_path: z.ZodOptional<z.ZodString>;
|
|
70
|
+
master_seed_phrase: z.ZodOptional<z.ZodString>;
|
|
71
|
+
implicit_account_id: z.ZodOptional<z.ZodString>;
|
|
72
|
+
}, z.core.$strip>;
|
|
73
|
+
/**
|
|
74
|
+
* TypeScript type for legacy credential format
|
|
75
|
+
*/
|
|
76
|
+
export type LegacyCredential = z.infer<typeof LegacyCredentialSchema>;
|
|
77
|
+
/**
|
|
78
|
+
* Network identifiers supported by NEAR
|
|
79
|
+
*/
|
|
80
|
+
export declare const NetworkSchema: z.ZodEnum<{
|
|
81
|
+
mainnet: "mainnet";
|
|
82
|
+
testnet: "testnet";
|
|
83
|
+
localnet: "localnet";
|
|
84
|
+
betanet: "betanet";
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* TypeScript type for network identifier
|
|
88
|
+
*/
|
|
89
|
+
export type Network = z.infer<typeof NetworkSchema>;
|
|
90
|
+
/**
|
|
91
|
+
* Parse a credential file, supporting both modern and legacy formats
|
|
92
|
+
*
|
|
93
|
+
* @param data - Raw JSON data from credential file
|
|
94
|
+
* @returns Parsed credential with normalized field names
|
|
95
|
+
* @throws {z.ZodError} If the data doesn't match any supported format
|
|
96
|
+
*/
|
|
97
|
+
export declare function parseCredentialFile(data: unknown): NearCliCredential;
|
|
98
|
+
//# sourceMappingURL=credential-schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-schemas.d.ts","sourceRoot":"","sources":["../../src/keys/credential-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,uBAAuB;;;;;;;iBAoClC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAA;AAEvE;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;iBAOjC,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE;;GAEG;AACH,eAAO,MAAM,aAAa;;;;;EAKxB,CAAA;AAEF;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AAEnD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,GAAG,iBAAiB,CAoBpE"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod schemas for NEAR CLI credential file formats
|
|
3
|
+
*
|
|
4
|
+
* NEAR CLI stores credentials in `~/.near-credentials/` with the following structure:
|
|
5
|
+
*
|
|
6
|
+
* ## Directory Structure
|
|
7
|
+
* ```
|
|
8
|
+
* ~/.near-credentials/
|
|
9
|
+
* ├── mainnet/
|
|
10
|
+
* │ ├── account.near.json # Single key per account
|
|
11
|
+
* │ └── account.near/ # Multiple keys per account
|
|
12
|
+
* │ └── ed25519_PublicKeyBase58.json
|
|
13
|
+
* ├── testnet/
|
|
14
|
+
* │ └── account.testnet.json
|
|
15
|
+
* └── implicit/
|
|
16
|
+
* └── accountId.json
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* ## File Format
|
|
20
|
+
* Each credential file contains:
|
|
21
|
+
* - `account_id` (optional): Named account ID
|
|
22
|
+
* - `public_key`: Public key in format "ed25519:Base58EncodedKey"
|
|
23
|
+
* - `private_key`: Private key in format "ed25519:Base58EncodedKey"
|
|
24
|
+
* - `seed_phrase_hd_path` (optional): BIP32 derivation path (e.g., "m/44'/397'/0'")
|
|
25
|
+
* - `master_seed_phrase` (optional): BIP39 seed phrase
|
|
26
|
+
* - `implicit_account_id` (optional): Implicit account ID (hex of public key)
|
|
27
|
+
*
|
|
28
|
+
* @see https://github.com/near/near-cli
|
|
29
|
+
*/
|
|
30
|
+
import { z } from "zod";
|
|
31
|
+
/**
|
|
32
|
+
* Schema for NEAR CLI credential file
|
|
33
|
+
*
|
|
34
|
+
* This matches the format used by near-cli and near-cli-rs for storing
|
|
35
|
+
* account credentials on the filesystem.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```json
|
|
39
|
+
* {
|
|
40
|
+
* "account_id": "example.testnet",
|
|
41
|
+
* "public_key": "ed25519:8nFkHgRePSGD9UsK3Hx6234567890abcdefghijklmnop",
|
|
42
|
+
* "private_key": "ed25519:3D4c2v8K5x...",
|
|
43
|
+
* "seed_phrase_hd_path": "m/44'/397'/0'",
|
|
44
|
+
* "master_seed_phrase": "word1 word2 word3 ...",
|
|
45
|
+
* "implicit_account_id": "1234567890abcdef..."
|
|
46
|
+
* }
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
export const NearCliCredentialSchema = z.object({
|
|
50
|
+
/**
|
|
51
|
+
* Named account ID (optional)
|
|
52
|
+
* @example "example.testnet"
|
|
53
|
+
*/
|
|
54
|
+
account_id: z.string().optional(),
|
|
55
|
+
/**
|
|
56
|
+
* Public key in NEAR format
|
|
57
|
+
* @example "ed25519:8nFkHgRePSGD9UsK3Hx6nWKXGQ7Kd7k3k7k3k7k3k7k3"
|
|
58
|
+
*/
|
|
59
|
+
public_key: z.string(),
|
|
60
|
+
/**
|
|
61
|
+
* Private key in NEAR format (note: uses "private_key", not "secret_key")
|
|
62
|
+
* @example "ed25519:3D4c2v8K5x..."
|
|
63
|
+
*/
|
|
64
|
+
private_key: z.string(),
|
|
65
|
+
/**
|
|
66
|
+
* BIP32 derivation path (optional)
|
|
67
|
+
* @example "m/44'/397'/0'"
|
|
68
|
+
*/
|
|
69
|
+
seed_phrase_hd_path: z.string().optional(),
|
|
70
|
+
/**
|
|
71
|
+
* BIP39 seed phrase (optional)
|
|
72
|
+
* @example "witch collapse practice feed shame open despair creek road again ice least"
|
|
73
|
+
*/
|
|
74
|
+
master_seed_phrase: z.string().optional(),
|
|
75
|
+
/**
|
|
76
|
+
* Implicit account ID (optional) - hex representation of the public key
|
|
77
|
+
* @example "e3cb032dbb6e8f45239c79652ba94172378f940d340b429ce5076d1a2f7366e2"
|
|
78
|
+
*/
|
|
79
|
+
implicit_account_id: z.string().optional(),
|
|
80
|
+
});
|
|
81
|
+
/**
|
|
82
|
+
* Legacy format used by some tools (uses "secret_key" instead of "private_key")
|
|
83
|
+
* This is supported for reading only, not writing
|
|
84
|
+
*/
|
|
85
|
+
export const LegacyCredentialSchema = z.object({
|
|
86
|
+
account_id: z.string().optional(),
|
|
87
|
+
public_key: z.string(),
|
|
88
|
+
secret_key: z.string(), // Legacy field name
|
|
89
|
+
seed_phrase_hd_path: z.string().optional(),
|
|
90
|
+
master_seed_phrase: z.string().optional(),
|
|
91
|
+
implicit_account_id: z.string().optional(),
|
|
92
|
+
});
|
|
93
|
+
/**
|
|
94
|
+
* Network identifiers supported by NEAR
|
|
95
|
+
*/
|
|
96
|
+
export const NetworkSchema = z.enum([
|
|
97
|
+
"mainnet",
|
|
98
|
+
"testnet",
|
|
99
|
+
"betanet",
|
|
100
|
+
"localnet",
|
|
101
|
+
]);
|
|
102
|
+
/**
|
|
103
|
+
* Parse a credential file, supporting both modern and legacy formats
|
|
104
|
+
*
|
|
105
|
+
* @param data - Raw JSON data from credential file
|
|
106
|
+
* @returns Parsed credential with normalized field names
|
|
107
|
+
* @throws {z.ZodError} If the data doesn't match any supported format
|
|
108
|
+
*/
|
|
109
|
+
export function parseCredentialFile(data) {
|
|
110
|
+
// Try modern format first
|
|
111
|
+
const modernResult = NearCliCredentialSchema.safeParse(data);
|
|
112
|
+
if (modernResult.success) {
|
|
113
|
+
return modernResult.data;
|
|
114
|
+
}
|
|
115
|
+
// Try legacy format
|
|
116
|
+
const legacyResult = LegacyCredentialSchema.safeParse(data);
|
|
117
|
+
if (legacyResult.success) {
|
|
118
|
+
// Convert legacy format to modern format
|
|
119
|
+
const { secret_key, ...rest } = legacyResult.data;
|
|
120
|
+
return {
|
|
121
|
+
...rest,
|
|
122
|
+
private_key: secret_key,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// Neither format matched, throw the modern format error
|
|
126
|
+
throw modernResult.error;
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=credential-schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-schemas.js","sourceRoot":"","sources":["../../src/keys/credential-schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAEjC;;;OAGG;IACH,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IAEtB;;;OAGG;IACH,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IAEvB;;;OAGG;IACH,mBAAmB,EAAE,CA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