near-api-ts 0.2.0 → 0.2.2

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/dist/index.js CHANGED
@@ -19,7 +19,7 @@ var createSendRequest = (clientContext) => async ({ body }) => {
19
19
  };
20
20
 
21
21
  // src/client/createClient/account/getAccountState.ts
22
- import * as z2 from "zod/mini";
22
+ import * as z from "zod/mini";
23
23
 
24
24
  // src/_common/transformers/toNative/blockReference.ts
25
25
  var toNativeBlockReference = (blockReference, defaultBlockReference) => {
@@ -40,1388 +40,8 @@ var toNativeBlockReference = (blockReference, defaultBlockReference) => {
40
40
  return { finality: "near-final" };
41
41
  };
42
42
 
43
- // ../../node_modules/.pnpm/@near-js+jsonrpc-types@1.3.4/node_modules/@near-js/jsonrpc-types/dist/index.mjs
44
- import { z } from "zod/mini";
45
- var AccessKeySchema = () => z.object({
46
- nonce: z.number(),
47
- permission: z.lazy(() => AccessKeyPermissionSchema())
48
- });
49
- var AccessKeyCreationConfigViewSchema = () => z.object({
50
- fullAccessCost: z.lazy(() => FeeSchema()),
51
- functionCallCost: z.lazy(() => FeeSchema()),
52
- functionCallCostPerByte: z.lazy(() => FeeSchema())
53
- });
54
- var AccessKeyInfoViewSchema = () => z.object({
55
- accessKey: z.lazy(() => AccessKeyViewSchema()),
56
- publicKey: z.lazy(() => PublicKeySchema())
57
- });
58
- var AccessKeyListSchema = () => z.object({
59
- keys: z.array(z.lazy(() => AccessKeyInfoViewSchema()))
60
- });
61
- var AccessKeyPermissionSchema = () => z.union([
62
- z.object({
63
- FunctionCall: z.lazy(() => FunctionCallPermissionSchema())
64
- }),
65
- z.enum(["FullAccess"])
66
- ]);
67
- var AccessKeyPermissionViewSchema = () => z.union([
68
- z.enum(["FullAccess"]),
69
- z.object({
70
- FunctionCall: z.object({
71
- allowance: z.optional(
72
- z.union([z.union([z.string(), z.null()]), z.null()])
73
- ),
74
- methodNames: z.array(z.string()),
75
- receiverId: z.string()
76
- })
77
- })
78
- ]);
79
- var AccessKeyViewSchema = () => z.object({
80
- nonce: z.number(),
81
- permission: z.lazy(() => AccessKeyPermissionViewSchema())
82
- });
83
- var AccountCreationConfigViewSchema = () => z.object({
84
- minAllowedTopLevelAccountLength: z.number(),
85
- registrarAccountId: z.lazy(() => AccountIdSchema())
86
- });
87
- var AccountIdSchema = () => z.string();
88
- var AccountIdValidityRulesVersionSchema = () => z.number();
89
- var AccountViewSchema = () => z.object({
90
- amount: z.string(),
91
- codeHash: z.lazy(() => CryptoHashSchema()),
92
- globalContractAccountId: z.optional(
93
- z.union([z.lazy(() => AccountIdSchema()), z.null()])
94
- ),
95
- globalContractHash: z.optional(
96
- z.union([z.lazy(() => CryptoHashSchema()), z.null()])
97
- ),
98
- locked: z.string(),
99
- storagePaidAt: z.optional(z.number()),
100
- storageUsage: z.number()
101
- });
102
- var ActionCreationConfigViewSchema = () => z.object({
103
- addKeyCost: z.lazy(() => AccessKeyCreationConfigViewSchema()),
104
- createAccountCost: z.lazy(() => FeeSchema()),
105
- delegateCost: z.lazy(() => FeeSchema()),
106
- deleteAccountCost: z.lazy(() => FeeSchema()),
107
- deleteKeyCost: z.lazy(() => FeeSchema()),
108
- deployContractCost: z.lazy(() => FeeSchema()),
109
- deployContractCostPerByte: z.lazy(() => FeeSchema()),
110
- functionCallCost: z.lazy(() => FeeSchema()),
111
- functionCallCostPerByte: z.lazy(() => FeeSchema()),
112
- stakeCost: z.lazy(() => FeeSchema()),
113
- transferCost: z.lazy(() => FeeSchema())
114
- });
115
- var ActionErrorSchema = () => z.object({
116
- index: z.optional(z.union([z.union([z.number(), z.null()]), z.null()])),
117
- kind: z.lazy(() => ActionErrorKindSchema())
118
- });
119
- var ActionErrorKindSchema = () => z.union([
120
- z.object({
121
- AccountAlreadyExists: z.object({
122
- accountId: z.lazy(() => AccountIdSchema())
123
- })
124
- }),
125
- z.object({
126
- AccountDoesNotExist: z.object({
127
- accountId: z.lazy(() => AccountIdSchema())
128
- })
129
- }),
130
- z.object({
131
- CreateAccountOnlyByRegistrar: z.object({
132
- accountId: z.lazy(() => AccountIdSchema()),
133
- predecessorId: z.lazy(() => AccountIdSchema()),
134
- registrarAccountId: z.lazy(() => AccountIdSchema())
135
- })
136
- }),
137
- z.object({
138
- CreateAccountNotAllowed: z.object({
139
- accountId: z.lazy(() => AccountIdSchema()),
140
- predecessorId: z.lazy(() => AccountIdSchema())
141
- })
142
- }),
143
- z.object({
144
- ActorNoPermission: z.object({
145
- accountId: z.lazy(() => AccountIdSchema()),
146
- actorId: z.lazy(() => AccountIdSchema())
147
- })
148
- }),
149
- z.object({
150
- DeleteKeyDoesNotExist: z.object({
151
- accountId: z.lazy(() => AccountIdSchema()),
152
- publicKey: z.lazy(() => PublicKeySchema())
153
- })
154
- }),
155
- z.object({
156
- AddKeyAlreadyExists: z.object({
157
- accountId: z.lazy(() => AccountIdSchema()),
158
- publicKey: z.lazy(() => PublicKeySchema())
159
- })
160
- }),
161
- z.object({
162
- DeleteAccountStaking: z.object({
163
- accountId: z.lazy(() => AccountIdSchema())
164
- })
165
- }),
166
- z.object({
167
- LackBalanceForState: z.object({
168
- accountId: z.lazy(() => AccountIdSchema()),
169
- amount: z.string()
170
- })
171
- }),
172
- z.object({
173
- TriesToUnstake: z.object({
174
- accountId: z.lazy(() => AccountIdSchema())
175
- })
176
- }),
177
- z.object({
178
- TriesToStake: z.object({
179
- accountId: z.lazy(() => AccountIdSchema()),
180
- balance: z.string(),
181
- locked: z.string(),
182
- stake: z.string()
183
- })
184
- }),
185
- z.object({
186
- InsufficientStake: z.object({
187
- accountId: z.lazy(() => AccountIdSchema()),
188
- minimumStake: z.string(),
189
- stake: z.string()
190
- })
191
- }),
192
- z.object({
193
- FunctionCallError: z.lazy(() => FunctionCallErrorSchema())
194
- }),
195
- z.object({
196
- NewReceiptValidationError: z.lazy(() => ReceiptValidationErrorSchema())
197
- }),
198
- z.object({
199
- OnlyImplicitAccountCreationAllowed: z.object({
200
- accountId: z.lazy(() => AccountIdSchema())
201
- })
202
- }),
203
- z.object({
204
- DeleteAccountWithLargeState: z.object({
205
- accountId: z.lazy(() => AccountIdSchema())
206
- })
207
- }),
208
- z.enum(["DelegateActionInvalidSignature"]),
209
- z.object({
210
- DelegateActionSenderDoesNotMatchTxReceiver: z.object({
211
- receiverId: z.lazy(() => AccountIdSchema()),
212
- senderId: z.lazy(() => AccountIdSchema())
213
- })
214
- }),
215
- z.enum(["DelegateActionExpired"]),
216
- z.object({
217
- DelegateActionAccessKeyError: z.lazy(() => InvalidAccessKeyErrorSchema())
218
- }),
219
- z.object({
220
- DelegateActionInvalidNonce: z.object({
221
- akNonce: z.number(),
222
- delegateNonce: z.number()
223
- })
224
- }),
225
- z.object({
226
- DelegateActionNonceTooLarge: z.object({
227
- delegateNonce: z.number(),
228
- upperBound: z.number()
229
- })
230
- }),
231
- z.object({
232
- GlobalContractDoesNotExist: z.object({
233
- identifier: z.lazy(() => GlobalContractIdentifierSchema())
234
- })
235
- })
236
- ]);
237
- var ActionViewSchema = () => z.union([
238
- z.enum(["CreateAccount"]),
239
- z.object({
240
- DeployContract: z.object({
241
- code: z.string()
242
- })
243
- }),
244
- z.object({
245
- FunctionCall: z.object({
246
- args: z.lazy(() => FunctionArgsSchema()),
247
- deposit: z.string(),
248
- gas: z.number(),
249
- methodName: z.string()
250
- })
251
- }),
252
- z.object({
253
- Transfer: z.object({
254
- deposit: z.string()
255
- })
256
- }),
257
- z.object({
258
- Stake: z.object({
259
- publicKey: z.lazy(() => PublicKeySchema()),
260
- stake: z.string()
261
- })
262
- }),
263
- z.object({
264
- AddKey: z.object({
265
- accessKey: z.lazy(() => AccessKeyViewSchema()),
266
- publicKey: z.lazy(() => PublicKeySchema())
267
- })
268
- }),
269
- z.object({
270
- DeleteKey: z.object({
271
- publicKey: z.lazy(() => PublicKeySchema())
272
- })
273
- }),
274
- z.object({
275
- DeleteAccount: z.object({
276
- beneficiaryId: z.lazy(() => AccountIdSchema())
277
- })
278
- }),
279
- z.object({
280
- Delegate: z.object({
281
- delegateAction: z.lazy(() => DelegateActionSchema()),
282
- signature: z.lazy(() => SignatureSchema())
283
- })
284
- }),
285
- z.object({
286
- DeployGlobalContract: z.object({
287
- code: z.string()
288
- })
289
- }),
290
- z.object({
291
- DeployGlobalContractByAccountId: z.object({
292
- code: z.string()
293
- })
294
- }),
295
- z.object({
296
- UseGlobalContract: z.object({
297
- codeHash: z.lazy(() => CryptoHashSchema())
298
- })
299
- }),
300
- z.object({
301
- UseGlobalContractByAccountId: z.object({
302
- accountId: z.lazy(() => AccountIdSchema())
303
- })
304
- })
305
- ]);
306
- var ActionsValidationErrorSchema = () => z.union([
307
- z.enum(["DeleteActionMustBeFinal"]),
308
- z.object({
309
- TotalPrepaidGasExceeded: z.object({
310
- limit: z.number(),
311
- totalPrepaidGas: z.number()
312
- })
313
- }),
314
- z.object({
315
- TotalNumberOfActionsExceeded: z.object({
316
- limit: z.number(),
317
- totalNumberOfActions: z.number()
318
- })
319
- }),
320
- z.object({
321
- AddKeyMethodNamesNumberOfBytesExceeded: z.object({
322
- limit: z.number(),
323
- totalNumberOfBytes: z.number()
324
- })
325
- }),
326
- z.object({
327
- AddKeyMethodNameLengthExceeded: z.object({
328
- length: z.number(),
329
- limit: z.number()
330
- })
331
- }),
332
- z.enum(["IntegerOverflow"]),
333
- z.object({
334
- InvalidAccountId: z.object({
335
- accountId: z.string()
336
- })
337
- }),
338
- z.object({
339
- ContractSizeExceeded: z.object({
340
- limit: z.number(),
341
- size: z.number()
342
- })
343
- }),
344
- z.object({
345
- FunctionCallMethodNameLengthExceeded: z.object({
346
- length: z.number(),
347
- limit: z.number()
348
- })
349
- }),
350
- z.object({
351
- FunctionCallArgumentsLengthExceeded: z.object({
352
- length: z.number(),
353
- limit: z.number()
354
- })
355
- }),
356
- z.object({
357
- UnsuitableStakingKey: z.object({
358
- publicKey: z.lazy(() => PublicKeySchema())
359
- })
360
- }),
361
- z.enum(["FunctionCallZeroAttachedGas"]),
362
- z.enum(["DelegateActionMustBeOnlyOne"]),
363
- z.object({
364
- UnsupportedProtocolFeature: z.object({
365
- protocolFeature: z.string(),
366
- version: z.number()
367
- })
368
- })
369
- ]);
370
- var AddKeyActionSchema = () => z.object({
371
- accessKey: z.lazy(() => AccessKeySchema()),
372
- publicKey: z.lazy(() => PublicKeySchema())
373
- });
374
- var BandwidthRequestSchema = () => z.object({
375
- requestedValuesBitmap: z.lazy(() => BandwidthRequestBitmapSchema()),
376
- toShard: z.number()
377
- });
378
- var BandwidthRequestBitmapSchema = () => z.object({
379
- data: z.array(z.number())
380
- });
381
- var BandwidthRequestsSchema = () => z.object({
382
- V1: z.lazy(() => BandwidthRequestsV1Schema())
383
- });
384
- var BandwidthRequestsV1Schema = () => z.object({
385
- requests: z.array(z.lazy(() => BandwidthRequestSchema()))
386
- });
387
- var BlockHeaderViewSchema = () => z.object({
388
- approvals: z.array(z.union([z.lazy(() => SignatureSchema()), z.null()])),
389
- blockBodyHash: z.optional(
390
- z.union([z.lazy(() => CryptoHashSchema()), z.null()])
391
- ),
392
- blockMerkleRoot: z.lazy(() => CryptoHashSchema()),
393
- blockOrdinal: z.optional(
394
- z.union([z.union([z.number(), z.null()]), z.null()])
395
- ),
396
- challengesResult: z.array(z.lazy(() => SlashedValidatorSchema())),
397
- challengesRoot: z.lazy(() => CryptoHashSchema()),
398
- chunkEndorsements: z.optional(
399
- z.union([z.union([z.array(z.array(z.number())), z.null()]), z.null()])
400
- ),
401
- chunkHeadersRoot: z.lazy(() => CryptoHashSchema()),
402
- chunkMask: z.array(z.boolean()),
403
- chunkReceiptsRoot: z.lazy(() => CryptoHashSchema()),
404
- chunkTxRoot: z.lazy(() => CryptoHashSchema()),
405
- chunksIncluded: z.number(),
406
- epochId: z.lazy(() => CryptoHashSchema()),
407
- epochSyncDataHash: z.optional(
408
- z.union([z.lazy(() => CryptoHashSchema()), z.null()])
409
- ),
410
- gasPrice: z.string(),
411
- hash: z.lazy(() => CryptoHashSchema()),
412
- height: z.number(),
413
- lastDsFinalBlock: z.lazy(() => CryptoHashSchema()),
414
- lastFinalBlock: z.lazy(() => CryptoHashSchema()),
415
- latestProtocolVersion: z.number(),
416
- nextBpHash: z.lazy(() => CryptoHashSchema()),
417
- nextEpochId: z.lazy(() => CryptoHashSchema()),
418
- outcomeRoot: z.lazy(() => CryptoHashSchema()),
419
- prevHash: z.lazy(() => CryptoHashSchema()),
420
- prevHeight: z.optional(
421
- z.union([z.union([z.number(), z.null()]), z.null()])
422
- ),
423
- prevStateRoot: z.lazy(() => CryptoHashSchema()),
424
- randomValue: z.lazy(() => CryptoHashSchema()),
425
- rentPaid: z.string(),
426
- signature: z.lazy(() => SignatureSchema()),
427
- timestamp: z.number(),
428
- timestampNanosec: z.string(),
429
- totalSupply: z.string(),
430
- validatorProposals: z.array(z.lazy(() => ValidatorStakeViewSchema())),
431
- validatorReward: z.string()
432
- });
433
- var CallResultSchema = () => z.object({
434
- logs: z.array(z.string()),
435
- result: z.array(z.number())
436
- });
437
- var ChunkHeaderViewSchema = () => z.object({
438
- balanceBurnt: z.string(),
439
- bandwidthRequests: z.optional(
440
- z.union([z.lazy(() => BandwidthRequestsSchema()), z.null()])
441
- ),
442
- chunkHash: z.lazy(() => CryptoHashSchema()),
443
- congestionInfo: z.optional(
444
- z.union([z.lazy(() => CongestionInfoViewSchema()), z.null()])
445
- ),
446
- encodedLength: z.number(),
447
- encodedMerkleRoot: z.lazy(() => CryptoHashSchema()),
448
- gasLimit: z.number(),
449
- gasUsed: z.number(),
450
- heightCreated: z.number(),
451
- heightIncluded: z.number(),
452
- outcomeRoot: z.lazy(() => CryptoHashSchema()),
453
- outgoingReceiptsRoot: z.lazy(() => CryptoHashSchema()),
454
- prevBlockHash: z.lazy(() => CryptoHashSchema()),
455
- prevStateRoot: z.lazy(() => CryptoHashSchema()),
456
- rentPaid: z.string(),
457
- shardId: z.lazy(() => ShardIdSchema()),
458
- signature: z.lazy(() => SignatureSchema()),
459
- txRoot: z.lazy(() => CryptoHashSchema()),
460
- validatorProposals: z.array(z.lazy(() => ValidatorStakeViewSchema())),
461
- validatorReward: z.string()
462
- });
463
- var CompilationErrorSchema = () => z.union([
464
- z.object({
465
- CodeDoesNotExist: z.object({
466
- accountId: z.lazy(() => AccountIdSchema())
467
- })
468
- }),
469
- z.object({
470
- PrepareError: z.lazy(() => PrepareErrorSchema())
471
- }),
472
- z.object({
473
- WasmerCompileError: z.object({
474
- msg: z.string()
475
- })
476
- })
477
- ]);
478
- var CongestionControlConfigViewSchema = () => z.object({
479
- allowedShardOutgoingGas: z.number(),
480
- maxCongestionIncomingGas: z.number(),
481
- maxCongestionMemoryConsumption: z.number(),
482
- maxCongestionMissedChunks: z.number(),
483
- maxCongestionOutgoingGas: z.number(),
484
- maxOutgoingGas: z.number(),
485
- maxTxGas: z.number(),
486
- minOutgoingGas: z.number(),
487
- minTxGas: z.number(),
488
- outgoingReceiptsBigSizeLimit: z.number(),
489
- outgoingReceiptsUsualSizeLimit: z.number(),
490
- rejectTxCongestionThreshold: z.number()
491
- });
492
- var CongestionInfoViewSchema = () => z.object({
493
- allowedShard: z.number(),
494
- bufferedReceiptsGas: z.string(),
495
- delayedReceiptsGas: z.string(),
496
- receiptBytes: z.number()
497
- });
498
- var CostGasUsedSchema = () => z.object({
499
- cost: z.string(),
500
- costCategory: z.string(),
501
- gasUsed: z.string()
502
- });
503
- var CreateAccountActionSchema = () => z.record(z.string(), z.unknown());
504
- var CryptoHashSchema = () => z.string();
505
- var DataReceiptCreationConfigViewSchema = () => z.object({
506
- baseCost: z.lazy(() => FeeSchema()),
507
- costPerByte: z.lazy(() => FeeSchema())
508
- });
509
- var DataReceiverViewSchema = () => z.object({
510
- dataId: z.lazy(() => CryptoHashSchema()),
511
- receiverId: z.lazy(() => AccountIdSchema())
512
- });
513
- var DelegateActionSchema = () => z.object({
514
- actions: z.array(z.lazy(() => NonDelegateActionSchema())),
515
- maxBlockHeight: z.number(),
516
- nonce: z.number(),
517
- publicKey: z.lazy(() => PublicKeySchema()),
518
- receiverId: z.lazy(() => AccountIdSchema()),
519
- senderId: z.lazy(() => AccountIdSchema())
520
- });
521
- var DeleteAccountActionSchema = () => z.object({
522
- beneficiaryId: z.lazy(() => AccountIdSchema())
523
- });
524
- var DeleteKeyActionSchema = () => z.object({
525
- publicKey: z.lazy(() => PublicKeySchema())
526
- });
527
- var DeployContractActionSchema = () => z.object({
528
- code: z.string()
529
- });
530
- var DeployGlobalContractActionSchema = () => z.object({
531
- code: z.string(),
532
- deployMode: z.lazy(() => GlobalContractDeployModeSchema())
533
- });
534
- var DirectionSchema = () => z.enum(["Left", "Right"]);
535
- var ExecutionMetadataViewSchema = () => z.object({
536
- gasProfile: z.optional(
537
- z.union([
538
- z.union([z.array(z.lazy(() => CostGasUsedSchema())), z.null()]),
539
- z.null()
540
- ])
541
- ),
542
- version: z.number()
543
- });
544
- var ExecutionOutcomeViewSchema = () => z.object({
545
- executorId: z.lazy(() => AccountIdSchema()),
546
- gasBurnt: z.number(),
547
- logs: z.array(z.string()),
548
- metadata: z.optional(z.lazy(() => ExecutionMetadataViewSchema())),
549
- receiptIds: z.array(z.lazy(() => CryptoHashSchema())),
550
- status: z.lazy(() => ExecutionStatusViewSchema()),
551
- tokensBurnt: z.string()
552
- });
553
- var ExecutionOutcomeWithIdViewSchema = () => z.object({
554
- blockHash: z.lazy(() => CryptoHashSchema()),
555
- id: z.lazy(() => CryptoHashSchema()),
556
- outcome: z.lazy(() => ExecutionOutcomeViewSchema()),
557
- proof: z.array(z.lazy(() => MerklePathItemSchema()))
558
- });
559
- var ExecutionStatusViewSchema = () => z.union([
560
- z.enum(["Unknown"]),
561
- z.object({
562
- Failure: z.lazy(() => TxExecutionErrorSchema())
563
- }),
564
- z.object({
565
- SuccessValue: z.string()
566
- }),
567
- z.object({
568
- SuccessReceiptId: z.lazy(() => CryptoHashSchema())
569
- })
570
- ]);
571
- var ExtCostsConfigViewSchema = () => z.object({
572
- altBn128G1MultiexpBase: z.number(),
573
- altBn128G1MultiexpElement: z.number(),
574
- altBn128G1SumBase: z.number(),
575
- altBn128G1SumElement: z.number(),
576
- altBn128PairingCheckBase: z.number(),
577
- altBn128PairingCheckElement: z.number(),
578
- base: z.number(),
579
- bls12381G1MultiexpBase: z.number(),
580
- bls12381G1MultiexpElement: z.number(),
581
- bls12381G2MultiexpBase: z.number(),
582
- bls12381G2MultiexpElement: z.number(),
583
- bls12381MapFp2ToG2Base: z.number(),
584
- bls12381MapFp2ToG2Element: z.number(),
585
- bls12381MapFpToG1Base: z.number(),
586
- bls12381MapFpToG1Element: z.number(),
587
- bls12381P1DecompressBase: z.number(),
588
- bls12381P1DecompressElement: z.number(),
589
- bls12381P1SumBase: z.number(),
590
- bls12381P1SumElement: z.number(),
591
- bls12381P2DecompressBase: z.number(),
592
- bls12381P2DecompressElement: z.number(),
593
- bls12381P2SumBase: z.number(),
594
- bls12381P2SumElement: z.number(),
595
- bls12381PairingBase: z.number(),
596
- bls12381PairingElement: z.number(),
597
- contractCompileBase: z.number(),
598
- contractCompileBytes: z.number(),
599
- contractLoadingBase: z.number(),
600
- contractLoadingBytes: z.number(),
601
- ecrecoverBase: z.number(),
602
- ed25519VerifyBase: z.number(),
603
- ed25519VerifyByte: z.number(),
604
- keccak256Base: z.number(),
605
- keccak256Byte: z.number(),
606
- keccak512Base: z.number(),
607
- keccak512Byte: z.number(),
608
- logBase: z.number(),
609
- logByte: z.number(),
610
- promiseAndBase: z.number(),
611
- promiseAndPerPromise: z.number(),
612
- promiseReturn: z.number(),
613
- readCachedTrieNode: z.number(),
614
- readMemoryBase: z.number(),
615
- readMemoryByte: z.number(),
616
- readRegisterBase: z.number(),
617
- readRegisterByte: z.number(),
618
- ripemd160Base: z.number(),
619
- ripemd160Block: z.number(),
620
- sha256Base: z.number(),
621
- sha256Byte: z.number(),
622
- storageHasKeyBase: z.number(),
623
- storageHasKeyByte: z.number(),
624
- storageIterCreateFromByte: z.number(),
625
- storageIterCreatePrefixBase: z.number(),
626
- storageIterCreatePrefixByte: z.number(),
627
- storageIterCreateRangeBase: z.number(),
628
- storageIterCreateToByte: z.number(),
629
- storageIterNextBase: z.number(),
630
- storageIterNextKeyByte: z.number(),
631
- storageIterNextValueByte: z.number(),
632
- storageLargeReadOverheadBase: z.number(),
633
- storageLargeReadOverheadByte: z.number(),
634
- storageReadBase: z.number(),
635
- storageReadKeyByte: z.number(),
636
- storageReadValueByte: z.number(),
637
- storageRemoveBase: z.number(),
638
- storageRemoveKeyByte: z.number(),
639
- storageRemoveRetValueByte: z.number(),
640
- storageWriteBase: z.number(),
641
- storageWriteEvictedByte: z.number(),
642
- storageWriteKeyByte: z.number(),
643
- storageWriteValueByte: z.number(),
644
- touchingTrieNode: z.number(),
645
- utf16DecodingBase: z.number(),
646
- utf16DecodingByte: z.number(),
647
- utf8DecodingBase: z.number(),
648
- utf8DecodingByte: z.number(),
649
- validatorStakeBase: z.number(),
650
- validatorTotalStakeBase: z.number(),
651
- writeMemoryBase: z.number(),
652
- writeMemoryByte: z.number(),
653
- writeRegisterBase: z.number(),
654
- writeRegisterByte: z.number(),
655
- yieldCreateBase: z.number(),
656
- yieldCreateByte: z.number(),
657
- yieldResumeBase: z.number(),
658
- yieldResumeByte: z.number()
659
- });
660
- var FeeSchema = () => z.object({
661
- execution: z.number(),
662
- sendNotSir: z.number(),
663
- sendSir: z.number()
664
- });
665
- var FinalExecutionOutcomeViewSchema = () => z.object({
666
- receiptsOutcome: z.array(z.lazy(() => ExecutionOutcomeWithIdViewSchema())),
667
- status: z.lazy(() => FinalExecutionStatusSchema()),
668
- transaction: z.lazy(() => SignedTransactionViewSchema()),
669
- transactionOutcome: z.lazy(() => ExecutionOutcomeWithIdViewSchema())
670
- });
671
- var FinalExecutionOutcomeWithReceiptViewSchema = () => z.object({
672
- receipts: z.array(z.lazy(() => ReceiptViewSchema())),
673
- receiptsOutcome: z.array(z.lazy(() => ExecutionOutcomeWithIdViewSchema())),
674
- status: z.lazy(() => FinalExecutionStatusSchema()),
675
- transaction: z.lazy(() => SignedTransactionViewSchema()),
676
- transactionOutcome: z.lazy(() => ExecutionOutcomeWithIdViewSchema())
677
- });
678
- var FinalExecutionStatusSchema = () => z.union([
679
- z.enum(["NotStarted"]),
680
- z.enum(["Started"]),
681
- z.object({
682
- Failure: z.lazy(() => TxExecutionErrorSchema())
683
- }),
684
- z.object({
685
- SuccessValue: z.string()
686
- })
687
- ]);
688
- var FunctionArgsSchema = () => z.string();
689
- var FunctionCallActionSchema = () => z.object({
690
- args: z.string(),
691
- deposit: z.string(),
692
- gas: z.number(),
693
- methodName: z.string()
694
- });
695
- var FunctionCallErrorSchema = () => z.union([
696
- z.enum(["WasmUnknownError", "_EVMError"]),
697
- z.object({
698
- CompilationError: z.lazy(() => CompilationErrorSchema())
699
- }),
700
- z.object({
701
- LinkError: z.object({
702
- msg: z.string()
703
- })
704
- }),
705
- z.object({
706
- MethodResolveError: z.lazy(() => MethodResolveErrorSchema())
707
- }),
708
- z.object({
709
- WasmTrap: z.lazy(() => WasmTrapSchema())
710
- }),
711
- z.object({
712
- HostError: z.lazy(() => HostErrorSchema())
713
- }),
714
- z.object({
715
- ExecutionError: z.string()
716
- })
717
- ]);
718
- var FunctionCallPermissionSchema = () => z.object({
719
- allowance: z.optional(z.union([z.union([z.string(), z.null()]), z.null()])),
720
- methodNames: z.array(z.string()),
721
- receiverId: z.string()
722
- });
723
- var GlobalContractDeployModeSchema = () => z.union([z.enum(["CodeHash"]), z.enum(["AccountId"])]);
724
- var GlobalContractIdentifierSchema = () => z.union([
725
- z.object({
726
- CodeHash: z.lazy(() => CryptoHashSchema())
727
- }),
728
- z.object({
729
- AccountId: z.lazy(() => AccountIdSchema())
730
- })
731
- ]);
732
- var HostErrorSchema = () => z.union([
733
- z.enum(["BadUTF16"]),
734
- z.enum(["BadUTF8"]),
735
- z.enum(["GasExceeded"]),
736
- z.enum(["GasLimitExceeded"]),
737
- z.enum(["BalanceExceeded"]),
738
- z.enum(["EmptyMethodName"]),
739
- z.object({
740
- GuestPanic: z.object({
741
- panicMsg: z.string()
742
- })
743
- }),
744
- z.enum(["IntegerOverflow"]),
745
- z.object({
746
- InvalidPromiseIndex: z.object({
747
- promiseIdx: z.number()
748
- })
749
- }),
750
- z.enum(["CannotAppendActionToJointPromise"]),
751
- z.enum(["CannotReturnJointPromise"]),
752
- z.object({
753
- InvalidPromiseResultIndex: z.object({
754
- resultIdx: z.number()
755
- })
756
- }),
757
- z.object({
758
- InvalidRegisterId: z.object({
759
- registerId: z.number()
760
- })
761
- }),
762
- z.object({
763
- IteratorWasInvalidated: z.object({
764
- iteratorIndex: z.number()
765
- })
766
- }),
767
- z.enum(["MemoryAccessViolation"]),
768
- z.object({
769
- InvalidReceiptIndex: z.object({
770
- receiptIndex: z.number()
771
- })
772
- }),
773
- z.object({
774
- InvalidIteratorIndex: z.object({
775
- iteratorIndex: z.number()
776
- })
777
- }),
778
- z.enum(["InvalidAccountId"]),
779
- z.enum(["InvalidMethodName"]),
780
- z.enum(["InvalidPublicKey"]),
781
- z.object({
782
- ProhibitedInView: z.object({
783
- methodName: z.string()
784
- })
785
- }),
786
- z.object({
787
- NumberOfLogsExceeded: z.object({
788
- limit: z.number()
789
- })
790
- }),
791
- z.object({
792
- KeyLengthExceeded: z.object({
793
- length: z.number(),
794
- limit: z.number()
795
- })
796
- }),
797
- z.object({
798
- ValueLengthExceeded: z.object({
799
- length: z.number(),
800
- limit: z.number()
801
- })
802
- }),
803
- z.object({
804
- TotalLogLengthExceeded: z.object({
805
- length: z.number(),
806
- limit: z.number()
807
- })
808
- }),
809
- z.object({
810
- NumberPromisesExceeded: z.object({
811
- limit: z.number(),
812
- numberOfPromises: z.number()
813
- })
814
- }),
815
- z.object({
816
- NumberInputDataDependenciesExceeded: z.object({
817
- limit: z.number(),
818
- numberOfInputDataDependencies: z.number()
819
- })
820
- }),
821
- z.object({
822
- ReturnedValueLengthExceeded: z.object({
823
- length: z.number(),
824
- limit: z.number()
825
- })
826
- }),
827
- z.object({
828
- ContractSizeExceeded: z.object({
829
- limit: z.number(),
830
- size: z.number()
831
- })
832
- }),
833
- z.object({
834
- Deprecated: z.object({
835
- methodName: z.string()
836
- })
837
- }),
838
- z.object({
839
- ECRecoverError: z.object({
840
- msg: z.string()
841
- })
842
- }),
843
- z.object({
844
- AltBn128InvalidInput: z.object({
845
- msg: z.string()
846
- })
847
- }),
848
- z.object({
849
- Ed25519VerifyInvalidInput: z.object({
850
- msg: z.string()
851
- })
852
- })
853
- ]);
854
- var InvalidAccessKeyErrorSchema = () => z.union([
855
- z.object({
856
- AccessKeyNotFound: z.object({
857
- accountId: z.lazy(() => AccountIdSchema()),
858
- publicKey: z.lazy(() => PublicKeySchema())
859
- })
860
- }),
861
- z.object({
862
- ReceiverMismatch: z.object({
863
- akReceiver: z.string(),
864
- txReceiver: z.lazy(() => AccountIdSchema())
865
- })
866
- }),
867
- z.object({
868
- MethodNameMismatch: z.object({
869
- methodName: z.string()
870
- })
871
- }),
872
- z.enum(["RequiresFullAccess"]),
873
- z.object({
874
- NotEnoughAllowance: z.object({
875
- accountId: z.lazy(() => AccountIdSchema()),
876
- allowance: z.string(),
877
- cost: z.string(),
878
- publicKey: z.lazy(() => PublicKeySchema())
879
- })
880
- }),
881
- z.enum(["DepositWithFunctionCall"])
882
- ]);
883
- var InvalidTxErrorSchema = () => z.union([
884
- z.object({
885
- InvalidAccessKeyError: z.lazy(() => InvalidAccessKeyErrorSchema())
886
- }),
887
- z.object({
888
- InvalidSignerId: z.object({
889
- signerId: z.string()
890
- })
891
- }),
892
- z.object({
893
- SignerDoesNotExist: z.object({
894
- signerId: z.lazy(() => AccountIdSchema())
895
- })
896
- }),
897
- z.object({
898
- InvalidNonce: z.object({
899
- akNonce: z.number(),
900
- txNonce: z.number()
901
- })
902
- }),
903
- z.object({
904
- NonceTooLarge: z.object({
905
- txNonce: z.number(),
906
- upperBound: z.number()
907
- })
908
- }),
909
- z.object({
910
- InvalidReceiverId: z.object({
911
- receiverId: z.string()
912
- })
913
- }),
914
- z.enum(["InvalidSignature"]),
915
- z.object({
916
- NotEnoughBalance: z.object({
917
- balance: z.string(),
918
- cost: z.string(),
919
- signerId: z.lazy(() => AccountIdSchema())
920
- })
921
- }),
922
- z.object({
923
- LackBalanceForState: z.object({
924
- amount: z.string(),
925
- signerId: z.lazy(() => AccountIdSchema())
926
- })
927
- }),
928
- z.enum(["CostOverflow"]),
929
- z.enum(["InvalidChain"]),
930
- z.enum(["Expired"]),
931
- z.object({
932
- ActionsValidation: z.lazy(() => ActionsValidationErrorSchema())
933
- }),
934
- z.object({
935
- TransactionSizeExceeded: z.object({
936
- limit: z.number(),
937
- size: z.number()
938
- })
939
- }),
940
- z.enum(["InvalidTransactionVersion"]),
941
- z.object({
942
- StorageError: z.lazy(() => StorageErrorSchema())
943
- }),
944
- z.object({
945
- ShardCongested: z.object({
946
- congestionLevel: z.number(),
947
- shardId: z.number()
948
- })
949
- }),
950
- z.object({
951
- ShardStuck: z.object({
952
- missedChunks: z.number(),
953
- shardId: z.number()
954
- })
955
- })
956
- ]);
957
- var LimitConfigSchema = () => z.object({
958
- accountIdValidityRulesVersion: z.optional(
959
- z.lazy(() => AccountIdValidityRulesVersionSchema())
960
- ),
961
- initialMemoryPages: z.number(),
962
- maxActionsPerReceipt: z.number(),
963
- maxArgumentsLength: z.number(),
964
- maxContractSize: z.number(),
965
- maxElementsPerContractTable: z.optional(
966
- z.union([z.union([z.number(), z.null()]), z.null()])
967
- ),
968
- maxFunctionsNumberPerContract: z.optional(
969
- z.union([z.union([z.number(), z.null()]), z.null()])
970
- ),
971
- maxGasBurnt: z.number(),
972
- maxLengthMethodName: z.number(),
973
- maxLengthReturnedData: z.number(),
974
- maxLengthStorageKey: z.number(),
975
- maxLengthStorageValue: z.number(),
976
- maxLocalsPerContract: z.optional(
977
- z.union([z.union([z.number(), z.null()]), z.null()])
978
- ),
979
- maxMemoryPages: z.number(),
980
- maxNumberBytesMethodNames: z.number(),
981
- maxNumberInputDataDependencies: z.number(),
982
- maxNumberLogs: z.number(),
983
- maxNumberRegisters: z.number(),
984
- maxPromisesPerFunctionCallAction: z.number(),
985
- maxReceiptSize: z.number(),
986
- maxRegisterSize: z.number(),
987
- maxStackHeight: z.number(),
988
- maxTablesPerContract: z.optional(
989
- z.union([z.union([z.number(), z.null()]), z.null()])
990
- ),
991
- maxTotalLogLength: z.number(),
992
- maxTotalPrepaidGas: z.number(),
993
- maxTransactionSize: z.number(),
994
- maxYieldPayloadSize: z.number(),
995
- perReceiptStorageProofSizeLimit: z.number(),
996
- registersMemoryLimit: z.number(),
997
- yieldTimeoutLengthInBlocks: z.number()
998
- });
999
- var MerklePathItemSchema = () => z.object({
1000
- direction: z.lazy(() => DirectionSchema()),
1001
- hash: z.lazy(() => CryptoHashSchema())
1002
- });
1003
- var MethodResolveErrorSchema = () => z.enum(["MethodEmptyName", "MethodNotFound", "MethodInvalidSignature"]);
1004
- var MissingTrieValueSchema = () => z.object({
1005
- context: z.lazy(() => MissingTrieValueContextSchema()),
1006
- hash: z.lazy(() => CryptoHashSchema())
1007
- });
1008
- var MissingTrieValueContextSchema = () => z.union([
1009
- z.enum(["TrieIterator"]),
1010
- z.enum(["TriePrefetchingStorage"]),
1011
- z.enum(["TrieMemoryPartialStorage"]),
1012
- z.enum(["TrieStorage"])
1013
- ]);
1014
- var NonDelegateActionSchema = () => z.union([
1015
- z.object({
1016
- CreateAccount: z.lazy(() => CreateAccountActionSchema())
1017
- }),
1018
- z.object({
1019
- DeployContract: z.lazy(() => DeployContractActionSchema())
1020
- }),
1021
- z.object({
1022
- FunctionCall: z.lazy(() => FunctionCallActionSchema())
1023
- }),
1024
- z.object({
1025
- Transfer: z.lazy(() => TransferActionSchema())
1026
- }),
1027
- z.object({
1028
- Stake: z.lazy(() => StakeActionSchema())
1029
- }),
1030
- z.object({
1031
- AddKey: z.lazy(() => AddKeyActionSchema())
1032
- }),
1033
- z.object({
1034
- DeleteKey: z.lazy(() => DeleteKeyActionSchema())
1035
- }),
1036
- z.object({
1037
- DeleteAccount: z.lazy(() => DeleteAccountActionSchema())
1038
- }),
1039
- z.object({
1040
- DeployGlobalContract: z.lazy(() => DeployGlobalContractActionSchema())
1041
- }),
1042
- z.object({
1043
- UseGlobalContract: z.lazy(() => UseGlobalContractActionSchema())
1044
- })
1045
- ]);
1046
- var PrepareErrorSchema = () => z.union([
1047
- z.enum(["Serialization"]),
1048
- z.enum(["Deserialization"]),
1049
- z.enum(["InternalMemoryDeclared"]),
1050
- z.enum(["GasInstrumentation"]),
1051
- z.enum(["StackHeightInstrumentation"]),
1052
- z.enum(["Instantiate"]),
1053
- z.enum(["Memory"]),
1054
- z.enum(["TooManyFunctions"]),
1055
- z.enum(["TooManyLocals"]),
1056
- z.enum(["TooManyTables"]),
1057
- z.enum(["TooManyTableElements"])
1058
- ]);
1059
- var PublicKeySchema = () => z.string();
1060
- var ReceiptEnumViewSchema = () => z.union([
1061
- z.object({
1062
- Action: z.object({
1063
- actions: z.array(z.lazy(() => ActionViewSchema())),
1064
- gasPrice: z.string(),
1065
- inputDataIds: z.array(z.lazy(() => CryptoHashSchema())),
1066
- isPromiseYield: z.optional(z.boolean()),
1067
- outputDataReceivers: z.array(z.lazy(() => DataReceiverViewSchema())),
1068
- signerId: z.lazy(() => AccountIdSchema()),
1069
- signerPublicKey: z.lazy(() => PublicKeySchema())
1070
- })
1071
- }),
1072
- z.object({
1073
- Data: z.object({
1074
- data: z.optional(z.union([z.union([z.string(), z.null()]), z.null()])),
1075
- dataId: z.lazy(() => CryptoHashSchema()),
1076
- isPromiseResume: z.optional(z.boolean())
1077
- })
1078
- }),
1079
- z.object({
1080
- GlobalContractDistribution: z.object({
1081
- alreadyDeliveredShards: z.array(z.lazy(() => ShardIdSchema())),
1082
- code: z.string(),
1083
- id: z.lazy(() => GlobalContractIdentifierSchema()),
1084
- targetShard: z.lazy(() => ShardIdSchema())
1085
- })
1086
- })
1087
- ]);
1088
- var ReceiptValidationErrorSchema = () => z.union([
1089
- z.object({
1090
- InvalidPredecessorId: z.object({
1091
- accountId: z.string()
1092
- })
1093
- }),
1094
- z.object({
1095
- InvalidReceiverId: z.object({
1096
- accountId: z.string()
1097
- })
1098
- }),
1099
- z.object({
1100
- InvalidSignerId: z.object({
1101
- accountId: z.string()
1102
- })
1103
- }),
1104
- z.object({
1105
- InvalidDataReceiverId: z.object({
1106
- accountId: z.string()
1107
- })
1108
- }),
1109
- z.object({
1110
- ReturnedValueLengthExceeded: z.object({
1111
- length: z.number(),
1112
- limit: z.number()
1113
- })
1114
- }),
1115
- z.object({
1116
- NumberInputDataDependenciesExceeded: z.object({
1117
- limit: z.number(),
1118
- numberOfInputDataDependencies: z.number()
1119
- })
1120
- }),
1121
- z.object({
1122
- ActionsValidation: z.lazy(() => ActionsValidationErrorSchema())
1123
- }),
1124
- z.object({
1125
- ReceiptSizeExceeded: z.object({
1126
- limit: z.number(),
1127
- size: z.number()
1128
- })
1129
- })
1130
- ]);
1131
- var ReceiptViewSchema = () => z.object({
1132
- predecessorId: z.lazy(() => AccountIdSchema()),
1133
- priority: z.optional(z.number()),
1134
- receipt: z.lazy(() => ReceiptEnumViewSchema()),
1135
- receiptId: z.lazy(() => CryptoHashSchema()),
1136
- receiverId: z.lazy(() => AccountIdSchema())
1137
- });
1138
- var RpcBlockResponseSchema = () => z.object({
1139
- author: z.lazy(() => AccountIdSchema()),
1140
- chunks: z.array(z.lazy(() => ChunkHeaderViewSchema())),
1141
- header: z.lazy(() => BlockHeaderViewSchema())
1142
- });
1143
- var RpcGasPriceResponseSchema = () => z.object({
1144
- gasPrice: z.string()
1145
- });
1146
- var RpcProtocolConfigResponseSchema = () => z.object({
1147
- avgHiddenValidatorSeatsPerShard: z.array(z.number()),
1148
- blockProducerKickoutThreshold: z.number(),
1149
- chainId: z.string(),
1150
- chunkProducerKickoutThreshold: z.number(),
1151
- chunkValidatorOnlyKickoutThreshold: z.number(),
1152
- dynamicResharding: z.boolean(),
1153
- epochLength: z.number(),
1154
- fishermenThreshold: z.string(),
1155
- gasLimit: z.number(),
1156
- gasPriceAdjustmentRate: z.array(z.number()),
1157
- genesisHeight: z.number(),
1158
- genesisTime: z.string(),
1159
- maxGasPrice: z.string(),
1160
- maxInflationRate: z.array(z.number()),
1161
- maxKickoutStakePerc: z.number(),
1162
- minGasPrice: z.string(),
1163
- minimumStakeDivisor: z.number(),
1164
- minimumStakeRatio: z.array(z.number()),
1165
- minimumValidatorsPerShard: z.number(),
1166
- numBlockProducerSeats: z.number(),
1167
- numBlockProducerSeatsPerShard: z.array(z.number()),
1168
- numBlocksPerYear: z.number(),
1169
- onlineMaxThreshold: z.array(z.number()),
1170
- onlineMinThreshold: z.array(z.number()),
1171
- protocolRewardRate: z.array(z.number()),
1172
- protocolTreasuryAccount: z.lazy(() => AccountIdSchema()),
1173
- protocolUpgradeStakeThreshold: z.array(z.number()),
1174
- protocolVersion: z.number(),
1175
- runtimeConfig: z.lazy(() => RuntimeConfigViewSchema()),
1176
- shardLayout: z.lazy(() => ShardLayoutSchema()),
1177
- shuffleShardAssignmentForChunkProducers: z.boolean(),
1178
- targetValidatorMandatesPerShard: z.number(),
1179
- transactionValidityPeriod: z.number()
1180
- });
1181
- var RpcTransactionResponseSchema = () => z.intersection(
1182
- z.union([
1183
- z.lazy(() => FinalExecutionOutcomeWithReceiptViewSchema()),
1184
- z.lazy(() => FinalExecutionOutcomeViewSchema())
1185
- ]),
1186
- z.object({
1187
- finalExecutionStatus: z.lazy(() => TxExecutionStatusSchema())
1188
- })
1189
- );
1190
- var RuntimeConfigViewSchema = () => z.object({
1191
- accountCreationConfig: z.lazy(() => AccountCreationConfigViewSchema()),
1192
- congestionControlConfig: z.lazy(() => CongestionControlConfigViewSchema()),
1193
- storageAmountPerByte: z.string(),
1194
- transactionCosts: z.lazy(() => RuntimeFeesConfigViewSchema()),
1195
- wasmConfig: z.lazy(() => VMConfigViewSchema()),
1196
- witnessConfig: z.lazy(() => WitnessConfigViewSchema())
1197
- });
1198
- var RuntimeFeesConfigViewSchema = () => z.object({
1199
- actionCreationConfig: z.lazy(() => ActionCreationConfigViewSchema()),
1200
- actionReceiptCreationConfig: z.lazy(() => FeeSchema()),
1201
- burntGasReward: z.array(z.number()),
1202
- dataReceiptCreationConfig: z.lazy(
1203
- () => DataReceiptCreationConfigViewSchema()
1204
- ),
1205
- pessimisticGasPriceInflationRatio: z.array(z.number()),
1206
- storageUsageConfig: z.lazy(() => StorageUsageConfigViewSchema())
1207
- });
1208
- var ShardIdSchema = () => z.number();
1209
- var ShardLayoutSchema = () => z.union([
1210
- z.object({
1211
- V0: z.lazy(() => ShardLayoutV0Schema())
1212
- }),
1213
- z.object({
1214
- V1: z.lazy(() => ShardLayoutV1Schema())
1215
- }),
1216
- z.object({
1217
- V2: z.lazy(() => ShardLayoutV2Schema())
1218
- })
1219
- ]);
1220
- var ShardLayoutV0Schema = () => z.object({
1221
- numShards: z.number(),
1222
- version: z.number()
1223
- });
1224
- var ShardLayoutV1Schema = () => z.object({
1225
- boundaryAccounts: z.array(z.lazy(() => AccountIdSchema())),
1226
- shardsSplitMap: z.optional(
1227
- z.union([
1228
- z.union([z.array(z.array(z.lazy(() => ShardIdSchema()))), z.null()]),
1229
- z.null()
1230
- ])
1231
- ),
1232
- toParentShardMap: z.optional(
1233
- z.union([
1234
- z.union([z.array(z.lazy(() => ShardIdSchema())), z.null()]),
1235
- z.null()
1236
- ])
1237
- ),
1238
- version: z.number()
1239
- });
1240
- var ShardLayoutV2Schema = () => z.object({
1241
- boundaryAccounts: z.array(z.lazy(() => AccountIdSchema())),
1242
- idToIndexMap: z.record(z.string(), z.number()),
1243
- indexToIdMap: z.record(
1244
- z.string(),
1245
- z.lazy(() => ShardIdSchema())
1246
- ),
1247
- shardIds: z.array(z.lazy(() => ShardIdSchema())),
1248
- shardsParentMap: z.optional(
1249
- z.union([
1250
- z.union([
1251
- z.record(
1252
- z.string(),
1253
- z.lazy(() => ShardIdSchema())
1254
- ),
1255
- z.null()
1256
- ]),
1257
- z.null()
1258
- ])
1259
- ),
1260
- shardsSplitMap: z.optional(
1261
- z.union([
1262
- z.union([
1263
- z.record(z.string(), z.array(z.lazy(() => ShardIdSchema()))),
1264
- z.null()
1265
- ]),
1266
- z.null()
1267
- ])
1268
- ),
1269
- version: z.number()
1270
- });
1271
- var SignatureSchema = () => z.string();
1272
- var SignedTransactionViewSchema = () => z.object({
1273
- actions: z.array(z.lazy(() => ActionViewSchema())),
1274
- hash: z.lazy(() => CryptoHashSchema()),
1275
- nonce: z.number(),
1276
- priorityFee: z.optional(z.number()),
1277
- publicKey: z.lazy(() => PublicKeySchema()),
1278
- receiverId: z.lazy(() => AccountIdSchema()),
1279
- signature: z.lazy(() => SignatureSchema()),
1280
- signerId: z.lazy(() => AccountIdSchema())
1281
- });
1282
- var SlashedValidatorSchema = () => z.object({
1283
- accountId: z.lazy(() => AccountIdSchema()),
1284
- isDoubleSign: z.boolean()
1285
- });
1286
- var StakeActionSchema = () => z.object({
1287
- publicKey: z.lazy(() => PublicKeySchema()),
1288
- stake: z.string()
1289
- });
1290
- var StateItemSchema = () => z.object({
1291
- key: z.lazy(() => StoreKeySchema()),
1292
- value: z.lazy(() => StoreValueSchema())
1293
- });
1294
- var StorageErrorSchema = () => z.union([
1295
- z.enum(["StorageInternalError"]),
1296
- z.object({
1297
- MissingTrieValue: z.lazy(() => MissingTrieValueSchema())
1298
- }),
1299
- z.enum(["UnexpectedTrieValue"]),
1300
- z.object({
1301
- StorageInconsistentState: z.string()
1302
- }),
1303
- z.object({
1304
- FlatStorageBlockNotSupported: z.string()
1305
- }),
1306
- z.object({
1307
- MemTrieLoadingError: z.string()
1308
- })
1309
- ]);
1310
- var StorageGetModeSchema = () => z.enum(["FlatStorage", "Trie"]);
1311
- var StorageUsageConfigViewSchema = () => z.object({
1312
- numBytesAccount: z.number(),
1313
- numExtraBytesRecord: z.number()
1314
- });
1315
- var StoreKeySchema = () => z.string();
1316
- var StoreValueSchema = () => z.string();
1317
- var TransferActionSchema = () => z.object({
1318
- deposit: z.string()
1319
- });
1320
- var TxExecutionErrorSchema = () => z.union([
1321
- z.object({
1322
- ActionError: z.lazy(() => ActionErrorSchema())
1323
- }),
1324
- z.object({
1325
- InvalidTxError: z.lazy(() => InvalidTxErrorSchema())
1326
- })
1327
- ]);
1328
- var TxExecutionStatusSchema = () => z.union([
1329
- z.enum(["NONE"]),
1330
- z.enum(["INCLUDED"]),
1331
- z.enum(["EXECUTED_OPTIMISTIC"]),
1332
- z.enum(["INCLUDED_FINAL"]),
1333
- z.enum(["EXECUTED"]),
1334
- z.enum(["FINAL"])
1335
- ]);
1336
- var UseGlobalContractActionSchema = () => z.object({
1337
- contractIdentifier: z.lazy(() => GlobalContractIdentifierSchema())
1338
- });
1339
- var VMConfigViewSchema = () => z.object({
1340
- discardCustomSections: z.boolean(),
1341
- ethImplicitAccounts: z.boolean(),
1342
- extCosts: z.lazy(() => ExtCostsConfigViewSchema()),
1343
- fixContractLoadingCost: z.boolean(),
1344
- globalContractHostFns: z.boolean(),
1345
- growMemCost: z.number(),
1346
- implicitAccountCreation: z.boolean(),
1347
- limitConfig: z.lazy(() => LimitConfigSchema()),
1348
- reftypesBulkMemory: z.boolean(),
1349
- regularOpCost: z.number(),
1350
- saturatingFloatToInt: z.boolean(),
1351
- storageGetMode: z.lazy(() => StorageGetModeSchema()),
1352
- vmKind: z.lazy(() => VMKindSchema())
1353
- });
1354
- var VMKindSchema = () => z.union([
1355
- z.enum(["Wasmer0"]),
1356
- z.enum(["Wasmtime"]),
1357
- z.enum(["Wasmer2"]),
1358
- z.enum(["NearVm"]),
1359
- z.enum(["NearVm2"])
1360
- ]);
1361
- var ValidatorStakeViewSchema = () => z.lazy(() => ValidatorStakeViewV1Schema());
1362
- var ValidatorStakeViewV1Schema = () => z.object({
1363
- accountId: z.lazy(() => AccountIdSchema()),
1364
- publicKey: z.lazy(() => PublicKeySchema()),
1365
- stake: z.string()
1366
- });
1367
- var ViewStateResultSchema = () => z.object({
1368
- proof: z.optional(z.array(z.string())),
1369
- values: z.array(z.lazy(() => StateItemSchema()))
1370
- });
1371
- var WasmTrapSchema = () => z.union([
1372
- z.enum(["Unreachable"]),
1373
- z.enum(["IncorrectCallIndirectSignature"]),
1374
- z.enum(["MemoryOutOfBounds"]),
1375
- z.enum(["CallIndirectOOB"]),
1376
- z.enum(["IllegalArithmetic"]),
1377
- z.enum(["MisalignedAtomicAccess"]),
1378
- z.enum(["IndirectCallToNull"]),
1379
- z.enum(["StackOverflow"]),
1380
- z.enum(["GenericTrap"])
1381
- ]);
1382
- var WitnessConfigViewSchema = () => z.object({
1383
- combinedTransactionsSizeLimit: z.number(),
1384
- mainStorageProofSizeSoftLimit: z.number(),
1385
- newTransactionsValidationStateSizeSoftLimit: z.number()
1386
- });
1387
- var PATH_TO_METHOD_MAP = {
1388
- "/EXPERIMENTAL_changes": "EXPERIMENTAL_changes",
1389
- "/EXPERIMENTAL_changes_in_block": "EXPERIMENTAL_changes_in_block",
1390
- "/EXPERIMENTAL_congestion_level": "EXPERIMENTAL_congestion_level",
1391
- "/EXPERIMENTAL_genesis_config": "EXPERIMENTAL_genesis_config",
1392
- "/EXPERIMENTAL_light_client_block_proof": "EXPERIMENTAL_light_client_block_proof",
1393
- "/EXPERIMENTAL_light_client_proof": "EXPERIMENTAL_light_client_proof",
1394
- "/EXPERIMENTAL_maintenance_windows": "EXPERIMENTAL_maintenance_windows",
1395
- "/EXPERIMENTAL_protocol_config": "EXPERIMENTAL_protocol_config",
1396
- "/EXPERIMENTAL_receipt": "EXPERIMENTAL_receipt",
1397
- "/EXPERIMENTAL_split_storage_info": "EXPERIMENTAL_split_storage_info",
1398
- "/EXPERIMENTAL_tx_status": "EXPERIMENTAL_tx_status",
1399
- "/EXPERIMENTAL_validators_ordered": "EXPERIMENTAL_validators_ordered",
1400
- "/block": "block",
1401
- "/block_effects": "block_effects",
1402
- "/broadcast_tx_async": "broadcast_tx_async",
1403
- "/broadcast_tx_commit": "broadcast_tx_commit",
1404
- "/changes": "changes",
1405
- "/chunk": "chunk",
1406
- "/client_config": "client_config",
1407
- "/gas_price": "gas_price",
1408
- "/genesis_config": "genesis_config",
1409
- "/health": "health",
1410
- "/light_client_proof": "light_client_proof",
1411
- "/maintenance_windows": "maintenance_windows",
1412
- "/network_info": "network_info",
1413
- "/next_light_client_block": "next_light_client_block",
1414
- "/query": "query",
1415
- "/send_tx": "send_tx",
1416
- "/status": "status",
1417
- "/tx": "tx",
1418
- "/validators": "validators"
1419
- };
1420
- var METHOD_TO_PATH_MAP = {};
1421
- Object.entries(PATH_TO_METHOD_MAP).forEach(([path, method]) => {
1422
- METHOD_TO_PATH_MAP[method] = path;
1423
- });
1424
- var RPC_METHODS = Object.values(PATH_TO_METHOD_MAP);
43
+ // src/client/createClient/account/getAccountState.ts
44
+ import { AccountViewSchema, CryptoHashSchema } from "@near-js/jsonrpc-types";
1425
45
 
1426
46
  // src/_common/utils/snakeToCamelCase.ts
1427
47
  var snakeToCamelCase = (obj) => {
@@ -1606,10 +226,10 @@ var fromNearOption = (nearOption) => {
1606
226
  };
1607
227
 
1608
228
  // src/client/createClient/account/getAccountState.ts
1609
- var RpcQueryAccountViewResponseSchema = z2.object({
229
+ var RpcQueryAccountViewResponseSchema = z.object({
1610
230
  ...AccountViewSchema().shape,
1611
231
  blockHash: CryptoHashSchema(),
1612
- blockHeight: z2.number()
232
+ blockHeight: z.number()
1613
233
  });
1614
234
  var transformResult = (result, args) => {
1615
235
  const camelCased = snakeToCamelCase(result);
@@ -1650,7 +270,8 @@ var createGetAccountState = ({ sendRequest }) => async (args) => {
1650
270
  };
1651
271
 
1652
272
  // src/client/createClient/account/getAccountKey.ts
1653
- import * as z3 from "zod/mini";
273
+ import * as z2 from "zod/mini";
274
+ import { AccessKeyViewSchema, CryptoHashSchema as CryptoHashSchema2 } from "@near-js/jsonrpc-types";
1654
275
 
1655
276
  // src/client/createClient/account/helpers/transformKey.ts
1656
277
  var transformKey = (key) => {
@@ -1679,10 +300,10 @@ var transformKey = (key) => {
1679
300
  };
1680
301
 
1681
302
  // src/client/createClient/account/getAccountKey.ts
1682
- var RpcQueryAccessKeyViewResponseSchema = z3.object({
303
+ var RpcQueryAccessKeyViewResponseSchema = z2.object({
1683
304
  ...AccessKeyViewSchema().shape,
1684
- blockHash: CryptoHashSchema(),
1685
- blockHeight: z3.number()
305
+ blockHash: CryptoHashSchema2(),
306
+ blockHeight: z2.number()
1686
307
  });
1687
308
  var transformResult2 = (result, args) => {
1688
309
  const camelCased = snakeToCamelCase(result);
@@ -1713,11 +334,12 @@ var createGetAccountKey = ({ sendRequest }) => async (args) => {
1713
334
  };
1714
335
 
1715
336
  // src/client/createClient/account/getAccountKeys.ts
1716
- import * as z4 from "zod/mini";
1717
- var RpcQueryAccessKeyListResponseSchema = z4.object({
337
+ import * as z3 from "zod/mini";
338
+ import { AccessKeyListSchema, CryptoHashSchema as CryptoHashSchema3 } from "@near-js/jsonrpc-types";
339
+ var RpcQueryAccessKeyListResponseSchema = z3.object({
1718
340
  ...AccessKeyListSchema().shape,
1719
- blockHash: CryptoHashSchema(),
1720
- blockHeight: z4.number()
341
+ blockHash: CryptoHashSchema3(),
342
+ blockHeight: z3.number()
1721
343
  });
1722
344
  var transformResult3 = (result, args) => {
1723
345
  const camelCased = snakeToCamelCase(result);
@@ -1744,12 +366,16 @@ var createGetAccountKeys = ({ sendRequest }) => async (args) => {
1744
366
  };
1745
367
 
1746
368
  // src/client/createClient/contract/getContractState.ts
1747
- import * as z5 from "zod/mini";
369
+ import * as z4 from "zod/mini";
1748
370
  import { base64 } from "@scure/base";
1749
- var RpcQueryViewStateResponseSchema = z5.object({
371
+ import {
372
+ ViewStateResultSchema,
373
+ CryptoHashSchema as CryptoHashSchema4
374
+ } from "@near-js/jsonrpc-types";
375
+ var RpcQueryViewStateResponseSchema = z4.object({
1750
376
  ...ViewStateResultSchema().shape,
1751
- blockHash: CryptoHashSchema(),
1752
- blockHeight: z5.number()
377
+ blockHash: CryptoHashSchema4(),
378
+ blockHeight: z4.number()
1753
379
  });
1754
380
  var transformResult4 = (result, args) => {
1755
381
  const camelCased = snakeToCamelCase(result);
@@ -1782,12 +408,13 @@ var createGetContractState = ({ sendRequest }) => async (args) => {
1782
408
 
1783
409
  // src/client/createClient/contract/callContractReadFunction.ts
1784
410
  import { base64 as base642 } from "@scure/base";
1785
- import * as z6 from "zod/mini";
411
+ import * as z5 from "zod/mini";
412
+ import { CallResultSchema, CryptoHashSchema as CryptoHashSchema5 } from "@near-js/jsonrpc-types";
1786
413
  var baseDeserializeResul = ({ rawResult }) => fromJsonBytes(rawResult);
1787
- var RpcCallFunctionResponseSchema = z6.object({
414
+ var RpcCallFunctionResponseSchema = z5.object({
1788
415
  ...CallResultSchema().shape,
1789
- blockHash: CryptoHashSchema(),
1790
- blockHeight: z6.number()
416
+ blockHash: CryptoHashSchema5(),
417
+ blockHeight: z5.number()
1791
418
  });
1792
419
  var transformResult5 = (result, args) => {
1793
420
  const camelCased = snakeToCamelCase(result);
@@ -1823,6 +450,7 @@ var createCallContractReadFunction = ({ sendRequest }) => async (args) => {
1823
450
  };
1824
451
 
1825
452
  // src/client/createClient/block/getBlock.ts
453
+ import { RpcBlockResponseSchema } from "@near-js/jsonrpc-types";
1826
454
  var transformResult6 = (result) => {
1827
455
  const camelCased = snakeToCamelCase(result);
1828
456
  return RpcBlockResponseSchema().parse(camelCased);
@@ -1838,20 +466,21 @@ var createGetBlock = ({ sendRequest }) => async (args) => {
1838
466
  };
1839
467
 
1840
468
  // src/client/createClient/protocol/getGasPrice.ts
1841
- import * as z8 from "zod/mini";
469
+ import * as z7 from "zod/mini";
470
+ import { RpcGasPriceResponseSchema } from "@near-js/jsonrpc-types";
1842
471
 
1843
472
  // src/_common/schemas/zod/common.ts
1844
- import * as z7 from "zod/mini";
473
+ import * as z6 from "zod/mini";
1845
474
  import { base58 } from "@scure/base";
1846
- var Base58StringSchema = z7.string().check(
1847
- z7.regex(
475
+ var Base58StringSchema = z6.string().check(
476
+ z6.regex(
1848
477
  /^[1-9A-HJ-NP-Za-km-z]+$/,
1849
478
  oneLine(`Base58 string contains invalid characters. Allowed characters:
1850
479
  123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz`)
1851
480
  )
1852
481
  );
1853
- var CryptoHashSchema2 = Base58StringSchema.check(
1854
- z7.refine(
482
+ var CryptoHashSchema6 = Base58StringSchema.check(
483
+ z6.refine(
1855
484
  (val) => {
1856
485
  try {
1857
486
  const bytes = base58.decode(val);
@@ -1863,9 +492,9 @@ var CryptoHashSchema2 = Base58StringSchema.check(
1863
492
  { error: "CryptoHash string must decode to 32 bytes" }
1864
493
  )
1865
494
  );
1866
- var BlockHashSchema = CryptoHashSchema2;
1867
- var BlockHeightSchema = z7.uint64();
1868
- var BlockIdSchema = z7.union([BlockHeightSchema, BlockHashSchema]);
495
+ var BlockHashSchema = CryptoHashSchema6;
496
+ var BlockHeightSchema = z6.uint64();
497
+ var BlockIdSchema = z6.union([BlockHeightSchema, BlockHashSchema]);
1869
498
 
1870
499
  // src/client/createClient/protocol/getGasPrice.ts
1871
500
  var transformResult7 = (result) => {
@@ -1875,9 +504,9 @@ var transformResult7 = (result) => {
1875
504
  gasPrice: yoctoNear(valid.gasPrice)
1876
505
  };
1877
506
  };
1878
- var GetGasPriceArgsSchema = z8.optional(
1879
- z8.object({
1880
- blockId: z8.optional(BlockIdSchema)
507
+ var GetGasPriceArgsSchema = z7.optional(
508
+ z7.object({
509
+ blockId: z7.optional(BlockIdSchema)
1881
510
  })
1882
511
  );
1883
512
  var getBlockId = (atMomentOf) => {
@@ -1900,12 +529,17 @@ var createGetGasPrice = ({ sendRequest }) => async (args) => {
1900
529
  };
1901
530
 
1902
531
  // src/client/createClient/protocol/getProtocolConfig.ts
1903
- import * as z9 from "zod/mini";
1904
- var TemporaryProtocolConfigShema = z9.object({
532
+ import * as z8 from "zod/mini";
533
+ import {
534
+ RpcProtocolConfigResponseSchema,
535
+ RuntimeConfigViewSchema,
536
+ VMConfigViewSchema
537
+ } from "@near-js/jsonrpc-types";
538
+ var TemporaryProtocolConfigShema = z8.object({
1905
539
  ...RpcProtocolConfigResponseSchema().shape,
1906
- runtimeConfig: z9.object({
540
+ runtimeConfig: z8.object({
1907
541
  ...RuntimeConfigViewSchema().shape,
1908
- wasmConfig: z9.omit(VMConfigViewSchema(), { reftypesBulkMemory: true })
542
+ wasmConfig: z8.omit(VMConfigViewSchema(), { reftypesBulkMemory: true })
1909
543
  })
1910
544
  });
1911
545
  var transformResult8 = (result) => {
@@ -2396,6 +1030,7 @@ var serializeSignedTransaction = (signedTransaction) => serializeNativeSignedTra
2396
1030
  );
2397
1031
 
2398
1032
  // src/client/createClient/transaction/sendSignedTransaction.ts
1033
+ import { RpcTransactionResponseSchema } from "@near-js/jsonrpc-types";
2399
1034
  var transformResult9 = (result) => {
2400
1035
  const camelCased = snakeToCamelCase(result);
2401
1036
  return RpcTransactionResponseSchema().parse(camelCased);