@xyo-network/xl1-rpc 1.15.1 → 1.15.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/index-node.d.ts +2 -2
- package/dist/neutral/engine/index-node.d.ts.map +1 -1
- package/dist/neutral/engine/index.d.ts +1 -1
- package/dist/neutral/engine/index.d.ts.map +1 -1
- package/dist/neutral/engine/rpcEngineFromConnection.d.ts +4 -0
- package/dist/neutral/engine/rpcEngineFromConnection.d.ts.map +1 -0
- package/dist/neutral/engine/rpcMethodHandlersFromConnection.d.ts +4 -0
- package/dist/neutral/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -0
- package/dist/neutral/index.mjs +183 -168
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/signer/JsonRpcXyoSigner.d.ts +1 -0
- package/dist/neutral/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
- package/dist/neutral/types/ErrorCodes.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoGatewayRpcSchemas.d.ts +0 -42
- package/dist/neutral/types/schema/XyoGatewayRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts +1 -1
- package/dist/neutral/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/neutral/types/schema/common/Permission.d.ts +49 -0
- package/dist/neutral/types/schema/common/Permission.d.ts.map +1 -0
- package/dist/neutral/types/schema/common/index.d.ts +1 -0
- package/dist/neutral/types/schema/common/index.d.ts.map +1 -1
- package/dist/node/engine/index-node.d.ts +2 -2
- package/dist/node/engine/index-node.d.ts.map +1 -1
- package/dist/node/engine/index.d.ts +1 -1
- package/dist/node/engine/index.d.ts.map +1 -1
- package/dist/node/engine/rpcEngineFromConnection.d.ts +4 -0
- package/dist/node/engine/rpcEngineFromConnection.d.ts.map +1 -0
- package/dist/node/engine/rpcMethodHandlersFromConnection.d.ts +4 -0
- package/dist/node/engine/rpcMethodHandlersFromConnection.d.ts.map +1 -0
- package/dist/node/index-node.mjs +189 -174
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/signer/JsonRpcXyoSigner.d.ts +1 -0
- package/dist/node/provider/signer/JsonRpcXyoSigner.d.ts.map +1 -1
- package/dist/node/types/ErrorCodes.d.ts.map +1 -1
- package/dist/node/types/schema/XyoGatewayRpcSchemas.d.ts +0 -42
- package/dist/node/types/schema/XyoGatewayRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts +1 -1
- package/dist/node/types/schema/XyoSignerRpcSchemas.d.ts.map +1 -1
- package/dist/node/types/schema/common/Permission.d.ts +49 -0
- package/dist/node/types/schema/common/Permission.d.ts.map +1 -0
- package/dist/node/types/schema/common/index.d.ts +1 -0
- package/dist/node/types/schema/common/index.d.ts.map +1 -1
- package/package.json +19 -19
- package/src/engine/index-node.ts +2 -2
- package/src/engine/index.ts +1 -1
- package/src/engine/{rpcEngineFromProvider.ts → rpcEngineFromConnection.ts} +3 -3
- package/src/engine/{rpcMethodHandlersFromProvider.ts → rpcMethodHandlersFromConnection.ts} +3 -3
- package/src/provider/signer/JsonRpcXyoSigner.ts +1 -0
- package/src/provider/signer/spec/RpcEngineXyoSigner.spec.ts +3 -3
- package/src/types/ErrorCodes.ts +1 -0
- package/src/types/schema/XyoGatewayRpcSchemas.ts +0 -15
- package/src/types/schema/XyoSignerRpcSchemas.ts +1 -1
- package/src/types/schema/common/Permission.ts +23 -0
- package/src/types/schema/common/index.ts +1 -0
- package/dist/neutral/engine/rpcEngineFromProvider.d.ts +0 -4
- package/dist/neutral/engine/rpcEngineFromProvider.d.ts.map +0 -1
- package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts +0 -4
- package/dist/neutral/engine/rpcMethodHandlersFromProvider.d.ts.map +0 -1
- package/dist/node/engine/rpcEngineFromProvider.d.ts +0 -4
- package/dist/node/engine/rpcEngineFromProvider.d.ts.map +0 -1
- package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts +0 -4
- package/dist/node/engine/rpcMethodHandlersFromProvider.d.ts.map +0 -1
|
@@ -8,6 +8,7 @@ export declare class RpcXyoSigner implements XyoSigner {
|
|
|
8
8
|
protected readonly transport: RpcTransport<typeof XyoSignerRpcSchemas>;
|
|
9
9
|
constructor(transport: RpcTransport<typeof XyoSignerRpcSchemas>);
|
|
10
10
|
address(): Promise<Address>;
|
|
11
|
+
/** @deprecated - use signTransaction instead */
|
|
11
12
|
createSignedTransaction(chain: Chain, elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[], nbf: number, exp: number, fees: TransactionFeesBigInt, from?: Address): Promise<Signed<TransactionBoundWitness>>;
|
|
12
13
|
signTransaction(tx: UnsignedHydratedTransaction): Promise<SignedHydratedTransaction>;
|
|
13
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsonRpcXyoSigner.d.ts","sourceRoot":"","sources":["../../../../src/provider/signer/JsonRpcXyoSigner.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,KAAK,EACL,yBAAyB,EACzB,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,SAAS,EACV,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AAE/D,qBAAa,YAAa,YAAW,SAAS;IAC5C,SAAS,CAAC,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC,OAAO,mBAAmB,CAAC,CAAA;gBAE1D,SAAS,EAAE,YAAY,CAAC,OAAO,mBAAmB,CAAC;I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
{"version":3,"file":"ErrorCodes.d.ts","sourceRoot":"","sources":["../../../src/types/ErrorCodes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"ErrorCodes.d.ts","sourceRoot":"","sources":["../../../src/types/ErrorCodes.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAM/E,CAAA"}
|
|
@@ -5,48 +5,6 @@ export declare const ChainConnectionZod: z.ZodObject<{
|
|
|
5
5
|
name: z.ZodString;
|
|
6
6
|
url: z.ZodString;
|
|
7
7
|
}, z.core.$strip>;
|
|
8
|
-
export declare const CaveatTypesZod: z.ZodEnum<{
|
|
9
|
-
chain: "chain";
|
|
10
|
-
expiration: "expiration";
|
|
11
|
-
filteredResponse: "filteredResponse";
|
|
12
|
-
rateLimit: "rateLimit";
|
|
13
|
-
}>;
|
|
14
|
-
export declare const CaveatsZod: z.ZodObject<{
|
|
15
|
-
type: z.ZodEnum<{
|
|
16
|
-
chain: "chain";
|
|
17
|
-
expiration: "expiration";
|
|
18
|
-
filteredResponse: "filteredResponse";
|
|
19
|
-
rateLimit: "rateLimit";
|
|
20
|
-
}>;
|
|
21
|
-
value: z.ZodUnknown;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export declare const PermissionZod: z.ZodObject<{
|
|
24
|
-
capability: z.ZodString;
|
|
25
|
-
caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
26
|
-
type: z.ZodEnum<{
|
|
27
|
-
chain: "chain";
|
|
28
|
-
expiration: "expiration";
|
|
29
|
-
filteredResponse: "filteredResponse";
|
|
30
|
-
rateLimit: "rateLimit";
|
|
31
|
-
}>;
|
|
32
|
-
value: z.ZodUnknown;
|
|
33
|
-
}, z.core.$strip>>>;
|
|
34
|
-
invoker: z.ZodString;
|
|
35
|
-
}, z.core.$strip>;
|
|
36
|
-
export declare const InvokerPermissionZod: z.ZodObject<{
|
|
37
|
-
capability: z.ZodString;
|
|
38
|
-
caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
39
|
-
type: z.ZodEnum<{
|
|
40
|
-
chain: "chain";
|
|
41
|
-
expiration: "expiration";
|
|
42
|
-
filteredResponse: "filteredResponse";
|
|
43
|
-
rateLimit: "rateLimit";
|
|
44
|
-
}>;
|
|
45
|
-
value: z.ZodUnknown;
|
|
46
|
-
}, z.core.$strip>>>;
|
|
47
|
-
invoker: z.ZodString;
|
|
48
|
-
date: z.ZodOptional<z.ZodNumber>;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
8
|
export type ChainConnection = z.infer<typeof ChainConnectionZod>;
|
|
51
9
|
export declare const XyoGatewayRpcSchemas: {
|
|
52
10
|
xyoGateway_submitTransaction: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoGatewayRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoGatewayRpcSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAA;AAEF,
|
|
1
|
+
{"version":3,"file":"XyoGatewayRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoGatewayRpcSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AACtD,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAMxB,eAAO,MAAM,kBAAkB;;;;iBAI7B,CAAA;AAEF,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAEhE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EgB,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Signed } from '@xyo-network/boundwitness-model';
|
|
2
2
|
import type { TransactionBoundWitness } from '@xyo-network/xl1-protocol';
|
|
3
|
-
import
|
|
3
|
+
import { z } from 'zod';
|
|
4
4
|
export declare const XyoSignerRpcSchemas: {
|
|
5
5
|
readonly xyoSigner_address: {
|
|
6
6
|
readonly params: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoSignerRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoSignerRpcSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAA;AAExE,OAAO,
|
|
1
|
+
{"version":3,"file":"XyoSignerRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoSignerRpcSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAA;AAC7D,OAAO,KAA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
|
+
chain: "chain";
|
|
4
|
+
expiration: "expiration";
|
|
5
|
+
filteredResponse: "filteredResponse";
|
|
6
|
+
rateLimit: "rateLimit";
|
|
7
|
+
}>;
|
|
8
|
+
export declare const CaveatsZod: z.ZodObject<{
|
|
9
|
+
type: z.ZodEnum<{
|
|
10
|
+
chain: "chain";
|
|
11
|
+
expiration: "expiration";
|
|
12
|
+
filteredResponse: "filteredResponse";
|
|
13
|
+
rateLimit: "rateLimit";
|
|
14
|
+
}>;
|
|
15
|
+
value: z.ZodJSONSchema;
|
|
16
|
+
}, z.core.$strip>;
|
|
17
|
+
export declare const PermissionZod: z.ZodObject<{
|
|
18
|
+
capability: z.ZodString;
|
|
19
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
20
|
+
type: z.ZodEnum<{
|
|
21
|
+
chain: "chain";
|
|
22
|
+
expiration: "expiration";
|
|
23
|
+
filteredResponse: "filteredResponse";
|
|
24
|
+
rateLimit: "rateLimit";
|
|
25
|
+
}>;
|
|
26
|
+
value: z.ZodJSONSchema;
|
|
27
|
+
}, z.core.$strip>>>;
|
|
28
|
+
invoker: z.ZodString;
|
|
29
|
+
}, z.core.$strip>;
|
|
30
|
+
export declare const InvokerPermissionZod: z.ZodObject<{
|
|
31
|
+
capability: z.ZodString;
|
|
32
|
+
caveats: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
33
|
+
type: z.ZodEnum<{
|
|
34
|
+
chain: "chain";
|
|
35
|
+
expiration: "expiration";
|
|
36
|
+
filteredResponse: "filteredResponse";
|
|
37
|
+
rateLimit: "rateLimit";
|
|
38
|
+
}>;
|
|
39
|
+
value: z.ZodJSONSchema;
|
|
40
|
+
}, z.core.$strip>>>;
|
|
41
|
+
invoker: z.ZodString;
|
|
42
|
+
date: z.ZodOptional<z.ZodNumber>;
|
|
43
|
+
}, z.core.$strip>;
|
|
44
|
+
export declare const PermissionRequestZod: z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
45
|
+
export declare const RequestedPermissionZod: z.ZodObject<{
|
|
46
|
+
capability: z.ZodString;
|
|
47
|
+
date: z.ZodOptional<z.ZodNumber>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
//# sourceMappingURL=Permission.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Permission.d.ts","sourceRoot":"","sources":["../../../../../src/types/schema/common/Permission.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,cAAc;;;;;EAAmE,CAAA;AAE9F,eAAO,MAAM,UAAU;;;;;;;;iBAGrB,CAAA;AAEF,eAAO,MAAM,aAAa;;;;;;;;;;;;iBAIxB,CAAA;AAEF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;iBAAwD,CAAA;AAEzF,eAAO,MAAM,oBAAoB,8DAAsD,CAAA;AAEvF,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAA"}
|
|
@@ -6,6 +6,7 @@ export * from './HydratedBlock.ts';
|
|
|
6
6
|
export * from './HydratedTransaction.ts';
|
|
7
7
|
export * from './Json.ts';
|
|
8
8
|
export * from './Payload.ts';
|
|
9
|
+
export * from './Permission.ts';
|
|
9
10
|
export * from './Sequence.ts';
|
|
10
11
|
export * from './Stake.ts';
|
|
11
12
|
export * from './TransactionBoundWitness.ts';
|
|
@@ -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,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"}
|
|
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,iBAAiB,CAAA;AAC/B,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.15.
|
|
4
|
+
"version": "1.15.2",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"types": "tsc --noEmit -p tsconfig.test.json"
|
|
56
56
|
},
|
|
57
57
|
"dependencies": {
|
|
58
|
-
"@metamask/json-rpc-engine": "~10.0
|
|
59
|
-
"@metamask/utils": "~11.8.
|
|
58
|
+
"@metamask/json-rpc-engine": "~10.1.0",
|
|
59
|
+
"@metamask/utils": "~11.8.1",
|
|
60
60
|
"@xylabs/arraybuffer": "~5.0.11",
|
|
61
61
|
"@xylabs/assert": "~5.0.11",
|
|
62
62
|
"@xylabs/axios": "~5.0.11",
|
|
@@ -65,32 +65,32 @@
|
|
|
65
65
|
"@xylabs/object": "~5.0.11",
|
|
66
66
|
"@xylabs/promise": "~5.0.11",
|
|
67
67
|
"@xylabs/typeof": "~5.0.11",
|
|
68
|
-
"@xyo-network/account-model": "~5.1.
|
|
69
|
-
"@xyo-network/archivist-memory": "~5.1.
|
|
70
|
-
"@xyo-network/archivist-model": "~5.1.
|
|
71
|
-
"@xyo-network/boundwitness-model": "~5.1.
|
|
72
|
-
"@xyo-network/hash": "~5.1.
|
|
73
|
-
"@xyo-network/module-model": "~5.1.
|
|
74
|
-
"@xyo-network/node-model": "~5.1.
|
|
75
|
-
"@xyo-network/payload-builder": "~5.1.
|
|
76
|
-
"@xyo-network/payload-model": "~5.1.
|
|
77
|
-
"@xyo-network/xl1-protocol": "~1.12.
|
|
78
|
-
"@xyo-network/xl1-protocol-sdk": "~1.15.
|
|
79
|
-
"@xyo-network/xl1-wrappers": "~1.15.
|
|
68
|
+
"@xyo-network/account-model": "~5.1.3",
|
|
69
|
+
"@xyo-network/archivist-memory": "~5.1.3",
|
|
70
|
+
"@xyo-network/archivist-model": "~5.1.3",
|
|
71
|
+
"@xyo-network/boundwitness-model": "~5.1.3",
|
|
72
|
+
"@xyo-network/hash": "~5.1.3",
|
|
73
|
+
"@xyo-network/module-model": "~5.1.3",
|
|
74
|
+
"@xyo-network/node-model": "~5.1.3",
|
|
75
|
+
"@xyo-network/payload-builder": "~5.1.3",
|
|
76
|
+
"@xyo-network/payload-model": "~5.1.3",
|
|
77
|
+
"@xyo-network/xl1-protocol": "~1.12.40",
|
|
78
|
+
"@xyo-network/xl1-protocol-sdk": "~1.15.2",
|
|
79
|
+
"@xyo-network/xl1-wrappers": "~1.15.2",
|
|
80
80
|
"axios": "~1.12.2",
|
|
81
81
|
"uuid": "~13.0.0",
|
|
82
82
|
"zod": "~4.1.11"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
|
-
"@metamask/utils": "~11.8.
|
|
85
|
+
"@metamask/utils": "~11.8.1",
|
|
86
86
|
"@types/node": "~24.5.2",
|
|
87
87
|
"@xylabs/logger": "~5.0.11",
|
|
88
88
|
"@xylabs/ts-scripts-yarn3": "~7.1.7",
|
|
89
89
|
"@xylabs/tsconfig": "~7.1.7",
|
|
90
90
|
"@xylabs/vitest-extended": "~5.0.11",
|
|
91
|
-
"@xyo-network/account": "~5.1.
|
|
92
|
-
"@xyo-network/chain-protocol": "~1.15.
|
|
93
|
-
"@xyo-network/wallet": "~5.1.
|
|
91
|
+
"@xyo-network/account": "~5.1.3",
|
|
92
|
+
"@xyo-network/chain-protocol": "~1.15.2",
|
|
93
|
+
"@xyo-network/wallet": "~5.1.3",
|
|
94
94
|
"dotenv": "~17.2.2",
|
|
95
95
|
"eslint": "^9.36.0",
|
|
96
96
|
"typescript": "~5.9.2",
|
package/src/engine/index-node.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export * from './index.ts'
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
2
|
+
export * from './rpcEngineFromConnection.ts'
|
|
3
|
+
export * from './rpcMethodHandlersFromConnection.ts'
|
package/src/engine/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './requestSchemas.ts'
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './rpcMethodHandlersFromConnection.ts'
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
AllRpcSchemas, createRequestSchema, JsonRpcErrorCodes,
|
|
7
7
|
} from '../types/index.ts'
|
|
8
8
|
import { requestSchemas } from './requestSchemas.ts'
|
|
9
|
-
import {
|
|
9
|
+
import { rpcMethodHandlersFromConnection } from './rpcMethodHandlersFromConnection.ts'
|
|
10
10
|
|
|
11
|
-
export const
|
|
11
|
+
export const rpcEngineFromConnection = (connection: XyoConnection) => {
|
|
12
12
|
const engine = new JsonRpcEngine()
|
|
13
|
-
const handlers =
|
|
13
|
+
const handlers = rpcMethodHandlersFromConnection(connection)
|
|
14
14
|
engine.push(
|
|
15
15
|
createAsyncMiddleware(async (req, res) => {
|
|
16
16
|
// Get method name
|
|
@@ -5,11 +5,11 @@ import { rpcMethodHandlersFromRunner } from './rpcMethodHandlersFromRunner.ts'
|
|
|
5
5
|
import { rpcMethodHandlersFromSigner } from './rpcMethodHandlersFromSigner.ts'
|
|
6
6
|
import { rpcMethodHandlersFromViewer } from './rpcMethodHandlersFromViewer.ts'
|
|
7
7
|
|
|
8
|
-
export const
|
|
8
|
+
export const rpcMethodHandlersFromConnection = (connection: XyoConnection): XyoProviderRpcMethodHandlers => {
|
|
9
9
|
const {
|
|
10
10
|
runner, signer, viewer,
|
|
11
|
-
} =
|
|
12
|
-
let result: XyoProviderRpcMethodHandlers = { xyoProvider_send: params => (
|
|
11
|
+
} = connection
|
|
12
|
+
let result: XyoProviderRpcMethodHandlers = { xyoProvider_send: params => (connection 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) }
|
|
@@ -25,6 +25,7 @@ export class RpcXyoSigner implements XyoSigner {
|
|
|
25
25
|
return await this.transport.sendRequest('xyoSigner_address')
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
+
/** @deprecated - use signTransaction instead */
|
|
28
29
|
async createSignedTransaction(
|
|
29
30
|
chain: Chain,
|
|
30
31
|
elevatedPayloads: AllowedBlockPayload[],
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from 'vitest'
|
|
8
8
|
|
|
9
9
|
// eslint-disable-next-line import-x/no-internal-modules
|
|
10
|
-
import {
|
|
10
|
+
import { rpcEngineFromConnection } from '../../../engine/index-node.ts'
|
|
11
11
|
import { XyoSignerRpcSchemas } from '../../../index-node.ts'
|
|
12
12
|
import { MemoryRpcTransport } from '../../../transport/index.ts'
|
|
13
13
|
import { XyoBaseConnection } from '../../connection/index.ts'
|
|
@@ -20,8 +20,8 @@ describe('RpcEngine - XyoSigner', () => {
|
|
|
20
20
|
beforeAll(async () => {
|
|
21
21
|
const account = await Account.random()
|
|
22
22
|
const signer = new MemoryXyoSigner(account)
|
|
23
|
-
const
|
|
24
|
-
const engine =
|
|
23
|
+
const connection = new XyoBaseConnection({ signer })
|
|
24
|
+
const engine = rpcEngineFromConnection(connection)
|
|
25
25
|
const transport = new MemoryRpcTransport(engine, XyoSignerRpcSchemas)
|
|
26
26
|
sut = new RpcXyoSigner(transport)
|
|
27
27
|
})
|
package/src/types/ErrorCodes.ts
CHANGED
|
@@ -6,4 +6,5 @@ export const JsonRpcErrorCodes: Record<string, { code: number; message: string }
|
|
|
6
6
|
InvalidParams: { code: -32_602, message: 'Invalid method parameter(s).' },
|
|
7
7
|
InvalidRequest: { code: -32_600, message: 'The JSON sent is not a valid Request object.' },
|
|
8
8
|
MethodNotFound: { code: -32_601, message: 'The method does not exist or is not available.' },
|
|
9
|
+
UserRejected: { code: 4001, message: 'User rejected the request.' },
|
|
9
10
|
}
|
|
@@ -11,21 +11,6 @@ export const ChainConnectionZod = z.object({
|
|
|
11
11
|
url: z.string(),
|
|
12
12
|
})
|
|
13
13
|
|
|
14
|
-
export const CaveatTypesZod = z.enum(['chain', 'expiration', 'filteredResponse', 'rateLimit'])
|
|
15
|
-
|
|
16
|
-
export const CaveatsZod = z.object({
|
|
17
|
-
type: CaveatTypesZod,
|
|
18
|
-
value: z.unknown(), // JsonValue is usually unknown, adjust if you have a stricter type
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
export const PermissionZod = z.object({
|
|
22
|
-
capability: z.string(),
|
|
23
|
-
caveats: CaveatsZod.array().optional(),
|
|
24
|
-
invoker: z.string(),
|
|
25
|
-
})
|
|
26
|
-
|
|
27
|
-
export const InvokerPermissionZod = PermissionZod.extend({ date: z.number().optional() })
|
|
28
|
-
|
|
29
14
|
export type ChainConnection = z.infer<typeof ChainConnectionZod>
|
|
30
15
|
|
|
31
16
|
export const XyoGatewayRpcSchemas = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
2
2
|
import type { TransactionBoundWitness } from '@xyo-network/xl1-protocol'
|
|
3
3
|
import { AllowedBlockPayloadZod, asHydratedTransactionWithStorageMeta } from '@xyo-network/xl1-protocol'
|
|
4
|
-
import
|
|
4
|
+
import { z } from 'zod'
|
|
5
5
|
|
|
6
6
|
import type { XyoSignerRpcMethodName } from '../XyoSignerRpc.ts'
|
|
7
7
|
import {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod'
|
|
2
|
+
|
|
3
|
+
export const CaveatTypesZod = z.enum(['chain', 'expiration', 'filteredResponse', 'rateLimit'])
|
|
4
|
+
|
|
5
|
+
export const CaveatsZod = z.object({
|
|
6
|
+
type: CaveatTypesZod,
|
|
7
|
+
value: z.json(),
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export const PermissionZod = z.object({
|
|
11
|
+
capability: z.string(),
|
|
12
|
+
caveats: CaveatsZod.array().optional(),
|
|
13
|
+
invoker: z.string(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export const InvokerPermissionZod = PermissionZod.extend({ date: z.number().optional() })
|
|
17
|
+
|
|
18
|
+
export const PermissionRequestZod = z.record(z.string(), z.record(z.string(), z.any()))
|
|
19
|
+
|
|
20
|
+
export const RequestedPermissionZod = z.object({
|
|
21
|
+
capability: z.string(),
|
|
22
|
+
date: z.number().optional(),
|
|
23
|
+
})
|
|
@@ -6,6 +6,7 @@ export * from './HydratedBlock.ts'
|
|
|
6
6
|
export * from './HydratedTransaction.ts'
|
|
7
7
|
export * from './Json.ts'
|
|
8
8
|
export * from './Payload.ts'
|
|
9
|
+
export * from './Permission.ts'
|
|
9
10
|
export * from './Sequence.ts'
|
|
10
11
|
export * from './Stake.ts'
|
|
11
12
|
export * from './TransactionBoundWitness.ts'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpcEngineFromProvider.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcEngineFromProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAQ9D,eAAO,MAAM,qBAAqB,GAAI,UAAU,aAAa,kBA8C5D,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { XyoConnection } from '@xyo-network/xl1-protocol';
|
|
2
|
-
import type { XyoProviderRpcMethodHandlers } from '../types/index.ts';
|
|
3
|
-
export declare const rpcMethodHandlersFromProvider: (provider: XyoConnection) => XyoProviderRpcMethodHandlers;
|
|
4
|
-
//# sourceMappingURL=rpcMethodHandlersFromProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpcMethodHandlersFromProvider.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAKrE,eAAO,MAAM,6BAA6B,GAAI,UAAU,aAAa,KAAG,4BASvE,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpcEngineFromProvider.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcEngineFromProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAEhF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAQ9D,eAAO,MAAM,qBAAqB,GAAI,UAAU,aAAa,kBA8C5D,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { XyoConnection } from '@xyo-network/xl1-protocol';
|
|
2
|
-
import type { XyoProviderRpcMethodHandlers } from '../types/index.ts';
|
|
3
|
-
export declare const rpcMethodHandlersFromProvider: (provider: XyoConnection) => XyoProviderRpcMethodHandlers;
|
|
4
|
-
//# sourceMappingURL=rpcMethodHandlersFromProvider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rpcMethodHandlersFromProvider.d.ts","sourceRoot":"","sources":["../../../src/engine/rpcMethodHandlersFromProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AAKrE,eAAO,MAAM,6BAA6B,GAAI,UAAU,aAAa,KAAG,4BASvE,CAAA"}
|