@psalomo/jsonrpc-client 1.0.1 → 1.0.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/browser-standalone.js +454 -249
- package/dist/browser-standalone.min.js +1 -1
- package/dist/client.d.ts +2 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.js +18 -9
- package/dist/index.mjs +18 -9
- package/package.json +2 -2
@@ -48,9 +48,11 @@ class JsonRpcClientError extends Error {
|
|
48
48
|
}
|
49
49
|
class JsonRpcNetworkError extends Error {
|
50
50
|
originalError;
|
51
|
-
|
51
|
+
responseBody;
|
52
|
+
constructor(message, originalError, responseBody) {
|
52
53
|
super(message);
|
53
54
|
this.originalError = originalError;
|
55
|
+
this.responseBody = responseBody;
|
54
56
|
this.name = 'JsonRpcNetworkError';
|
55
57
|
}
|
56
58
|
}
|
@@ -119,23 +121,29 @@ class NearRpcClient {
|
|
119
121
|
signal: controller.signal,
|
120
122
|
});
|
121
123
|
clearTimeout(timeoutId);
|
122
|
-
if (!response.ok) {
|
123
|
-
throw new JsonRpcNetworkError(`HTTP error! status: ${response.status}`);
|
124
|
-
}
|
125
124
|
let jsonResponse;
|
126
125
|
try {
|
127
126
|
jsonResponse = await response.json();
|
128
127
|
}
|
129
128
|
catch (parseError) {
|
129
|
+
// If we can't parse JSON and it's not a 2xx response, include status info
|
130
|
+
if (!response.ok) {
|
131
|
+
throw new JsonRpcNetworkError(`HTTP error! status: ${response.status} - Failed to parse JSON response`, parseError);
|
132
|
+
}
|
130
133
|
throw new JsonRpcNetworkError('Failed to parse JSON response', parseError);
|
131
134
|
}
|
132
|
-
//
|
133
|
-
if (this.validation) {
|
134
|
-
this.validation.validateResponse(jsonResponse);
|
135
|
-
}
|
135
|
+
// Check for JSON-RPC error in the response
|
136
136
|
if (jsonResponse.error) {
|
137
137
|
throw new JsonRpcClientError(jsonResponse.error.message, jsonResponse.error.code, jsonResponse.error.data);
|
138
138
|
}
|
139
|
+
// If it's not a 2xx status and no JSON-RPC error, throw network error with body
|
140
|
+
if (!response.ok) {
|
141
|
+
throw new JsonRpcNetworkError(`HTTP error! status: ${response.status}`, undefined, jsonResponse);
|
142
|
+
}
|
143
|
+
// Validate basic JSON-RPC response structure
|
144
|
+
if (this.validation) {
|
145
|
+
this.validation.validateResponse(jsonResponse);
|
146
|
+
}
|
139
147
|
// Convert snake_case response back to camelCase
|
140
148
|
const camelCaseResult = jsonResponse.result
|
141
149
|
? convertKeysToCamelCase(jsonResponse.result)
|
@@ -2762,190 +2770,328 @@ var JsonRpcRequestForValidatorsSchema = () => object({
|
|
2762
2770
|
method: _enum(["validators"]),
|
2763
2771
|
params: _lazy(() => RpcValidatorRequestSchema())
|
2764
2772
|
});
|
2765
|
-
var JsonRpcResponseFor_ArrayOf_RangeOfUint64And_RpcErrorSchema = () =>
|
2766
|
-
|
2767
|
-
|
2768
|
-
|
2773
|
+
var JsonRpcResponseFor_ArrayOf_RangeOfUint64And_RpcErrorSchema = () => intersection(
|
2774
|
+
union([
|
2775
|
+
object({
|
2776
|
+
result: array(_lazy(() => RangeOfUint64Schema()))
|
2777
|
+
}),
|
2778
|
+
object({
|
2779
|
+
error: _lazy(() => RpcErrorSchema())
|
2780
|
+
})
|
2781
|
+
]),
|
2769
2782
|
object({
|
2770
|
-
|
2783
|
+
id: string(),
|
2784
|
+
jsonrpc: string()
|
2771
2785
|
})
|
2772
|
-
|
2773
|
-
var JsonRpcResponseFor_ArrayOf_ValidatorStakeViewAnd_RpcErrorSchema = () =>
|
2774
|
-
|
2775
|
-
|
2776
|
-
|
2786
|
+
);
|
2787
|
+
var JsonRpcResponseFor_ArrayOf_ValidatorStakeViewAnd_RpcErrorSchema = () => intersection(
|
2788
|
+
union([
|
2789
|
+
object({
|
2790
|
+
result: array(_lazy(() => ValidatorStakeViewSchema()))
|
2791
|
+
}),
|
2792
|
+
object({
|
2793
|
+
error: _lazy(() => RpcErrorSchema())
|
2794
|
+
})
|
2795
|
+
]),
|
2777
2796
|
object({
|
2778
|
-
|
2797
|
+
id: string(),
|
2798
|
+
jsonrpc: string()
|
2779
2799
|
})
|
2780
|
-
|
2781
|
-
var JsonRpcResponseFor_CryptoHashAnd_RpcErrorSchema = () =>
|
2782
|
-
|
2783
|
-
|
2784
|
-
|
2800
|
+
);
|
2801
|
+
var JsonRpcResponseFor_CryptoHashAnd_RpcErrorSchema = () => intersection(
|
2802
|
+
union([
|
2803
|
+
object({
|
2804
|
+
result: _lazy(() => CryptoHashSchema())
|
2805
|
+
}),
|
2806
|
+
object({
|
2807
|
+
error: _lazy(() => RpcErrorSchema())
|
2808
|
+
})
|
2809
|
+
]),
|
2785
2810
|
object({
|
2786
|
-
|
2811
|
+
id: string(),
|
2812
|
+
jsonrpc: string()
|
2787
2813
|
})
|
2788
|
-
|
2789
|
-
var JsonRpcResponseFor_GenesisConfigAnd_RpcErrorSchema = () =>
|
2790
|
-
|
2791
|
-
|
2792
|
-
|
2814
|
+
);
|
2815
|
+
var JsonRpcResponseFor_GenesisConfigAnd_RpcErrorSchema = () => intersection(
|
2816
|
+
union([
|
2817
|
+
object({
|
2818
|
+
result: _lazy(() => GenesisConfigSchema())
|
2819
|
+
}),
|
2820
|
+
object({
|
2821
|
+
error: _lazy(() => RpcErrorSchema())
|
2822
|
+
})
|
2823
|
+
]),
|
2793
2824
|
object({
|
2794
|
-
|
2825
|
+
id: string(),
|
2826
|
+
jsonrpc: string()
|
2795
2827
|
})
|
2796
|
-
|
2797
|
-
var JsonRpcResponseFor_Nullable_RpcHealthResponseAnd_RpcErrorSchema = () =>
|
2798
|
-
|
2799
|
-
|
2800
|
-
|
2828
|
+
);
|
2829
|
+
var JsonRpcResponseFor_Nullable_RpcHealthResponseAnd_RpcErrorSchema = () => intersection(
|
2830
|
+
union([
|
2831
|
+
object({
|
2832
|
+
result: union([_lazy(() => RpcHealthResponseSchema()), _null()])
|
2833
|
+
}),
|
2834
|
+
object({
|
2835
|
+
error: _lazy(() => RpcErrorSchema())
|
2836
|
+
})
|
2837
|
+
]),
|
2801
2838
|
object({
|
2802
|
-
|
2839
|
+
id: string(),
|
2840
|
+
jsonrpc: string()
|
2803
2841
|
})
|
2804
|
-
|
2805
|
-
var JsonRpcResponseFor_RpcBlockResponseAnd_RpcErrorSchema = () =>
|
2806
|
-
|
2807
|
-
|
2808
|
-
|
2842
|
+
);
|
2843
|
+
var JsonRpcResponseFor_RpcBlockResponseAnd_RpcErrorSchema = () => intersection(
|
2844
|
+
union([
|
2845
|
+
object({
|
2846
|
+
result: _lazy(() => RpcBlockResponseSchema())
|
2847
|
+
}),
|
2848
|
+
object({
|
2849
|
+
error: _lazy(() => RpcErrorSchema())
|
2850
|
+
})
|
2851
|
+
]),
|
2809
2852
|
object({
|
2810
|
-
|
2853
|
+
id: string(),
|
2854
|
+
jsonrpc: string()
|
2811
2855
|
})
|
2812
|
-
|
2813
|
-
var JsonRpcResponseFor_RpcChunkResponseAnd_RpcErrorSchema = () =>
|
2814
|
-
|
2815
|
-
|
2816
|
-
|
2856
|
+
);
|
2857
|
+
var JsonRpcResponseFor_RpcChunkResponseAnd_RpcErrorSchema = () => intersection(
|
2858
|
+
union([
|
2859
|
+
object({
|
2860
|
+
result: _lazy(() => RpcChunkResponseSchema())
|
2861
|
+
}),
|
2862
|
+
object({
|
2863
|
+
error: _lazy(() => RpcErrorSchema())
|
2864
|
+
})
|
2865
|
+
]),
|
2817
2866
|
object({
|
2818
|
-
|
2867
|
+
id: string(),
|
2868
|
+
jsonrpc: string()
|
2819
2869
|
})
|
2820
|
-
|
2821
|
-
var JsonRpcResponseFor_RpcClientConfigResponseAnd_RpcErrorSchema = () =>
|
2822
|
-
|
2823
|
-
|
2824
|
-
|
2870
|
+
);
|
2871
|
+
var JsonRpcResponseFor_RpcClientConfigResponseAnd_RpcErrorSchema = () => intersection(
|
2872
|
+
union([
|
2873
|
+
object({
|
2874
|
+
result: _lazy(() => RpcClientConfigResponseSchema())
|
2875
|
+
}),
|
2876
|
+
object({
|
2877
|
+
error: _lazy(() => RpcErrorSchema())
|
2878
|
+
})
|
2879
|
+
]),
|
2825
2880
|
object({
|
2826
|
-
|
2881
|
+
id: string(),
|
2882
|
+
jsonrpc: string()
|
2827
2883
|
})
|
2828
|
-
|
2829
|
-
var JsonRpcResponseFor_RpcCongestionLevelResponseAnd_RpcErrorSchema = () =>
|
2830
|
-
|
2831
|
-
|
2832
|
-
|
2884
|
+
);
|
2885
|
+
var JsonRpcResponseFor_RpcCongestionLevelResponseAnd_RpcErrorSchema = () => intersection(
|
2886
|
+
union([
|
2887
|
+
object({
|
2888
|
+
result: _lazy(() => RpcCongestionLevelResponseSchema())
|
2889
|
+
}),
|
2890
|
+
object({
|
2891
|
+
error: _lazy(() => RpcErrorSchema())
|
2892
|
+
})
|
2893
|
+
]),
|
2833
2894
|
object({
|
2834
|
-
|
2895
|
+
id: string(),
|
2896
|
+
jsonrpc: string()
|
2835
2897
|
})
|
2836
|
-
|
2837
|
-
var JsonRpcResponseFor_RpcGasPriceResponseAnd_RpcErrorSchema = () =>
|
2838
|
-
|
2839
|
-
|
2840
|
-
|
2898
|
+
);
|
2899
|
+
var JsonRpcResponseFor_RpcGasPriceResponseAnd_RpcErrorSchema = () => intersection(
|
2900
|
+
union([
|
2901
|
+
object({
|
2902
|
+
result: _lazy(() => RpcGasPriceResponseSchema())
|
2903
|
+
}),
|
2904
|
+
object({
|
2905
|
+
error: _lazy(() => RpcErrorSchema())
|
2906
|
+
})
|
2907
|
+
]),
|
2841
2908
|
object({
|
2842
|
-
|
2909
|
+
id: string(),
|
2910
|
+
jsonrpc: string()
|
2843
2911
|
})
|
2844
|
-
|
2845
|
-
var JsonRpcResponseFor_RpcLightClientBlockProofResponseAnd_RpcErrorSchema = () =>
|
2846
|
-
|
2847
|
-
|
2848
|
-
|
2912
|
+
);
|
2913
|
+
var JsonRpcResponseFor_RpcLightClientBlockProofResponseAnd_RpcErrorSchema = () => intersection(
|
2914
|
+
union([
|
2915
|
+
object({
|
2916
|
+
result: _lazy(() => RpcLightClientBlockProofResponseSchema())
|
2917
|
+
}),
|
2918
|
+
object({
|
2919
|
+
error: _lazy(() => RpcErrorSchema())
|
2920
|
+
})
|
2921
|
+
]),
|
2849
2922
|
object({
|
2850
|
-
|
2923
|
+
id: string(),
|
2924
|
+
jsonrpc: string()
|
2851
2925
|
})
|
2852
|
-
|
2853
|
-
var JsonRpcResponseFor_RpcLightClientExecutionProofResponseAnd_RpcErrorSchema = () =>
|
2854
|
-
|
2855
|
-
|
2856
|
-
|
2926
|
+
);
|
2927
|
+
var JsonRpcResponseFor_RpcLightClientExecutionProofResponseAnd_RpcErrorSchema = () => intersection(
|
2928
|
+
union([
|
2929
|
+
object({
|
2930
|
+
result: _lazy(() => RpcLightClientExecutionProofResponseSchema())
|
2931
|
+
}),
|
2932
|
+
object({
|
2933
|
+
error: _lazy(() => RpcErrorSchema())
|
2934
|
+
})
|
2935
|
+
]),
|
2857
2936
|
object({
|
2858
|
-
|
2937
|
+
id: string(),
|
2938
|
+
jsonrpc: string()
|
2859
2939
|
})
|
2860
|
-
|
2861
|
-
var JsonRpcResponseFor_RpcLightClientNextBlockResponseAnd_RpcErrorSchema = () =>
|
2862
|
-
|
2863
|
-
|
2864
|
-
|
2940
|
+
);
|
2941
|
+
var JsonRpcResponseFor_RpcLightClientNextBlockResponseAnd_RpcErrorSchema = () => intersection(
|
2942
|
+
union([
|
2943
|
+
object({
|
2944
|
+
result: _lazy(() => RpcLightClientNextBlockResponseSchema())
|
2945
|
+
}),
|
2946
|
+
object({
|
2947
|
+
error: _lazy(() => RpcErrorSchema())
|
2948
|
+
})
|
2949
|
+
]),
|
2865
2950
|
object({
|
2866
|
-
|
2951
|
+
id: string(),
|
2952
|
+
jsonrpc: string()
|
2867
2953
|
})
|
2868
|
-
|
2869
|
-
var JsonRpcResponseFor_RpcNetworkInfoResponseAnd_RpcErrorSchema = () =>
|
2870
|
-
|
2871
|
-
|
2872
|
-
|
2954
|
+
);
|
2955
|
+
var JsonRpcResponseFor_RpcNetworkInfoResponseAnd_RpcErrorSchema = () => intersection(
|
2956
|
+
union([
|
2957
|
+
object({
|
2958
|
+
result: _lazy(() => RpcNetworkInfoResponseSchema())
|
2959
|
+
}),
|
2960
|
+
object({
|
2961
|
+
error: _lazy(() => RpcErrorSchema())
|
2962
|
+
})
|
2963
|
+
]),
|
2873
2964
|
object({
|
2874
|
-
|
2965
|
+
id: string(),
|
2966
|
+
jsonrpc: string()
|
2875
2967
|
})
|
2876
|
-
|
2877
|
-
var JsonRpcResponseFor_RpcProtocolConfigResponseAnd_RpcErrorSchema = () =>
|
2878
|
-
|
2879
|
-
|
2880
|
-
|
2968
|
+
);
|
2969
|
+
var JsonRpcResponseFor_RpcProtocolConfigResponseAnd_RpcErrorSchema = () => intersection(
|
2970
|
+
union([
|
2971
|
+
object({
|
2972
|
+
result: _lazy(() => RpcProtocolConfigResponseSchema())
|
2973
|
+
}),
|
2974
|
+
object({
|
2975
|
+
error: _lazy(() => RpcErrorSchema())
|
2976
|
+
})
|
2977
|
+
]),
|
2881
2978
|
object({
|
2882
|
-
|
2979
|
+
id: string(),
|
2980
|
+
jsonrpc: string()
|
2883
2981
|
})
|
2884
|
-
|
2885
|
-
var JsonRpcResponseFor_RpcQueryResponseAnd_RpcErrorSchema = () =>
|
2886
|
-
|
2887
|
-
|
2888
|
-
|
2982
|
+
);
|
2983
|
+
var JsonRpcResponseFor_RpcQueryResponseAnd_RpcErrorSchema = () => intersection(
|
2984
|
+
union([
|
2985
|
+
object({
|
2986
|
+
result: _lazy(() => RpcQueryResponseSchema())
|
2987
|
+
}),
|
2988
|
+
object({
|
2989
|
+
error: _lazy(() => RpcErrorSchema())
|
2990
|
+
})
|
2991
|
+
]),
|
2889
2992
|
object({
|
2890
|
-
|
2993
|
+
id: string(),
|
2994
|
+
jsonrpc: string()
|
2891
2995
|
})
|
2892
|
-
|
2893
|
-
var JsonRpcResponseFor_RpcReceiptResponseAnd_RpcErrorSchema = () =>
|
2894
|
-
|
2895
|
-
|
2896
|
-
|
2996
|
+
);
|
2997
|
+
var JsonRpcResponseFor_RpcReceiptResponseAnd_RpcErrorSchema = () => intersection(
|
2998
|
+
union([
|
2999
|
+
object({
|
3000
|
+
result: _lazy(() => RpcReceiptResponseSchema())
|
3001
|
+
}),
|
3002
|
+
object({
|
3003
|
+
error: _lazy(() => RpcErrorSchema())
|
3004
|
+
})
|
3005
|
+
]),
|
2897
3006
|
object({
|
2898
|
-
|
3007
|
+
id: string(),
|
3008
|
+
jsonrpc: string()
|
2899
3009
|
})
|
2900
|
-
|
2901
|
-
var JsonRpcResponseFor_RpcSplitStorageInfoResponseAnd_RpcErrorSchema = () =>
|
2902
|
-
|
2903
|
-
|
2904
|
-
|
3010
|
+
);
|
3011
|
+
var JsonRpcResponseFor_RpcSplitStorageInfoResponseAnd_RpcErrorSchema = () => intersection(
|
3012
|
+
union([
|
3013
|
+
object({
|
3014
|
+
result: _lazy(() => RpcSplitStorageInfoResponseSchema())
|
3015
|
+
}),
|
3016
|
+
object({
|
3017
|
+
error: _lazy(() => RpcErrorSchema())
|
3018
|
+
})
|
3019
|
+
]),
|
2905
3020
|
object({
|
2906
|
-
|
3021
|
+
id: string(),
|
3022
|
+
jsonrpc: string()
|
2907
3023
|
})
|
2908
|
-
|
2909
|
-
var JsonRpcResponseFor_RpcStateChangesInBlockByTypeResponseAnd_RpcErrorSchema = () =>
|
2910
|
-
|
2911
|
-
|
2912
|
-
|
3024
|
+
);
|
3025
|
+
var JsonRpcResponseFor_RpcStateChangesInBlockByTypeResponseAnd_RpcErrorSchema = () => intersection(
|
3026
|
+
union([
|
3027
|
+
object({
|
3028
|
+
result: _lazy(() => RpcStateChangesInBlockByTypeResponseSchema())
|
3029
|
+
}),
|
3030
|
+
object({
|
3031
|
+
error: _lazy(() => RpcErrorSchema())
|
3032
|
+
})
|
3033
|
+
]),
|
2913
3034
|
object({
|
2914
|
-
|
3035
|
+
id: string(),
|
3036
|
+
jsonrpc: string()
|
2915
3037
|
})
|
2916
|
-
|
2917
|
-
var JsonRpcResponseFor_RpcStateChangesInBlockResponseAnd_RpcErrorSchema = () =>
|
2918
|
-
|
2919
|
-
|
2920
|
-
|
3038
|
+
);
|
3039
|
+
var JsonRpcResponseFor_RpcStateChangesInBlockResponseAnd_RpcErrorSchema = () => intersection(
|
3040
|
+
union([
|
3041
|
+
object({
|
3042
|
+
result: _lazy(() => RpcStateChangesInBlockResponseSchema())
|
3043
|
+
}),
|
3044
|
+
object({
|
3045
|
+
error: _lazy(() => RpcErrorSchema())
|
3046
|
+
})
|
3047
|
+
]),
|
2921
3048
|
object({
|
2922
|
-
|
3049
|
+
id: string(),
|
3050
|
+
jsonrpc: string()
|
2923
3051
|
})
|
2924
|
-
|
2925
|
-
var JsonRpcResponseFor_RpcStatusResponseAnd_RpcErrorSchema = () =>
|
2926
|
-
|
2927
|
-
|
2928
|
-
|
3052
|
+
);
|
3053
|
+
var JsonRpcResponseFor_RpcStatusResponseAnd_RpcErrorSchema = () => intersection(
|
3054
|
+
union([
|
3055
|
+
object({
|
3056
|
+
result: _lazy(() => RpcStatusResponseSchema())
|
3057
|
+
}),
|
3058
|
+
object({
|
3059
|
+
error: _lazy(() => RpcErrorSchema())
|
3060
|
+
})
|
3061
|
+
]),
|
2929
3062
|
object({
|
2930
|
-
|
3063
|
+
id: string(),
|
3064
|
+
jsonrpc: string()
|
2931
3065
|
})
|
2932
|
-
|
2933
|
-
var JsonRpcResponseFor_RpcTransactionResponseAnd_RpcErrorSchema = () =>
|
2934
|
-
|
2935
|
-
|
2936
|
-
|
3066
|
+
);
|
3067
|
+
var JsonRpcResponseFor_RpcTransactionResponseAnd_RpcErrorSchema = () => intersection(
|
3068
|
+
union([
|
3069
|
+
object({
|
3070
|
+
result: _lazy(() => RpcTransactionResponseSchema())
|
3071
|
+
}),
|
3072
|
+
object({
|
3073
|
+
error: _lazy(() => RpcErrorSchema())
|
3074
|
+
})
|
3075
|
+
]),
|
2937
3076
|
object({
|
2938
|
-
|
3077
|
+
id: string(),
|
3078
|
+
jsonrpc: string()
|
2939
3079
|
})
|
2940
|
-
|
2941
|
-
var JsonRpcResponseFor_RpcValidatorResponseAnd_RpcErrorSchema = () =>
|
2942
|
-
|
2943
|
-
|
2944
|
-
|
3080
|
+
);
|
3081
|
+
var JsonRpcResponseFor_RpcValidatorResponseAnd_RpcErrorSchema = () => intersection(
|
3082
|
+
union([
|
3083
|
+
object({
|
3084
|
+
result: _lazy(() => RpcValidatorResponseSchema())
|
3085
|
+
}),
|
3086
|
+
object({
|
3087
|
+
error: _lazy(() => RpcErrorSchema())
|
3088
|
+
})
|
3089
|
+
]),
|
2945
3090
|
object({
|
2946
|
-
|
3091
|
+
id: string(),
|
3092
|
+
jsonrpc: string()
|
2947
3093
|
})
|
2948
|
-
|
3094
|
+
);
|
2949
3095
|
var KnownProducerViewSchema = () => object({
|
2950
3096
|
accountId: _lazy(() => AccountIdSchema()),
|
2951
3097
|
nextHops: optional(array(_lazy(() => PublicKeySchema()))),
|
@@ -3243,20 +3389,29 @@ var RpcCongestionLevelRequestSchema = () => union([
|
|
3243
3389
|
var RpcCongestionLevelResponseSchema = () => object({
|
3244
3390
|
congestionLevel: number()
|
3245
3391
|
});
|
3246
|
-
var RpcErrorSchema = () =>
|
3247
|
-
|
3248
|
-
|
3249
|
-
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3254
|
-
|
3392
|
+
var RpcErrorSchema = () => intersection(
|
3393
|
+
union([
|
3394
|
+
object({
|
3395
|
+
cause: _lazy(() => RpcRequestValidationErrorKindSchema()),
|
3396
|
+
name: _enum(["REQUEST_VALIDATION_ERROR"])
|
3397
|
+
}),
|
3398
|
+
object({
|
3399
|
+
cause: unknown(),
|
3400
|
+
name: _enum(["HANDLER_ERROR"])
|
3401
|
+
}),
|
3402
|
+
object({
|
3403
|
+
cause: unknown(),
|
3404
|
+
name: _enum(["INTERNAL_ERROR"])
|
3405
|
+
})
|
3406
|
+
]),
|
3255
3407
|
object({
|
3256
|
-
cause: unknown(),
|
3257
|
-
|
3408
|
+
cause: optional(unknown()),
|
3409
|
+
code: number(),
|
3410
|
+
data: optional(unknown()),
|
3411
|
+
message: string(),
|
3412
|
+
name: optional(unknown())
|
3258
3413
|
})
|
3259
|
-
|
3414
|
+
);
|
3260
3415
|
var RpcGasPriceRequestSchema = () => object({
|
3261
3416
|
blockId: optional(union([_lazy(() => BlockIdSchema()), _null()]))
|
3262
3417
|
});
|
@@ -3278,18 +3433,23 @@ var RpcLightClientBlockProofResponseSchema = () => object({
|
|
3278
3433
|
blockHeaderLite: _lazy(() => LightClientBlockLiteViewSchema()),
|
3279
3434
|
blockProof: array(_lazy(() => MerklePathItemSchema()))
|
3280
3435
|
});
|
3281
|
-
var RpcLightClientExecutionProofRequestSchema = () =>
|
3282
|
-
|
3283
|
-
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3436
|
+
var RpcLightClientExecutionProofRequestSchema = () => intersection(
|
3437
|
+
union([
|
3438
|
+
object({
|
3439
|
+
senderId: _lazy(() => AccountIdSchema()),
|
3440
|
+
transactionHash: _lazy(() => CryptoHashSchema()),
|
3441
|
+
type: _enum(["transaction"])
|
3442
|
+
}),
|
3443
|
+
object({
|
3444
|
+
receiptId: _lazy(() => CryptoHashSchema()),
|
3445
|
+
receiverId: _lazy(() => AccountIdSchema()),
|
3446
|
+
type: _enum(["receipt"])
|
3447
|
+
})
|
3448
|
+
]),
|
3287
3449
|
object({
|
3288
|
-
|
3289
|
-
receiverId: _lazy(() => AccountIdSchema()),
|
3290
|
-
type: _enum(["receipt"])
|
3450
|
+
lightClientHead: _lazy(() => CryptoHashSchema())
|
3291
3451
|
})
|
3292
|
-
|
3452
|
+
);
|
3293
3453
|
var RpcLightClientExecutionProofResponseSchema = () => object({
|
3294
3454
|
blockHeaderLite: _lazy(() => LightClientBlockLiteViewSchema()),
|
3295
3455
|
blockProof: array(_lazy(() => MerklePathItemSchema())),
|
@@ -4006,6 +4166,46 @@ var StakeActionSchema = () => object({
|
|
4006
4166
|
publicKey: _lazy(() => PublicKeySchema()),
|
4007
4167
|
stake: string()
|
4008
4168
|
});
|
4169
|
+
var StateChangeCauseViewSchema = () => union([
|
4170
|
+
object({
|
4171
|
+
type: _enum(["not_writable_to_disk"])
|
4172
|
+
}),
|
4173
|
+
object({
|
4174
|
+
type: _enum(["initial_state"])
|
4175
|
+
}),
|
4176
|
+
object({
|
4177
|
+
txHash: _lazy(() => CryptoHashSchema()),
|
4178
|
+
type: _enum(["transaction_processing"])
|
4179
|
+
}),
|
4180
|
+
object({
|
4181
|
+
receiptHash: _lazy(() => CryptoHashSchema()),
|
4182
|
+
type: _enum(["action_receipt_processing_started"])
|
4183
|
+
}),
|
4184
|
+
object({
|
4185
|
+
receiptHash: _lazy(() => CryptoHashSchema()),
|
4186
|
+
type: _enum(["action_receipt_gas_reward"])
|
4187
|
+
}),
|
4188
|
+
object({
|
4189
|
+
receiptHash: _lazy(() => CryptoHashSchema()),
|
4190
|
+
type: _enum(["receipt_processing"])
|
4191
|
+
}),
|
4192
|
+
object({
|
4193
|
+
receiptHash: _lazy(() => CryptoHashSchema()),
|
4194
|
+
type: _enum(["postponed_receipt"])
|
4195
|
+
}),
|
4196
|
+
object({
|
4197
|
+
type: _enum(["updated_delayed_receipts"])
|
4198
|
+
}),
|
4199
|
+
object({
|
4200
|
+
type: _enum(["validator_accounts_update"])
|
4201
|
+
}),
|
4202
|
+
object({
|
4203
|
+
type: _enum(["migration"])
|
4204
|
+
}),
|
4205
|
+
object({
|
4206
|
+
type: _enum(["bandwidth_scheduler_state_update"])
|
4207
|
+
})
|
4208
|
+
]);
|
4009
4209
|
var StateChangeKindViewSchema = () => union([
|
4010
4210
|
object({
|
4011
4211
|
accountId: _lazy(() => AccountIdSchema()),
|
@@ -4024,98 +4224,103 @@ var StateChangeKindViewSchema = () => union([
|
|
4024
4224
|
type: _enum(["contract_code_touched"])
|
4025
4225
|
})
|
4026
4226
|
]);
|
4027
|
-
var StateChangeWithCauseViewSchema = () =>
|
4028
|
-
|
4029
|
-
|
4030
|
-
|
4031
|
-
|
4032
|
-
|
4033
|
-
|
4034
|
-
|
4035
|
-
|
4036
|
-
|
4037
|
-
|
4038
|
-
|
4039
|
-
|
4040
|
-
|
4041
|
-
|
4227
|
+
var StateChangeWithCauseViewSchema = () => intersection(
|
4228
|
+
union([
|
4229
|
+
object({
|
4230
|
+
change: object({
|
4231
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4232
|
+
amount: string(),
|
4233
|
+
codeHash: _lazy(() => CryptoHashSchema()),
|
4234
|
+
globalContractAccountId: optional(
|
4235
|
+
union([_lazy(() => AccountIdSchema()), _null()])
|
4236
|
+
),
|
4237
|
+
globalContractHash: optional(
|
4238
|
+
union([_lazy(() => CryptoHashSchema()), _null()])
|
4239
|
+
),
|
4240
|
+
locked: string(),
|
4241
|
+
storagePaidAt: optional(number()),
|
4242
|
+
storageUsage: number()
|
4243
|
+
}),
|
4244
|
+
type: _enum(["account_update"])
|
4042
4245
|
}),
|
4043
|
-
|
4044
|
-
|
4045
|
-
|
4046
|
-
|
4047
|
-
|
4246
|
+
object({
|
4247
|
+
change: object({
|
4248
|
+
accountId: _lazy(() => AccountIdSchema())
|
4249
|
+
}),
|
4250
|
+
type: _enum(["account_deletion"])
|
4048
4251
|
}),
|
4049
|
-
|
4050
|
-
|
4051
|
-
|
4052
|
-
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4252
|
+
object({
|
4253
|
+
change: object({
|
4254
|
+
accessKey: _lazy(() => AccessKeyViewSchema()),
|
4255
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4256
|
+
publicKey: _lazy(() => PublicKeySchema())
|
4257
|
+
}),
|
4258
|
+
type: _enum(["access_key_update"])
|
4056
4259
|
}),
|
4057
|
-
|
4058
|
-
|
4059
|
-
|
4060
|
-
|
4061
|
-
|
4062
|
-
|
4260
|
+
object({
|
4261
|
+
change: object({
|
4262
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4263
|
+
publicKey: _lazy(() => PublicKeySchema())
|
4264
|
+
}),
|
4265
|
+
type: _enum(["access_key_deletion"])
|
4063
4266
|
}),
|
4064
|
-
|
4065
|
-
|
4066
|
-
|
4067
|
-
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4267
|
+
object({
|
4268
|
+
change: object({
|
4269
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4270
|
+
gasKey: _lazy(() => GasKeyViewSchema()),
|
4271
|
+
publicKey: _lazy(() => PublicKeySchema())
|
4272
|
+
}),
|
4273
|
+
type: _enum(["gas_key_update"])
|
4071
4274
|
}),
|
4072
|
-
|
4073
|
-
|
4074
|
-
|
4075
|
-
|
4076
|
-
|
4077
|
-
|
4078
|
-
|
4079
|
-
|
4275
|
+
object({
|
4276
|
+
change: object({
|
4277
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4278
|
+
index: number(),
|
4279
|
+
nonce: number(),
|
4280
|
+
publicKey: _lazy(() => PublicKeySchema())
|
4281
|
+
}),
|
4282
|
+
type: _enum(["gas_key_nonce_update"])
|
4080
4283
|
}),
|
4081
|
-
|
4082
|
-
|
4083
|
-
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4284
|
+
object({
|
4285
|
+
change: object({
|
4286
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4287
|
+
publicKey: _lazy(() => PublicKeySchema())
|
4288
|
+
}),
|
4289
|
+
type: _enum(["gas_key_deletion"])
|
4087
4290
|
}),
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
|
4291
|
+
object({
|
4292
|
+
change: object({
|
4293
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4294
|
+
keyBase64: _lazy(() => StoreKeySchema()),
|
4295
|
+
valueBase64: _lazy(() => StoreValueSchema())
|
4296
|
+
}),
|
4297
|
+
type: _enum(["data_update"])
|
4095
4298
|
}),
|
4096
|
-
|
4097
|
-
|
4098
|
-
|
4099
|
-
|
4100
|
-
|
4101
|
-
|
4299
|
+
object({
|
4300
|
+
change: object({
|
4301
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4302
|
+
keyBase64: _lazy(() => StoreKeySchema())
|
4303
|
+
}),
|
4304
|
+
type: _enum(["data_deletion"])
|
4102
4305
|
}),
|
4103
|
-
|
4104
|
-
|
4105
|
-
|
4106
|
-
|
4107
|
-
|
4108
|
-
|
4306
|
+
object({
|
4307
|
+
change: object({
|
4308
|
+
accountId: _lazy(() => AccountIdSchema()),
|
4309
|
+
codeBase64: string()
|
4310
|
+
}),
|
4311
|
+
type: _enum(["contract_code_update"])
|
4109
4312
|
}),
|
4110
|
-
|
4111
|
-
|
4313
|
+
object({
|
4314
|
+
change: object({
|
4315
|
+
accountId: _lazy(() => AccountIdSchema())
|
4316
|
+
}),
|
4317
|
+
type: _enum(["contract_code_deletion"])
|
4318
|
+
})
|
4319
|
+
]),
|
4112
4320
|
object({
|
4113
|
-
|
4114
|
-
accountId: _lazy(() => AccountIdSchema())
|
4115
|
-
}),
|
4116
|
-
type: _enum(["contract_code_deletion"])
|
4321
|
+
cause: _lazy(() => StateChangeCauseViewSchema())
|
4117
4322
|
})
|
4118
|
-
|
4323
|
+
);
|
4119
4324
|
var StateItemSchema = () => object({
|
4120
4325
|
key: _lazy(() => StoreKeySchema()),
|
4121
4326
|
value: _lazy(() => StoreValueSchema())
|
@@ -4558,7 +4763,7 @@ Object.entries(PATH_TO_METHOD_MAP).forEach(([path, method]) => {
|
|
4558
4763
|
var RPC_METHODS = Object.values(PATH_TO_METHOD_MAP);
|
4559
4764
|
|
4560
4765
|
// Auto-generated static RPC functions for tree-shaking
|
4561
|
-
// Generated at: 2025-07-
|
4766
|
+
// Generated at: 2025-07-28T13:29:57.104Z
|
4562
4767
|
// Total functions: 28
|
4563
4768
|
//
|
4564
4769
|
// This file is automatically generated by tools/codegen/generate-client-interface.ts
|