@xyo-network/xl1-rpc 1.14.0 → 1.14.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/neutral/engine/rpcEngineFromProvider.d.ts +2 -2
- package/dist/neutral/engine/rpcEngineFromProvider.d.ts.map +1 -1
- package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts +2 -2
- package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts.map +1 -1
- package/dist/neutral/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/neutral/index.mjs +209 -107
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/connection/HttpRpcXyoConnection.d.ts +4 -4
- package/dist/neutral/provider/connection/HttpRpcXyoConnection.d.ts.map +1 -1
- package/dist/neutral/provider/connection/{XyoConnection.d.ts → XyoBaseConnection.d.ts} +5 -5
- package/dist/neutral/provider/connection/XyoBaseConnection.d.ts.map +1 -0
- package/dist/neutral/provider/connection/index.d.ts +1 -1
- package/dist/neutral/provider/connection/index.d.ts.map +1 -1
- package/dist/neutral/provider/datalake/AbstractXyoDataLake.d.ts +2 -2
- package/dist/neutral/provider/datalake/AbstractXyoDataLake.d.ts.map +1 -1
- package/dist/neutral/provider/gateway/Abstract.d.ts +2 -2
- package/dist/neutral/provider/gateway/Abstract.d.ts.map +1 -1
- package/dist/neutral/provider/gateway/MemoryXyoGateway.d.ts +3 -3
- package/dist/neutral/provider/gateway/MemoryXyoGateway.d.ts.map +1 -1
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts +9 -4
- package/dist/neutral/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/neutral/types/XyoProviderRpc.d.ts +3 -3
- package/dist/neutral/types/XyoProviderRpc.d.ts.map +1 -1
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts +262 -6
- package/dist/neutral/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts +1 -5
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts +261 -1
- package/dist/neutral/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/Stake.d.ts +119 -0
- package/dist/neutral/types/schema/common/Stake.d.ts.map +1 -0
- package/dist/neutral/types/schema/common/TransactionFees.d.ts +5 -1
- package/dist/neutral/types/schema/common/TransactionFees.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/index.d.ts +1 -1
- package/dist/neutral/types/schema/common/index.d.ts.map +1 -1
- package/dist/node/engine/rpcEngineFromProvider.d.ts +2 -2
- package/dist/node/engine/rpcEngineFromProvider.d.ts.map +1 -1
- package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts +2 -2
- package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts.map +1 -1
- package/dist/node/engine/rpcMethodHandlersFromViewer.d.ts.map +1 -1
- package/dist/node/index-node.mjs +209 -107
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/connection/HttpRpcXyoConnection.d.ts +4 -4
- package/dist/node/provider/connection/HttpRpcXyoConnection.d.ts.map +1 -1
- package/dist/node/provider/connection/{XyoConnection.d.ts → XyoBaseConnection.d.ts} +5 -5
- package/dist/node/provider/connection/XyoBaseConnection.d.ts.map +1 -0
- package/dist/node/provider/connection/index.d.ts +1 -1
- package/dist/node/provider/connection/index.d.ts.map +1 -1
- package/dist/node/provider/datalake/AbstractXyoDataLake.d.ts +2 -2
- package/dist/node/provider/datalake/AbstractXyoDataLake.d.ts.map +1 -1
- package/dist/node/provider/gateway/Abstract.d.ts +2 -2
- package/dist/node/provider/gateway/Abstract.d.ts.map +1 -1
- package/dist/node/provider/gateway/MemoryXyoGateway.d.ts +3 -3
- package/dist/node/provider/gateway/MemoryXyoGateway.d.ts.map +1 -1
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts +9 -4
- package/dist/node/provider/viewer/JsonRpcXyoViewer.d.ts.map +1 -1
- package/dist/node/types/XyoProviderRpc.d.ts +3 -3
- package/dist/node/types/XyoProviderRpc.d.ts.map +1 -1
- package/dist/node/types/schema/AllRpcSchemas.d.ts +262 -6
- package/dist/node/types/schema/AllRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts +1 -5
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts +261 -1
- package/dist/node/types/schema/XyoViewerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/common/Stake.d.ts +119 -0
- package/dist/node/types/schema/common/Stake.d.ts.map +1 -0
- package/dist/node/types/schema/common/TransactionFees.d.ts +5 -1
- package/dist/node/types/schema/common/TransactionFees.d.ts.map +1 -1
- package/dist/node/types/schema/common/index.d.ts +1 -1
- package/dist/node/types/schema/common/index.d.ts.map +1 -1
- package/package.json +9 -10
- package/src/engine/rpcEngineFromProvider.ts +2 -2
- package/src/engine/rpcMethodHandlersFromProvider.ts +3 -3
- package/src/engine/rpcMethodHandlersFromViewer.ts +5 -1
- package/src/provider/client/spec/MemoryXyoClient.spec.ts +2 -2
- package/src/provider/connection/HttpRpcXyoConnection.ts +4 -4
- package/src/provider/connection/{XyoConnection.ts → XyoBaseConnection.ts} +5 -5
- package/src/provider/connection/index.ts +1 -1
- package/src/provider/connection/spec/XyoConnection.ts +4 -4
- package/src/provider/datalake/AbstractXyoDataLake.ts +2 -2
- package/src/provider/gateway/Abstract.ts +2 -2
- package/src/provider/gateway/MemoryXyoGateway.ts +4 -4
- package/src/provider/signer/spec/RpcEngineXyoSigner.spec.ts +2 -2
- package/src/provider/viewer/JsonRpcXyoViewer.ts +30 -9
- package/src/types/XyoProviderRpc.ts +4 -4
- package/src/types/schema/XyoSignerRpcSchemas.ts +1 -2
- package/src/types/schema/XyoViewerRpcSchemas.ts +43 -1
- package/src/types/schema/common/Stake.ts +43 -0
- package/src/types/schema/common/TransactionFees.ts +4 -2
- package/src/types/schema/common/index.ts +1 -1
- package/dist/neutral/provider/connection/XyoConnection.d.ts.map +0 -1
- package/dist/neutral/types/schema/common/AllowedBlockPayload.d.ts +0 -11
- package/dist/neutral/types/schema/common/AllowedBlockPayload.d.ts.map +0 -1
- package/dist/node/provider/connection/XyoConnection.d.ts.map +0 -1
- package/dist/node/types/schema/common/AllowedBlockPayload.d.ts +0 -11
- package/dist/node/types/schema/common/AllowedBlockPayload.d.ts.map +0 -1
- package/src/types/schema/common/AllowedBlockPayload.ts +0 -16
|
@@ -40,7 +40,7 @@ export declare const XyoViewerRpcSchemas: {
|
|
|
40
40
|
}>>>;
|
|
41
41
|
};
|
|
42
42
|
};
|
|
43
|
-
|
|
43
|
+
xyoViewer_accountBalanceHistory: {
|
|
44
44
|
params: {
|
|
45
45
|
to: z.ZodUnion<readonly [z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
46
46
|
readonly __hex: true;
|
|
@@ -718,6 +718,24 @@ export declare const XyoViewerRpcSchemas: {
|
|
|
718
718
|
}>, string>>;
|
|
719
719
|
};
|
|
720
720
|
};
|
|
721
|
+
xyoViewer_chainIdAtBlock: {
|
|
722
|
+
params: {
|
|
723
|
+
to: z.ZodTuple<[z.ZodNumber], null>;
|
|
724
|
+
from: z.ZodTuple<[z.ZodNumber], null>;
|
|
725
|
+
};
|
|
726
|
+
result: {
|
|
727
|
+
to: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
728
|
+
readonly __hex: true;
|
|
729
|
+
}>, {
|
|
730
|
+
readonly __address: true;
|
|
731
|
+
}>, string>>;
|
|
732
|
+
from: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
733
|
+
readonly __hex: true;
|
|
734
|
+
}>, {
|
|
735
|
+
readonly __address: true;
|
|
736
|
+
}>, string>>;
|
|
737
|
+
};
|
|
738
|
+
};
|
|
721
739
|
xyoViewer_currentBlock: {
|
|
722
740
|
params: {
|
|
723
741
|
to: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
@@ -940,6 +958,248 @@ export declare const XyoViewerRpcSchemas: {
|
|
|
940
958
|
from: z.ZodNumber;
|
|
941
959
|
};
|
|
942
960
|
};
|
|
961
|
+
xyoViewer_forkHistory: {
|
|
962
|
+
params: {
|
|
963
|
+
to: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
964
|
+
from: z.ZodOptional<z.ZodArray<z.ZodAny>>;
|
|
965
|
+
};
|
|
966
|
+
result: {
|
|
967
|
+
to: z.ZodRecord<z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
968
|
+
readonly __hex: true;
|
|
969
|
+
}>, {
|
|
970
|
+
readonly __address: true;
|
|
971
|
+
}>, string>>>;
|
|
972
|
+
from: z.ZodRecord<z.ZodNumber, z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
973
|
+
readonly __hex: true;
|
|
974
|
+
}>, {
|
|
975
|
+
readonly __address: true;
|
|
976
|
+
}>, string>>>;
|
|
977
|
+
};
|
|
978
|
+
};
|
|
979
|
+
xyoViewer_stakeByAddress: {
|
|
980
|
+
params: {
|
|
981
|
+
to: z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
982
|
+
readonly __hex: true;
|
|
983
|
+
}>, {
|
|
984
|
+
readonly __address: true;
|
|
985
|
+
}>, string>>, z.ZodNumber], null>;
|
|
986
|
+
from: z.ZodTuple<[z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
987
|
+
readonly __hex: true;
|
|
988
|
+
}>, {
|
|
989
|
+
readonly __address: true;
|
|
990
|
+
}>, string>>, z.ZodNumber], null>;
|
|
991
|
+
};
|
|
992
|
+
result: {
|
|
993
|
+
to: z.ZodPipe<z.ZodObject<{
|
|
994
|
+
addBlock: z.ZodNumber;
|
|
995
|
+
amount: z.ZodBigInt;
|
|
996
|
+
id: z.ZodNumber;
|
|
997
|
+
removeBlock: z.ZodNumber;
|
|
998
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
999
|
+
readonly __hex: true;
|
|
1000
|
+
}>, {
|
|
1001
|
+
readonly __address: true;
|
|
1002
|
+
}>, string>>;
|
|
1003
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1004
|
+
readonly __hex: true;
|
|
1005
|
+
}>, {
|
|
1006
|
+
readonly __address: true;
|
|
1007
|
+
}>, string>>;
|
|
1008
|
+
withdrawBlock: z.ZodNumber;
|
|
1009
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
1010
|
+
addBlock: number;
|
|
1011
|
+
amount: import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1012
|
+
readonly __hex: true;
|
|
1013
|
+
}>;
|
|
1014
|
+
id: number;
|
|
1015
|
+
removeBlock: number;
|
|
1016
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1017
|
+
readonly __hex: true;
|
|
1018
|
+
}>, {
|
|
1019
|
+
readonly __address: true;
|
|
1020
|
+
}>;
|
|
1021
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1022
|
+
readonly __hex: true;
|
|
1023
|
+
}>, {
|
|
1024
|
+
readonly __address: true;
|
|
1025
|
+
}>;
|
|
1026
|
+
withdrawBlock: number;
|
|
1027
|
+
}, {
|
|
1028
|
+
addBlock: number;
|
|
1029
|
+
amount: bigint;
|
|
1030
|
+
id: number;
|
|
1031
|
+
removeBlock: number;
|
|
1032
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1033
|
+
readonly __hex: true;
|
|
1034
|
+
}>, {
|
|
1035
|
+
readonly __address: true;
|
|
1036
|
+
}>;
|
|
1037
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1038
|
+
readonly __hex: true;
|
|
1039
|
+
}>, {
|
|
1040
|
+
readonly __address: true;
|
|
1041
|
+
}>;
|
|
1042
|
+
withdrawBlock: number;
|
|
1043
|
+
}>>;
|
|
1044
|
+
from: z.ZodPipe<z.ZodObject<{
|
|
1045
|
+
addBlock: z.ZodNumber;
|
|
1046
|
+
amount: z.ZodBigInt;
|
|
1047
|
+
id: z.ZodNumber;
|
|
1048
|
+
removeBlock: z.ZodNumber;
|
|
1049
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1050
|
+
readonly __hex: true;
|
|
1051
|
+
}>, {
|
|
1052
|
+
readonly __address: true;
|
|
1053
|
+
}>, string>>;
|
|
1054
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1055
|
+
readonly __hex: true;
|
|
1056
|
+
}>, {
|
|
1057
|
+
readonly __address: true;
|
|
1058
|
+
}>, string>>;
|
|
1059
|
+
withdrawBlock: z.ZodNumber;
|
|
1060
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
1061
|
+
addBlock: number;
|
|
1062
|
+
amount: import("@xyo-network/xl1-protocol").AttoXL1;
|
|
1063
|
+
id: number;
|
|
1064
|
+
removeBlock: number;
|
|
1065
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1066
|
+
readonly __hex: true;
|
|
1067
|
+
}>, {
|
|
1068
|
+
readonly __address: true;
|
|
1069
|
+
}>;
|
|
1070
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1071
|
+
readonly __hex: true;
|
|
1072
|
+
}>, {
|
|
1073
|
+
readonly __address: true;
|
|
1074
|
+
}>;
|
|
1075
|
+
withdrawBlock: number;
|
|
1076
|
+
}, {
|
|
1077
|
+
addBlock: number;
|
|
1078
|
+
amount: bigint;
|
|
1079
|
+
id: number;
|
|
1080
|
+
removeBlock: number;
|
|
1081
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1082
|
+
readonly __hex: true;
|
|
1083
|
+
}>, {
|
|
1084
|
+
readonly __address: true;
|
|
1085
|
+
}>;
|
|
1086
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1087
|
+
readonly __hex: true;
|
|
1088
|
+
}>, {
|
|
1089
|
+
readonly __address: true;
|
|
1090
|
+
}>;
|
|
1091
|
+
withdrawBlock: number;
|
|
1092
|
+
}>>;
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
xyoViewer_stakeById: {
|
|
1096
|
+
params: {
|
|
1097
|
+
to: z.ZodTuple<[z.ZodNumber], null>;
|
|
1098
|
+
from: z.ZodTuple<[z.ZodNumber], null>;
|
|
1099
|
+
};
|
|
1100
|
+
result: {
|
|
1101
|
+
to: z.ZodPipe<z.ZodObject<{
|
|
1102
|
+
addBlock: z.ZodNumber;
|
|
1103
|
+
amount: z.ZodBigInt;
|
|
1104
|
+
id: z.ZodNumber;
|
|
1105
|
+
removeBlock: z.ZodNumber;
|
|
1106
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1107
|
+
readonly __hex: true;
|
|
1108
|
+
}>, {
|
|
1109
|
+
readonly __address: true;
|
|
1110
|
+
}>, string>>;
|
|
1111
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1112
|
+
readonly __hex: true;
|
|
1113
|
+
}>, {
|
|
1114
|
+
readonly __address: true;
|
|
1115
|
+
}>, string>>;
|
|
1116
|
+
withdrawBlock: z.ZodNumber;
|
|
1117
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
1118
|
+
addBlock: number;
|
|
1119
|
+
amount: import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1120
|
+
readonly __hex: true;
|
|
1121
|
+
}>;
|
|
1122
|
+
id: number;
|
|
1123
|
+
removeBlock: number;
|
|
1124
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1125
|
+
readonly __hex: true;
|
|
1126
|
+
}>, {
|
|
1127
|
+
readonly __address: true;
|
|
1128
|
+
}>;
|
|
1129
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1130
|
+
readonly __hex: true;
|
|
1131
|
+
}>, {
|
|
1132
|
+
readonly __address: true;
|
|
1133
|
+
}>;
|
|
1134
|
+
withdrawBlock: number;
|
|
1135
|
+
}, {
|
|
1136
|
+
addBlock: number;
|
|
1137
|
+
amount: bigint;
|
|
1138
|
+
id: number;
|
|
1139
|
+
removeBlock: number;
|
|
1140
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1141
|
+
readonly __hex: true;
|
|
1142
|
+
}>, {
|
|
1143
|
+
readonly __address: true;
|
|
1144
|
+
}>;
|
|
1145
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1146
|
+
readonly __hex: true;
|
|
1147
|
+
}>, {
|
|
1148
|
+
readonly __address: true;
|
|
1149
|
+
}>;
|
|
1150
|
+
withdrawBlock: number;
|
|
1151
|
+
}>>;
|
|
1152
|
+
from: z.ZodPipe<z.ZodObject<{
|
|
1153
|
+
addBlock: z.ZodNumber;
|
|
1154
|
+
amount: z.ZodBigInt;
|
|
1155
|
+
id: z.ZodNumber;
|
|
1156
|
+
removeBlock: z.ZodNumber;
|
|
1157
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1158
|
+
readonly __hex: true;
|
|
1159
|
+
}>, {
|
|
1160
|
+
readonly __address: true;
|
|
1161
|
+
}>, string>>;
|
|
1162
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1163
|
+
readonly __hex: true;
|
|
1164
|
+
}>, {
|
|
1165
|
+
readonly __address: true;
|
|
1166
|
+
}>, string>>;
|
|
1167
|
+
withdrawBlock: z.ZodNumber;
|
|
1168
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
1169
|
+
addBlock: number;
|
|
1170
|
+
amount: import("@xyo-network/xl1-protocol").AttoXL1;
|
|
1171
|
+
id: number;
|
|
1172
|
+
removeBlock: number;
|
|
1173
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1174
|
+
readonly __hex: true;
|
|
1175
|
+
}>, {
|
|
1176
|
+
readonly __address: true;
|
|
1177
|
+
}>;
|
|
1178
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1179
|
+
readonly __hex: true;
|
|
1180
|
+
}>, {
|
|
1181
|
+
readonly __address: true;
|
|
1182
|
+
}>;
|
|
1183
|
+
withdrawBlock: number;
|
|
1184
|
+
}, {
|
|
1185
|
+
addBlock: number;
|
|
1186
|
+
amount: bigint;
|
|
1187
|
+
id: number;
|
|
1188
|
+
removeBlock: number;
|
|
1189
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1190
|
+
readonly __hex: true;
|
|
1191
|
+
}>, {
|
|
1192
|
+
readonly __address: true;
|
|
1193
|
+
}>;
|
|
1194
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
1195
|
+
readonly __hex: true;
|
|
1196
|
+
}>, {
|
|
1197
|
+
readonly __address: true;
|
|
1198
|
+
}>;
|
|
1199
|
+
withdrawBlock: number;
|
|
1200
|
+
}>>;
|
|
1201
|
+
};
|
|
1202
|
+
};
|
|
943
1203
|
xyoViewer_transactionByBlockHashAndIndex: {
|
|
944
1204
|
params: {
|
|
945
1205
|
to: z.ZodTuple<[z.ZodType<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoViewerRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoViewerRpcSchemas.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"XyoViewerRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoViewerRpcSchemas.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAcxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiLgB,CAAA"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as z from 'zod';
|
|
2
|
+
export declare const StakeZod: z.ZodObject<{
|
|
3
|
+
addBlock: z.ZodNumber;
|
|
4
|
+
amount: z.ZodBigInt;
|
|
5
|
+
id: z.ZodNumber;
|
|
6
|
+
removeBlock: z.ZodNumber;
|
|
7
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
8
|
+
readonly __hex: true;
|
|
9
|
+
}>, {
|
|
10
|
+
readonly __address: true;
|
|
11
|
+
}>, string>>;
|
|
12
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
13
|
+
readonly __hex: true;
|
|
14
|
+
}>, {
|
|
15
|
+
readonly __address: true;
|
|
16
|
+
}>, string>>;
|
|
17
|
+
withdrawBlock: z.ZodNumber;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const StakeToJsonZod: z.ZodPipe<z.ZodObject<{
|
|
20
|
+
addBlock: z.ZodNumber;
|
|
21
|
+
amount: z.ZodBigInt;
|
|
22
|
+
id: z.ZodNumber;
|
|
23
|
+
removeBlock: z.ZodNumber;
|
|
24
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
25
|
+
readonly __hex: true;
|
|
26
|
+
}>, {
|
|
27
|
+
readonly __address: true;
|
|
28
|
+
}>, string>>;
|
|
29
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
30
|
+
readonly __hex: true;
|
|
31
|
+
}>, {
|
|
32
|
+
readonly __address: true;
|
|
33
|
+
}>, string>>;
|
|
34
|
+
withdrawBlock: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
36
|
+
addBlock: number;
|
|
37
|
+
amount: import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
38
|
+
readonly __hex: true;
|
|
39
|
+
}>;
|
|
40
|
+
id: number;
|
|
41
|
+
removeBlock: number;
|
|
42
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
43
|
+
readonly __hex: true;
|
|
44
|
+
}>, {
|
|
45
|
+
readonly __address: true;
|
|
46
|
+
}>;
|
|
47
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
48
|
+
readonly __hex: true;
|
|
49
|
+
}>, {
|
|
50
|
+
readonly __address: true;
|
|
51
|
+
}>;
|
|
52
|
+
withdrawBlock: number;
|
|
53
|
+
}, {
|
|
54
|
+
addBlock: number;
|
|
55
|
+
amount: bigint;
|
|
56
|
+
id: number;
|
|
57
|
+
removeBlock: number;
|
|
58
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
59
|
+
readonly __hex: true;
|
|
60
|
+
}>, {
|
|
61
|
+
readonly __address: true;
|
|
62
|
+
}>;
|
|
63
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
64
|
+
readonly __hex: true;
|
|
65
|
+
}>, {
|
|
66
|
+
readonly __address: true;
|
|
67
|
+
}>;
|
|
68
|
+
withdrawBlock: number;
|
|
69
|
+
}>>;
|
|
70
|
+
export declare const JsonToStakeZod: z.ZodPipe<z.ZodObject<{
|
|
71
|
+
addBlock: z.ZodNumber;
|
|
72
|
+
amount: z.ZodBigInt;
|
|
73
|
+
id: z.ZodNumber;
|
|
74
|
+
removeBlock: z.ZodNumber;
|
|
75
|
+
staked: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
76
|
+
readonly __hex: true;
|
|
77
|
+
}>, {
|
|
78
|
+
readonly __address: true;
|
|
79
|
+
}>, string>>;
|
|
80
|
+
staker: z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
81
|
+
readonly __hex: true;
|
|
82
|
+
}>, {
|
|
83
|
+
readonly __address: true;
|
|
84
|
+
}>, string>>;
|
|
85
|
+
withdrawBlock: z.ZodNumber;
|
|
86
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
87
|
+
addBlock: number;
|
|
88
|
+
amount: import("@xyo-network/xl1-protocol").AttoXL1;
|
|
89
|
+
id: number;
|
|
90
|
+
removeBlock: number;
|
|
91
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
92
|
+
readonly __hex: true;
|
|
93
|
+
}>, {
|
|
94
|
+
readonly __address: true;
|
|
95
|
+
}>;
|
|
96
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
97
|
+
readonly __hex: true;
|
|
98
|
+
}>, {
|
|
99
|
+
readonly __address: true;
|
|
100
|
+
}>;
|
|
101
|
+
withdrawBlock: number;
|
|
102
|
+
}, {
|
|
103
|
+
addBlock: number;
|
|
104
|
+
amount: bigint;
|
|
105
|
+
id: number;
|
|
106
|
+
removeBlock: number;
|
|
107
|
+
staked: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
108
|
+
readonly __hex: true;
|
|
109
|
+
}>, {
|
|
110
|
+
readonly __address: true;
|
|
111
|
+
}>;
|
|
112
|
+
staker: import("@xylabs/typeof").Brand<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
113
|
+
readonly __hex: true;
|
|
114
|
+
}>, {
|
|
115
|
+
readonly __address: true;
|
|
116
|
+
}>;
|
|
117
|
+
withdrawBlock: number;
|
|
118
|
+
}>>;
|
|
119
|
+
//# sourceMappingURL=Stake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Stake.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/Stake.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAOxB,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;iBAenB,CAAA;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQxB,CAAA;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAQxB,CAAA"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const AttoZod: z.ZodBigInt;
|
|
3
|
+
export declare const JsonToAttoZod: z.ZodPipe<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
3
4
|
readonly __hex: true;
|
|
4
5
|
}>, string>>, z.ZodTransform<bigint, import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
5
6
|
readonly __hex: true;
|
|
6
7
|
}>>>, z.ZodTransform<import("@xyo-network/xl1-protocol").AttoXL1, bigint>>;
|
|
8
|
+
export declare const AttoToJsonZod: z.ZodPipe<z.ZodBigInt, z.ZodTransform<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
9
|
+
readonly __hex: true;
|
|
10
|
+
}>, bigint>>;
|
|
7
11
|
export declare const TransactionFeesHexZod: z.ZodObject<{
|
|
8
12
|
base: z.ZodType<import("@xylabs/typeof").Brand<Lowercase<string>, {
|
|
9
13
|
readonly __hex: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionFees.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransactionFees.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"TransactionFees.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/TransactionFees.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,eAAO,MAAM,OAAO,aAAa,CAAA;AACjC,eAAO,MAAM,aAAa;;;;0EAA+C,CAAA;AAEzE,eAAO,MAAM,aAAa;;YAAkB,CAAA;AAE5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;iBAKhC,CAAA;AAEF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAE7E,eAAO,MAAM,wBAAwB;;;;;iBAKnC,CAAA;AAEF,MAAM,MAAM,4BAA4B,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEnF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAKxC,CAAA;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;GAKxC,CAAA;AAEH,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA;AAC/F,MAAM,MAAM,kCAAkC,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,8BAA8B,CAAC,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export * from './Address.ts';
|
|
2
|
-
export * from './AllowedBlockPayload.ts';
|
|
3
2
|
export * from './BlockBoundWitness.ts';
|
|
4
3
|
export * from './BoundWitness.ts';
|
|
5
4
|
export * from './Chain.ts';
|
|
@@ -8,6 +7,7 @@ export * from './HydratedTransaction.ts';
|
|
|
8
7
|
export * from './Json.ts';
|
|
9
8
|
export * from './Payload.ts';
|
|
10
9
|
export * from './Sequence.ts';
|
|
10
|
+
export * from './Stake.ts';
|
|
11
11
|
export * from './TransactionBoundWitness.ts';
|
|
12
12
|
export * from './TransactionFees.ts';
|
|
13
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,wBAAwB,CAAA;AACtC,cAAc,mBAAmB,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA;AACxC,cAAc,WAAW,CAAA;AACzB,cAAc,cAAc,CAAA;AAC5B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,8BAA8B,CAAA;AAC5C,cAAc,sBAAsB,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "http://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@xyo-network/xl1-rpc",
|
|
4
|
-
"version": "1.14.
|
|
4
|
+
"version": "1.14.2",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
58
|
"@metamask/json-rpc-engine": "~10.0.3",
|
|
59
|
-
"@metamask/utils": "~11.
|
|
59
|
+
"@metamask/utils": "~11.7.0",
|
|
60
60
|
"@xylabs/arraybuffer": "~5.0.11",
|
|
61
61
|
"@xylabs/assert": "~5.0.11",
|
|
62
62
|
"@xylabs/axios": "~5.0.11",
|
|
@@ -69,30 +69,29 @@
|
|
|
69
69
|
"@xyo-network/archivist-memory": "~5.1.0",
|
|
70
70
|
"@xyo-network/archivist-model": "~5.1.0",
|
|
71
71
|
"@xyo-network/boundwitness-model": "~5.1.0",
|
|
72
|
-
"@xyo-network/core-payload-plugins": "~5.1.0",
|
|
73
72
|
"@xyo-network/hash": "~5.1.0",
|
|
74
73
|
"@xyo-network/module-model": "~5.1.0",
|
|
75
74
|
"@xyo-network/node-model": "~5.1.0",
|
|
76
75
|
"@xyo-network/payload-builder": "~5.1.0",
|
|
77
76
|
"@xyo-network/payload-model": "~5.1.0",
|
|
78
|
-
"@xyo-network/xl1-protocol": "~1.
|
|
79
|
-
"@xyo-network/xl1-protocol-sdk": "~1.14.
|
|
80
|
-
"@xyo-network/xl1-wrappers": "~1.14.
|
|
77
|
+
"@xyo-network/xl1-protocol": "~1.12.14",
|
|
78
|
+
"@xyo-network/xl1-protocol-sdk": "~1.14.2",
|
|
79
|
+
"@xyo-network/xl1-wrappers": "~1.14.2",
|
|
81
80
|
"axios": "~1.11.0",
|
|
82
81
|
"uuid": "~11.1.0",
|
|
83
|
-
"zod": "~4.1.
|
|
82
|
+
"zod": "~4.1.5"
|
|
84
83
|
},
|
|
85
84
|
"devDependencies": {
|
|
86
|
-
"@metamask/utils": "~11.
|
|
85
|
+
"@metamask/utils": "~11.7.0",
|
|
87
86
|
"@types/node": "~24.3.0",
|
|
88
87
|
"@xylabs/logger": "~5.0.11",
|
|
89
88
|
"@xylabs/ts-scripts-yarn3": "~7.1.7",
|
|
90
89
|
"@xylabs/tsconfig": "~7.1.7",
|
|
91
90
|
"@xylabs/vitest-extended": "~5.0.11",
|
|
92
91
|
"@xyo-network/account": "~5.1.0",
|
|
93
|
-
"@xyo-network/chain-protocol": "~1.14.
|
|
92
|
+
"@xyo-network/chain-protocol": "~1.14.2",
|
|
94
93
|
"@xyo-network/wallet": "~5.1.0",
|
|
95
|
-
"dotenv": "~17.2.
|
|
94
|
+
"dotenv": "~17.2.2",
|
|
96
95
|
"eslint": "^9.34.0",
|
|
97
96
|
"typescript": "~5.9.2",
|
|
98
97
|
"vitest": "~3.2.4"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createAsyncMiddleware, JsonRpcEngine } from '@metamask/json-rpc-engine'
|
|
2
2
|
import type { Json } from '@metamask/utils'
|
|
3
|
-
import type {
|
|
3
|
+
import type { XyoConnection } from '@xyo-network/xl1-protocol'
|
|
4
4
|
|
|
5
5
|
import {
|
|
6
6
|
AllRpcSchemas, createRequestSchema, JsonRpcErrorCodes,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
import { requestSchemas } from './requestSchemas.ts'
|
|
9
9
|
import { rpcMethodHandlersFromProvider } from './rpcMethodHandlersFromProvider.ts'
|
|
10
10
|
|
|
11
|
-
export const rpcEngineFromProvider = (provider:
|
|
11
|
+
export const rpcEngineFromProvider = (provider: XyoConnection) => {
|
|
12
12
|
const engine = new JsonRpcEngine()
|
|
13
13
|
const handlers = rpcMethodHandlersFromProvider(provider)
|
|
14
14
|
engine.push(
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { XyoConnection } from '@xyo-network/xl1-protocol'
|
|
2
2
|
|
|
3
3
|
import type { XyoProviderRpcMethodHandlers } from '../types/index.ts'
|
|
4
4
|
import { rpcMethodHandlersFromRunner } from './rpcMethodHandlersFromRunner.ts'
|
|
5
5
|
import { rpcMethodHandlersFromSigner } from './rpcMethodHandlersFromSigner.ts'
|
|
6
6
|
import { rpcMethodHandlersFromViewer } from './rpcMethodHandlersFromViewer.ts'
|
|
7
7
|
|
|
8
|
-
export const rpcMethodHandlersFromProvider = (provider:
|
|
8
|
+
export const rpcMethodHandlersFromProvider = (provider: XyoConnection): XyoProviderRpcMethodHandlers => {
|
|
9
9
|
const {
|
|
10
10
|
runner, signer, viewer,
|
|
11
11
|
} = provider
|
|
12
|
-
let result: XyoProviderRpcMethodHandlers = { xyoProvider_send: params => (provider as Required<
|
|
12
|
+
let result: XyoProviderRpcMethodHandlers = { xyoProvider_send: params => (provider as Required<XyoConnection>).send(...(params ?? [])) }
|
|
13
13
|
if (runner) result = { ...result, ...rpcMethodHandlersFromRunner(runner) }
|
|
14
14
|
if (signer) result = { ...result, ...rpcMethodHandlersFromSigner(signer) }
|
|
15
15
|
if (viewer) result = { ...result, ...rpcMethodHandlersFromViewer(viewer) }
|
|
@@ -5,14 +5,18 @@ import type { XyoViewerRpcMethodHandlers } from '../types/index.ts'
|
|
|
5
5
|
export const rpcMethodHandlersFromViewer = (viewer: XyoViewer): XyoViewerRpcMethodHandlers => {
|
|
6
6
|
return {
|
|
7
7
|
xyoViewer_accountBalance: params => viewer.accountBalance(...(params ?? [])),
|
|
8
|
-
|
|
8
|
+
xyoViewer_accountBalanceHistory: params => viewer.accountBalanceHistory(...(params ?? [])),
|
|
9
9
|
xyoViewer_blockByHash: params => viewer.blockByHash(...(params ?? [])),
|
|
10
10
|
xyoViewer_blockByNumber: params => viewer.blockByNumber(...(params ?? [])),
|
|
11
11
|
xyoViewer_blocksByHash: params => viewer.blocksByHash(...(params ?? [])),
|
|
12
12
|
xyoViewer_chainId: params => viewer.chainId(...(params ?? [])),
|
|
13
|
+
xyoViewer_chainIdAtBlock: params => viewer.chainIdAtBlock(...(params ?? [])),
|
|
13
14
|
xyoViewer_currentBlock: params => viewer.currentBlock(...(params ?? [])),
|
|
14
15
|
xyoViewer_currentBlockHash: params => viewer.currentBlockHash(...(params ?? [])),
|
|
15
16
|
xyoViewer_currentBlockNumber: params => viewer.currentBlockNumber(...(params ?? [])),
|
|
17
|
+
xyoViewer_forkHistory: params => viewer.forkHistory(...(params ?? [])),
|
|
18
|
+
xyoViewer_stakeById: params => viewer.stakeById(...(params ?? [])),
|
|
19
|
+
xyoViewer_stakeByAddress: params => viewer.stakeByAddress(...(params ?? [])),
|
|
16
20
|
xyoViewer_transactionByBlockHashAndIndex: params => viewer.transactionByBlockHashAndIndex(...(params ?? [])),
|
|
17
21
|
xyoViewer_transactionByBlockNumberAndIndex: params => viewer.transactionByBlockNumberAndIndex(...(params ?? [])),
|
|
18
22
|
xyoViewer_transactionByHash: params => viewer.transactionByHash(...(params ?? [])),
|
|
@@ -5,7 +5,7 @@ import type { Payload } from '@xyo-network/payload-model'
|
|
|
5
5
|
import { HDWallet } from '@xyo-network/wallet'
|
|
6
6
|
import type {
|
|
7
7
|
AllowedBlockPayload, GatewayName, HashPayload, XyoClient,
|
|
8
|
-
|
|
8
|
+
XyoConnection,
|
|
9
9
|
} from '@xyo-network/xl1-protocol'
|
|
10
10
|
import { HashSchema } from '@xyo-network/xl1-protocol'
|
|
11
11
|
import { ADDRESS_INDEX, generateXyoBaseWalletFromPhrase } from '@xyo-network/xl1-protocol-sdk'
|
|
@@ -30,7 +30,7 @@ describe.skip('Client', () => {
|
|
|
30
30
|
let account: AccountInstance
|
|
31
31
|
let signer: MemoryXyoSigner
|
|
32
32
|
let store: MemoryPermissionsStore
|
|
33
|
-
let connection:
|
|
33
|
+
let connection: XyoConnection
|
|
34
34
|
let gateway: MemoryXyoGateway
|
|
35
35
|
let client: XyoClient
|
|
36
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isDefined, isString } from '@xylabs/typeof'
|
|
2
2
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
3
|
-
import type {
|
|
3
|
+
import type { XyoDataLake } from '@xyo-network/xl1-protocol'
|
|
4
4
|
import { isDataLakeProvider } from '@xyo-network/xl1-protocol'
|
|
5
5
|
|
|
6
6
|
import { HttpRpcTransport } from '../../transport/index.ts'
|
|
@@ -9,15 +9,15 @@ import { HttpXyoDataLake } from '../datalake/index.ts'
|
|
|
9
9
|
import { JsonRpcXyoRunner } from '../runner/index.ts'
|
|
10
10
|
import { MemoryXyoSigner } from '../signer/index.ts'
|
|
11
11
|
import { JsonRpcXyoViewer } from '../viewer/index.ts'
|
|
12
|
-
import {
|
|
12
|
+
import { XyoBaseConnection } from './XyoBaseConnection.ts'
|
|
13
13
|
|
|
14
14
|
export interface RpcXyoProviderParams {
|
|
15
15
|
account?: AccountInstance
|
|
16
16
|
endpoint: string
|
|
17
|
-
storage?: string |
|
|
17
|
+
storage?: string | XyoDataLake
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
export class HttpRpcXyoConnection extends
|
|
20
|
+
export class HttpRpcXyoConnection extends XyoBaseConnection {
|
|
21
21
|
constructor(params: RpcXyoProviderParams) {
|
|
22
22
|
const {
|
|
23
23
|
account, endpoint, storage: storageParam,
|
|
@@ -7,23 +7,23 @@ import type {
|
|
|
7
7
|
AllowedBlockPayload,
|
|
8
8
|
SignedHydratedTransactionWithStorageMeta,
|
|
9
9
|
TransactionBoundWitness, TransactionFeesBigInt,
|
|
10
|
-
TransactionOptions,
|
|
10
|
+
TransactionOptions, XyoConnection, XyoDataLake, XyoDataLakeViewer, XyoNetwork, XyoRunner, XyoSigner, XyoViewer,
|
|
11
11
|
} from '@xyo-network/xl1-protocol'
|
|
12
12
|
import { defaultTransactionFees, isDataLakeProvider } from '@xyo-network/xl1-protocol'
|
|
13
13
|
import { HydratedTransactionWrapper } from '@xyo-network/xl1-wrappers'
|
|
14
14
|
|
|
15
|
-
export class
|
|
15
|
+
export class XyoBaseConnection implements XyoConnection {
|
|
16
16
|
private readonly _network?: XyoNetwork
|
|
17
17
|
private readonly _runner?: XyoRunner
|
|
18
18
|
private readonly _signer?: XyoSigner
|
|
19
|
-
private readonly _storage?:
|
|
19
|
+
private readonly _storage?: XyoDataLake | XyoDataLakeViewer
|
|
20
20
|
private readonly _viewer?: XyoViewer
|
|
21
21
|
|
|
22
22
|
constructor(params?: {
|
|
23
23
|
network?: XyoNetwork
|
|
24
24
|
runner?: XyoRunner
|
|
25
25
|
signer?: XyoSigner
|
|
26
|
-
storage?:
|
|
26
|
+
storage?: XyoDataLake | XyoDataLakeViewer
|
|
27
27
|
viewer?: XyoViewer
|
|
28
28
|
}) {
|
|
29
29
|
this._network = params?.network
|
|
@@ -46,7 +46,7 @@ export class XyoConnection implements XyoConnectionProvider {
|
|
|
46
46
|
return this._signer
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
get storage():
|
|
49
|
+
get storage(): XyoDataLake | XyoDataLakeViewer | undefined {
|
|
50
50
|
return this._storage
|
|
51
51
|
}
|
|
52
52
|
|