diff --git a/packages/jsonrpc-client/src/generated-functions.ts b/packages/jsonrpc-client/src/generated-functions.ts index de0125a..1b32ece 100644 --- a/packages/jsonrpc-client/src/generated-functions.ts +++ b/packages/jsonrpc-client/src/generated-functions.ts @@ -1,5 +1,5 @@ // Auto-generated exports for tree-shakable functions -// Generated at: 2025-09-12T17:21:02.578Z +// Generated at: 2025-11-08T06:05:09.936Z // Do not edit manually - changes will be overwritten export { diff --git a/packages/jsonrpc-client/src/generated-types.ts b/packages/jsonrpc-client/src/generated-types.ts index 5d09fcb..d95a113 100644 --- a/packages/jsonrpc-client/src/generated-types.ts +++ b/packages/jsonrpc-client/src/generated-types.ts @@ -1,5 +1,5 @@ // Auto-generated static RPC functions for tree-shaking -// Generated at: 2025-09-12T17:21:02.564Z +// Generated at: 2025-11-08T06:05:09.929Z // Total functions: 31 // // This file is automatically generated by tools/codegen/generate-client-interface.ts diff --git a/packages/jsonrpc-client/src/validated/index.ts b/packages/jsonrpc-client/src/validated/index.ts index c07015d..653cc68 100644 --- a/packages/jsonrpc-client/src/validated/index.ts +++ b/packages/jsonrpc-client/src/validated/index.ts @@ -1,5 +1,5 @@ // Auto-generated validation wrapper functions -// Generated at: 2025-09-12T17:21:02.580Z +// Generated at: 2025-11-08T06:05:09.938Z // Total functions: 31 // // This file is automatically generated by tools/codegen/generate-validation-wrappers.ts diff --git a/packages/jsonrpc-types/src/methods.ts b/packages/jsonrpc-types/src/methods.ts index d2536a9..4731361 100644 --- a/packages/jsonrpc-types/src/methods.ts +++ b/packages/jsonrpc-types/src/methods.ts @@ -1,5 +1,5 @@ // Auto-generated method mapping from NEAR OpenAPI spec -// Generated on: 2025-09-12T17:20:47.145Z +// Generated on: 2025-11-08T06:05:00.562Z // Do not edit manually - run 'pnpm generate' to regenerate // Maps OpenAPI paths to actual JSON-RPC method names diff --git a/packages/jsonrpc-types/src/schemas.ts b/packages/jsonrpc-types/src/schemas.ts index e337fe1..19a7b9b 100644 --- a/packages/jsonrpc-types/src/schemas.ts +++ b/packages/jsonrpc-types/src/schemas.ts @@ -1,5 +1,5 @@ // Auto-generated Zod schemas from NEAR OpenAPI spec (zod/mini version) -// Generated on: 2025-09-12T17:20:47.145Z +// Generated on: 2025-11-08T06:05:00.562Z // Do not edit manually - run 'pnpm generate' to regenerate import { z } from 'zod/mini'; @@ -57,7 +57,7 @@ export const AccessKeyPermissionViewSchema = () => z.object({ FunctionCall: z.object({ allowance: z.optional( - z.union([z.union([z.string(), z.null()]), z.null()]) + z.union([z.lazy(() => NearTokenSchema()), z.null()]) ), methodNames: z.array(z.string()), receiverId: z.string(), @@ -115,14 +115,14 @@ export const AccountIdValidityRulesVersionSchema = () => z.number(); export const AccountInfoSchema = () => z.object({ accountId: z.lazy(() => AccountIdSchema()), - amount: z.string(), + amount: z.lazy(() => NearTokenSchema()), publicKey: z.lazy(() => PublicKeySchema()), }); // A view of the account export const AccountViewSchema = () => z.object({ - amount: z.string(), + amount: z.lazy(() => NearTokenSchema()), codeHash: z.lazy(() => CryptoHashSchema()), globalContractAccountId: z.optional( z.union([z.lazy(() => AccountIdSchema()), z.null()]) @@ -130,7 +130,7 @@ export const AccountViewSchema = () => globalContractHash: z.optional( z.union([z.lazy(() => CryptoHashSchema()), z.null()]) ), - locked: z.string(), + locked: z.lazy(() => NearTokenSchema()), storagePaidAt: z.optional(z.number()), storageUsage: z.number(), }); @@ -219,7 +219,7 @@ export const ActionErrorKindSchema = () => z.object({ LackBalanceForState: z.object({ accountId: z.lazy(() => AccountIdSchema()), - amount: z.string(), + amount: z.lazy(() => NearTokenSchema()), }), }), z.object({ @@ -230,16 +230,16 @@ export const ActionErrorKindSchema = () => z.object({ TriesToStake: z.object({ accountId: z.lazy(() => AccountIdSchema()), - balance: z.string(), - locked: z.string(), - stake: z.string(), + balance: z.lazy(() => NearTokenSchema()), + locked: z.lazy(() => NearTokenSchema()), + stake: z.lazy(() => NearTokenSchema()), }), }), z.object({ InsufficientStake: z.object({ accountId: z.lazy(() => AccountIdSchema()), - minimumStake: z.string(), - stake: z.string(), + minimumStake: z.lazy(() => NearTokenSchema()), + stake: z.lazy(() => NearTokenSchema()), }), }), z.object({ @@ -299,20 +299,20 @@ export const ActionViewSchema = () => z.object({ FunctionCall: z.object({ args: z.lazy(() => FunctionArgsSchema()), - deposit: z.string(), + deposit: z.lazy(() => NearTokenSchema()), gas: z.lazy(() => NearGasSchema()), methodName: z.string(), }), }), z.object({ Transfer: z.object({ - deposit: z.string(), + deposit: z.lazy(() => NearTokenSchema()), }), }), z.object({ Stake: z.object({ publicKey: z.lazy(() => PublicKeySchema()), - stake: z.string(), + stake: z.lazy(() => NearTokenSchema()), }), }), z.object({ @@ -357,6 +357,13 @@ export const ActionViewSchema = () => accountId: z.lazy(() => AccountIdSchema()), }), }), + z.object({ + DeterministicStateInit: z.object({ + code: z.lazy(() => GlobalContractIdentifierViewSchema()), + data: z.record(z.string(), z.string()), + deposit: z.lazy(() => NearTokenSchema()), + }), + }), ]); // Describes the error for validating a list of actions. @@ -424,6 +431,24 @@ export const ActionsValidationErrorSchema = () => version: z.number(), }), }), + z.object({ + InvalidDeterministicStateInitReceiver: z.object({ + derivedId: z.lazy(() => AccountIdSchema()), + receiverId: z.lazy(() => AccountIdSchema()), + }), + }), + z.object({ + DeterministicStateInitKeyLengthExceeded: z.object({ + length: z.number(), + limit: z.number(), + }), + }), + z.object({ + DeterministicStateInitValueLengthExceeded: z.object({ + length: z.number(), + limit: z.number(), + }), + }), ]); // An action that adds key with public key associated @@ -512,7 +537,7 @@ export const BlockHeaderViewSchema = () => epochSyncDataHash: z.optional( z.union([z.lazy(() => CryptoHashSchema()), z.null()]) ), - gasPrice: z.string(), + gasPrice: z.lazy(() => NearTokenSchema()), hash: z.lazy(() => CryptoHashSchema()), height: z.number(), lastDsFinalBlock: z.lazy(() => CryptoHashSchema()), @@ -527,13 +552,13 @@ export const BlockHeaderViewSchema = () => ), prevStateRoot: z.lazy(() => CryptoHashSchema()), randomValue: z.lazy(() => CryptoHashSchema()), - rentPaid: z.string(), + rentPaid: z.optional(z.lazy(() => NearTokenSchema())), signature: z.lazy(() => SignatureSchema()), timestamp: z.number(), timestampNanosec: z.string(), - totalSupply: z.string(), + totalSupply: z.lazy(() => NearTokenSchema()), validatorProposals: z.array(z.lazy(() => ValidatorStakeViewSchema())), - validatorReward: z.string(), + validatorReward: z.optional(z.lazy(() => NearTokenSchema())), }); export const BlockIdSchema = () => @@ -588,7 +613,7 @@ export const ChunkDistributionUrisSchema = () => // Contains main info about the chunk. export const ChunkHeaderViewSchema = () => z.object({ - balanceBurnt: z.string(), + balanceBurnt: z.lazy(() => NearTokenSchema()), bandwidthRequests: z.optional( z.union([z.lazy(() => BandwidthRequestsSchema()), z.null()]) ), @@ -606,12 +631,26 @@ export const ChunkHeaderViewSchema = () => outgoingReceiptsRoot: z.lazy(() => CryptoHashSchema()), prevBlockHash: z.lazy(() => CryptoHashSchema()), prevStateRoot: z.lazy(() => CryptoHashSchema()), - rentPaid: z.string(), + rentPaid: z.optional(z.lazy(() => NearTokenSchema())), shardId: z.lazy(() => ShardIdSchema()), signature: z.lazy(() => SignatureSchema()), txRoot: z.lazy(() => CryptoHashSchema()), validatorProposals: z.array(z.lazy(() => ValidatorStakeViewSchema())), - validatorReward: z.string(), + validatorReward: z.optional(z.lazy(() => NearTokenSchema())), + }); + +// +// Configuration for a cloud-based archival writer. If this config is present, +// the writer is enabled and writes chunk-related data based on the tracked +// shards. This config also controls additional archival behavior such as +// block data and polling interval. + +export const CloudArchivalWriterConfigSchema = () => + z.object({ + archiveBlockData: z.optional(z.boolean()), + pollingInterval: z.optional( + z.lazy(() => DurationAsStdSchemaProviderSchema()) + ), }); export const CompilationErrorSchema = () => @@ -705,7 +744,7 @@ export const CurrentEpochValidatorInfoSchema = () => publicKey: z.lazy(() => PublicKeySchema()), shards: z.array(z.lazy(() => ShardIdSchema())), shardsEndorsed: z.optional(z.array(z.lazy(() => ShardIdSchema()))), - stake: z.string(), + stake: z.lazy(() => NearTokenSchema()), }); // The fees settings for a data receipt creation @@ -765,6 +804,23 @@ export const DetailedDebugStatusSchema = () => syncStatus: z.string(), }); +export const DeterministicAccountStateInitSchema = () => + z.object({ + V1: z.lazy(() => DeterministicAccountStateInitV1Schema()), + }); + +export const DeterministicAccountStateInitV1Schema = () => + z.object({ + code: z.lazy(() => GlobalContractIdentifierSchema()), + data: z.record(z.string(), z.string()), + }); + +export const DeterministicStateInitActionSchema = () => + z.object({ + deposit: z.lazy(() => NearTokenSchema()), + stateInit: z.lazy(() => DeterministicAccountStateInitSchema()), + }); + export const DirectionSchema = () => z.enum(['Left', 'Right']); // Configures how to dump state to external storage. @@ -825,7 +881,7 @@ export const ExecutionOutcomeViewSchema = () => metadata: z.optional(z.lazy(() => ExecutionMetadataViewSchema())), receiptIds: z.array(z.lazy(() => CryptoHashSchema())), status: z.lazy(() => ExecutionStatusViewSchema()), - tokensBurnt: z.string(), + tokensBurnt: z.lazy(() => NearTokenSchema()), }); export const ExecutionOutcomeWithIdViewSchema = () => @@ -953,6 +1009,7 @@ export const ExternalStorageConfigSchema = () => numConcurrentRequestsDuringCatchup: z.optional(z.number()), }); +// Supported external storage backends and their minimal config. export const ExternalStorageLocationSchema = () => z.union([ z.object({ @@ -1038,7 +1095,7 @@ export const FunctionArgsSchema = () => z.string(); export const FunctionCallActionSchema = () => z.object({ args: z.string(), - deposit: z.string(), + deposit: z.lazy(() => NearTokenSchema()), gas: z.lazy(() => NearGasSchema()), methodName: z.string(), }); @@ -1082,7 +1139,7 @@ export const FunctionCallErrorSchema = () => export const FunctionCallPermissionSchema = () => z.object({ - allowance: z.optional(z.union([z.union([z.string(), z.null()]), z.null()])), + allowance: z.optional(z.union([z.lazy(() => NearTokenSchema()), z.null()])), methodNames: z.array(z.string()), receiverId: z.string(), }); @@ -1098,7 +1155,7 @@ export const GCConfigSchema = () => export const GasKeyViewSchema = () => z.object({ - balance: z.number(), + balance: z.lazy(() => NearTokenSchema()), numNonces: z.number(), permission: z.lazy(() => AccessKeyPermissionViewSchema()), }); @@ -1113,15 +1170,15 @@ export const GenesisConfigSchema = () => chunkValidatorOnlyKickoutThreshold: z.optional(z.number()), dynamicResharding: z.boolean(), epochLength: z.number(), - fishermenThreshold: z.string(), + fishermenThreshold: z.lazy(() => NearTokenSchema()), gasLimit: z.lazy(() => NearGasSchema()), gasPriceAdjustmentRate: z.array(z.number()), genesisHeight: z.number(), genesisTime: z.string(), - maxGasPrice: z.string(), + maxGasPrice: z.lazy(() => NearTokenSchema()), maxInflationRate: z.array(z.number()), maxKickoutStakePerc: z.optional(z.number()), - minGasPrice: z.string(), + minGasPrice: z.lazy(() => NearTokenSchema()), minimumStakeDivisor: z.optional(z.number()), minimumStakeRatio: z.optional(z.array(z.number())), minimumValidatorsPerShard: z.optional(z.number()), @@ -1140,7 +1197,7 @@ export const GenesisConfigSchema = () => shardLayout: z.optional(z.lazy(() => ShardLayoutSchema())), shuffleShardAssignmentForChunkProducers: z.optional(z.boolean()), targetValidatorMandatesPerShard: z.optional(z.number()), - totalSupply: z.string(), + totalSupply: z.lazy(() => NearTokenSchema()), transactionValidityPeriod: z.number(), useProductionConfig: z.optional(z.boolean()), validators: z.array(z.lazy(() => AccountInfoSchema())), @@ -1161,6 +1218,9 @@ export const GlobalContractIdentifierSchema = () => }), ]); +export const GlobalContractIdentifierViewSchema = () => + z.union([z.lazy(() => CryptoHashSchema()), z.lazy(() => AccountIdSchema())]); + export const HostErrorSchema = () => z.union([ z.enum(['BadUTF16']), @@ -1308,8 +1368,8 @@ export const InvalidAccessKeyErrorSchema = () => z.object({ NotEnoughAllowance: z.object({ accountId: z.lazy(() => AccountIdSchema()), - allowance: z.string(), - cost: z.string(), + allowance: z.lazy(() => NearTokenSchema()), + cost: z.lazy(() => NearTokenSchema()), publicKey: z.lazy(() => PublicKeySchema()), }), }), @@ -1352,14 +1412,14 @@ export const InvalidTxErrorSchema = () => z.enum(['InvalidSignature']), z.object({ NotEnoughBalance: z.object({ - balance: z.string(), - cost: z.string(), + balance: z.lazy(() => NearTokenSchema()), + cost: z.lazy(() => NearTokenSchema()), signerId: z.lazy(() => AccountIdSchema()), }), }), z.object({ LackBalanceForState: z.object({ - amount: z.string(), + amount: z.lazy(() => NearTokenSchema()), signerId: z.lazy(() => AccountIdSchema()), }), }), @@ -2121,6 +2181,8 @@ export const MutableConfigValueSchema = () => z.string(); export const NearGasSchema = () => z.number(); +export const NearTokenSchema = () => z.string(); + export const NetworkInfoViewSchema = () => z.object({ connectedPeers: z.array(z.lazy(() => PeerInfoViewSchema())), @@ -2137,7 +2199,7 @@ export const NextEpochValidatorInfoSchema = () => accountId: z.lazy(() => AccountIdSchema()), publicKey: z.lazy(() => PublicKeySchema()), shards: z.array(z.lazy(() => ShardIdSchema())), - stake: z.string(), + stake: z.lazy(() => NearTokenSchema()), }); // @@ -2177,6 +2239,11 @@ export const NonDelegateActionSchema = () => z.object({ UseGlobalContract: z.lazy(() => UseGlobalContractActionSchema()), }), + z.object({ + DeterministicStateInit: z.lazy(() => + DeterministicStateInitActionSchema() + ), + }), ]); // Peer id is the public key. @@ -2239,7 +2306,7 @@ export const ReceiptEnumViewSchema = () => z.object({ Action: z.object({ actions: z.array(z.lazy(() => ActionViewSchema())), - gasPrice: z.string(), + gasPrice: z.lazy(() => NearTokenSchema()), inputDataIds: z.array(z.lazy(() => CryptoHashSchema())), isPromiseYield: z.optional(z.boolean()), outputDataReceivers: z.array(z.lazy(() => DataReceiverViewSchema())), @@ -2376,7 +2443,12 @@ export const RpcClientConfigResponseSchema = () => chunkValidationThreads: z.number(), chunkWaitMult: z.array(z.number()), clientBackgroundMigrationThreads: z.number(), + cloudArchivalWriter: z.optional( + z.union([z.lazy(() => CloudArchivalWriterConfigSchema()), z.null()]) + ), doomslugStepPeriod: z.array(z.number()), + dynamicReshardingDryRun: z.boolean(), + enableEarlyPrepareTransactions: z.boolean(), enableMultilineLogging: z.boolean(), enableStatisticsExport: z.boolean(), epochLength: z.number(), @@ -2408,6 +2480,7 @@ export const RpcClientConfigResponseSchema = () => saveLatestWitnesses: z.boolean(), saveTrieChanges: z.boolean(), saveTxOutcomes: z.boolean(), + saveUntrackedPartialChunksParts: z.boolean(), skipSyncWait: z.boolean(), stateRequestServerThreads: z.number(), stateRequestThrottlePeriod: z.array(z.number()), @@ -2489,7 +2562,7 @@ export const RpcGasPriceRequestSchema = () => export const RpcGasPriceResponseSchema = () => z.object({ - gasPrice: z.string(), + gasPrice: z.lazy(() => NearTokenSchema()), }); export const RpcHealthRequestSchema = () => z.null(); @@ -2614,15 +2687,15 @@ export const RpcProtocolConfigResponseSchema = () => chunkValidatorOnlyKickoutThreshold: z.number(), dynamicResharding: z.boolean(), epochLength: z.number(), - fishermenThreshold: z.string(), + fishermenThreshold: z.lazy(() => NearTokenSchema()), gasLimit: z.lazy(() => NearGasSchema()), gasPriceAdjustmentRate: z.array(z.number()), genesisHeight: z.number(), genesisTime: z.string(), - maxGasPrice: z.string(), + maxGasPrice: z.lazy(() => NearTokenSchema()), maxInflationRate: z.array(z.number()), maxKickoutStakePerc: z.number(), - minGasPrice: z.string(), + minGasPrice: z.lazy(() => NearTokenSchema()), minimumStakeDivisor: z.number(), minimumStakeRatio: z.array(z.number()), minimumValidatorsPerShard: z.number(), @@ -3260,7 +3333,7 @@ export const RuntimeConfigViewSchema = () => z.object({ accountCreationConfig: z.lazy(() => AccountCreationConfigViewSchema()), congestionControlConfig: z.lazy(() => CongestionControlConfigViewSchema()), - storageAmountPerByte: z.string(), + storageAmountPerByte: z.lazy(() => NearTokenSchema()), transactionCosts: z.lazy(() => RuntimeFeesConfigViewSchema()), wasmConfig: z.lazy(() => VMConfigViewSchema()), witnessConfig: z.lazy(() => WitnessConfigViewSchema()), @@ -3430,7 +3503,7 @@ export const SlashedValidatorSchema = () => export const StakeActionSchema = () => z.object({ publicKey: z.lazy(() => PublicKeySchema()), - stake: z.string(), + stake: z.lazy(() => NearTokenSchema()), }); // See crate::types::StateChangeCause for details. @@ -3506,7 +3579,7 @@ export const StateChangeWithCauseViewSchema = () => z.object({ change: z.object({ accountId: z.lazy(() => AccountIdSchema()), - amount: z.string(), + amount: z.lazy(() => NearTokenSchema()), codeHash: z.lazy(() => CryptoHashSchema()), globalContractAccountId: z.optional( z.union([z.lazy(() => AccountIdSchema()), z.null()]) @@ -3514,7 +3587,7 @@ export const StateChangeWithCauseViewSchema = () => globalContractHash: z.optional( z.union([z.lazy(() => CryptoHashSchema()), z.null()]) ), - locked: z.string(), + locked: z.lazy(() => NearTokenSchema()), storagePaidAt: z.optional(z.number()), storageUsage: z.number(), }), @@ -3741,7 +3814,7 @@ export const TrackedShardsConfigSchema = () => export const TransferActionSchema = () => z.object({ - deposit: z.string(), + deposit: z.lazy(() => NearTokenSchema()), }); // Error returned in the ExecutionOutcome in case of failure @@ -3773,6 +3846,7 @@ export const UseGlobalContractActionSchema = () => export const VMConfigViewSchema = () => z.object({ + deterministicAccountIds: z.boolean(), discardCustomSections: z.boolean(), ethImplicitAccounts: z.boolean(), extCosts: z.lazy(() => ExtCostsConfigViewSchema()), @@ -3781,6 +3855,8 @@ export const VMConfigViewSchema = () => growMemCost: z.number(), implicitAccountCreation: z.boolean(), limitConfig: z.lazy(() => LimitConfigSchema()), + linearOpBaseCost: z.number(), + linearOpUnitCost: z.number(), reftypesBulkMemory: z.boolean(), regularOpCost: z.number(), saturatingFloatToInt: z.boolean(), @@ -3794,7 +3870,6 @@ export const VMKindSchema = () => z.enum(['Wasmtime']), z.enum(['Wasmer2']), z.enum(['NearVm']), - z.enum(['NearVm2']), ]); export const ValidatorInfoSchema = () => @@ -3821,8 +3896,8 @@ export const ValidatorKickoutReasonSchema = () => z.enum(['Unstaked']), z.object({ NotEnoughStake: z.object({ - stakeU128: z.string(), - thresholdU128: z.string(), + stakeU128: z.lazy(() => NearTokenSchema()), + thresholdU128: z.lazy(() => NearTokenSchema()), }), }), z.enum(['DidNotGetASeat']), @@ -3853,7 +3928,7 @@ export const ValidatorStakeViewV1Schema = () => z.object({ accountId: z.lazy(() => AccountIdSchema()), publicKey: z.lazy(() => PublicKeySchema()), - stake: z.string(), + stake: z.lazy(() => NearTokenSchema()), }); // Data structure for semver version and github tag or commit. diff --git a/packages/jsonrpc-types/src/types.ts b/packages/jsonrpc-types/src/types.ts index fec3dc5..82ccb08 100644 --- a/packages/jsonrpc-types/src/types.ts +++ b/packages/jsonrpc-types/src/types.ts @@ -1,5 +1,5 @@ // Auto-generated TypeScript types from NEAR OpenAPI spec using z.infer (zod/mini version) -// Generated on: 2025-09-12T17:20:47.123Z +// Generated on: 2025-11-08T06:05:00.554Z // Do not edit manually - run 'pnpm generate' to regenerate import { z } from 'zod/mini'; @@ -204,6 +204,16 @@ export type ChunkHeaderView = z.infer< ReturnType >; +/** + * Configuration for a cloud-based archival writer. If this config is present, + * the writer is enabled and writes chunk-related data based on the tracked + * shards. This config also controls additional archival behavior such as + * block data and polling interval. + */ +export type CloudArchivalWriterConfig = z.infer< + ReturnType +>; + export type CompilationError = z.infer< ReturnType >; @@ -283,6 +293,18 @@ export type DetailedDebugStatus = z.infer< ReturnType >; +export type DeterministicAccountStateInit = z.infer< + ReturnType +>; + +export type DeterministicAccountStateInitV1 = z.infer< + ReturnType +>; + +export type DeterministicStateInitAction = z.infer< + ReturnType +>; + export type Direction = z.infer>; /** Configures how to dump state to external storage. */ @@ -331,6 +353,7 @@ export type ExternalStorageConfig = z.infer< ReturnType >; +/** Supported external storage backends and their minimal config. */ export type ExternalStorageLocation = z.infer< ReturnType >; @@ -421,6 +444,10 @@ export type GlobalContractIdentifier = z.infer< ReturnType >; +export type GlobalContractIdentifierView = z.infer< + ReturnType +>; + export type HostError = z.infer>; export type InvalidAccessKeyError = z.infer< @@ -751,6 +778,8 @@ export type MutableConfigValue = z.infer< export type NearGas = z.infer>; +export type NearToken = z.infer>; + export type NetworkInfoView = z.infer< ReturnType >;