@xyo-network/xl1-rpc 1.7.18 → 1.7.19
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/index.mjs +183 -239
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/neutral/provider/client/MemoryXyoClient.d.ts +4 -5
- package/dist/neutral/provider/client/MemoryXyoClient.d.ts.map +1 -1
- package/dist/neutral/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts.map +1 -0
- package/dist/neutral/provider/client/PermissionsStore/PermissionsStore.d.ts.map +1 -0
- package/dist/neutral/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +1 -0
- package/dist/neutral/provider/client/PermissionsStore/index.d.ts.map +1 -0
- package/dist/neutral/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +1 -0
- package/dist/neutral/provider/client/index.d.ts +1 -1
- package/dist/neutral/provider/client/index.d.ts.map +1 -1
- package/dist/neutral/provider/host/Abstract.d.ts +9 -7
- package/dist/neutral/provider/host/Abstract.d.ts.map +1 -1
- package/dist/neutral/provider/host/MemoryXyoGateway.d.ts +5 -17
- package/dist/neutral/provider/host/MemoryXyoGateway.d.ts.map +1 -1
- package/dist/neutral/provider/host/index.d.ts +0 -2
- package/dist/neutral/provider/host/index.d.ts.map +1 -1
- package/dist/neutral/provider/index.d.ts +1 -0
- package/dist/neutral/provider/index.d.ts.map +1 -1
- package/dist/neutral/provider/provider/RpcXyoConnection.d.ts +0 -3
- package/dist/neutral/provider/provider/RpcXyoConnection.d.ts.map +1 -1
- package/dist/neutral/types/XyoGatewayRpc.d.ts +1 -1
- package/dist/neutral/types/XyoGatewayRpc.d.ts.map +1 -1
- package/dist/neutral/types/schema/XyoGatewayRpcSchemas.d.ts.map +1 -1
- package/dist/node/index-node.mjs +185 -241
- package/dist/node/index-node.mjs.map +1 -1
- package/dist/node/provider/client/MemoryXyoClient.d.ts +4 -5
- package/dist/node/provider/client/MemoryXyoClient.d.ts.map +1 -1
- package/dist/node/provider/client/PermissionsStore/MemoryPermissionsStore.d.ts.map +1 -0
- package/dist/node/provider/client/PermissionsStore/PermissionsStore.d.ts.map +1 -0
- package/dist/node/provider/client/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +1 -0
- package/dist/node/provider/client/PermissionsStore/index.d.ts.map +1 -0
- package/dist/node/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +1 -0
- package/dist/node/provider/client/index.d.ts +1 -1
- package/dist/node/provider/client/index.d.ts.map +1 -1
- package/dist/node/provider/host/Abstract.d.ts +9 -7
- package/dist/node/provider/host/Abstract.d.ts.map +1 -1
- package/dist/node/provider/host/MemoryXyoGateway.d.ts +5 -17
- package/dist/node/provider/host/MemoryXyoGateway.d.ts.map +1 -1
- package/dist/node/provider/host/index.d.ts +0 -2
- package/dist/node/provider/host/index.d.ts.map +1 -1
- package/dist/node/provider/index.d.ts +1 -0
- package/dist/node/provider/index.d.ts.map +1 -1
- package/dist/node/provider/provider/RpcXyoConnection.d.ts +0 -3
- package/dist/node/provider/provider/RpcXyoConnection.d.ts.map +1 -1
- package/dist/node/types/XyoGatewayRpc.d.ts +1 -1
- package/dist/node/types/XyoGatewayRpc.d.ts.map +1 -1
- package/dist/node/types/schema/XyoGatewayRpcSchemas.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/provider/client/MemoryXyoClient.ts +7 -6
- package/src/provider/client/PermissionsStore/getPermissionsStoreFromTransport.ts +12 -0
- package/src/provider/client/index.ts +1 -1
- package/src/provider/client/spec/MemoryXyoClient.spec.ts +13 -10
- package/src/provider/host/Abstract.ts +28 -7
- package/src/provider/host/MemoryXyoGateway.ts +8 -70
- package/src/provider/host/index.ts +0 -2
- package/src/provider/host/spec/MemoryXyoGateway.spec.ts +9 -50
- package/src/provider/index.ts +1 -0
- package/src/provider/provider/RpcXyoConnection.ts +0 -11
- package/src/types/XyoGatewayRpc.ts +1 -1
- package/src/types/schema/XyoGatewayRpcSchemas.ts +2 -0
- package/dist/neutral/provider/client/XyoClient.d.ts +0 -6
- package/dist/neutral/provider/client/XyoClient.d.ts.map +0 -1
- package/dist/neutral/provider/host/JsonRpcXyoGateway.d.ts +0 -16
- package/dist/neutral/provider/host/JsonRpcXyoGateway.d.ts.map +0 -1
- package/dist/neutral/provider/host/PermissionsStore/MemoryPermissionsStore.d.ts.map +0 -1
- package/dist/neutral/provider/host/PermissionsStore/PermissionsStore.d.ts.map +0 -1
- package/dist/neutral/provider/host/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +0 -1
- package/dist/neutral/provider/host/PermissionsStore/index.d.ts.map +0 -1
- package/dist/neutral/provider/host/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +0 -1
- package/dist/node/provider/client/XyoClient.d.ts +0 -6
- package/dist/node/provider/client/XyoClient.d.ts.map +0 -1
- package/dist/node/provider/host/JsonRpcXyoGateway.d.ts +0 -16
- package/dist/node/provider/host/JsonRpcXyoGateway.d.ts.map +0 -1
- package/dist/node/provider/host/PermissionsStore/MemoryPermissionsStore.d.ts.map +0 -1
- package/dist/node/provider/host/PermissionsStore/PermissionsStore.d.ts.map +0 -1
- package/dist/node/provider/host/PermissionsStore/getPermissionsStoreFromTransport.d.ts.map +0 -1
- package/dist/node/provider/host/PermissionsStore/index.d.ts.map +0 -1
- package/dist/node/provider/host/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts.map +0 -1
- package/src/provider/client/XyoClient.ts +0 -6
- package/src/provider/host/JsonRpcXyoGateway.ts +0 -41
- package/src/provider/host/PermissionsStore/getPermissionsStoreFromTransport.ts +0 -13
- /package/dist/neutral/provider/{host → client}/PermissionsStore/MemoryPermissionsStore.d.ts +0 -0
- /package/dist/neutral/provider/{host → client}/PermissionsStore/PermissionsStore.d.ts +0 -0
- /package/dist/neutral/provider/{host → client}/PermissionsStore/getPermissionsStoreFromTransport.d.ts +0 -0
- /package/dist/neutral/provider/{host → client}/PermissionsStore/index.d.ts +0 -0
- /package/dist/neutral/provider/{host → client}/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts +0 -0
- /package/dist/node/provider/{host → client}/PermissionsStore/MemoryPermissionsStore.d.ts +0 -0
- /package/dist/node/provider/{host → client}/PermissionsStore/PermissionsStore.d.ts +0 -0
- /package/dist/node/provider/{host → client}/PermissionsStore/getPermissionsStoreFromTransport.d.ts +0 -0
- /package/dist/node/provider/{host → client}/PermissionsStore/index.d.ts +0 -0
- /package/dist/node/provider/{host → client}/PermissionsStore/spec/MemoryPermissionsStore.spec.d.ts +0 -0
- /package/src/provider/{host → client}/PermissionsStore/MemoryPermissionsStore.ts +0 -0
- /package/src/provider/{host → client}/PermissionsStore/PermissionsStore.ts +0 -0
- /package/src/provider/{host → client}/PermissionsStore/index.ts +0 -0
- /package/src/provider/{host → client}/PermissionsStore/spec/MemoryPermissionsStore.spec.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/provider/client/PermissionsStore/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAA;AACrD,cAAc,6BAA6B,CAAA;AAC3C,cAAc,uBAAuB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryPermissionsStore.spec.d.ts","sourceRoot":"","sources":["../../../../../../src/provider/client/PermissionsStore/spec/MemoryPermissionsStore.spec.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,6BAA6B,CAAA"}
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import type { Promisable } from '@xylabs/promise';
|
|
2
2
|
import type { Payload } from '@xyo-network/payload-model';
|
|
3
|
-
import type { AllowedBlockPayload, HydratedTransaction, InvokerPermission, Permission, XyoConnectionProvider, XyoGatewayProvider, XyoRpcConnectionConfig } from '@xyo-network/xl1-protocol';
|
|
3
|
+
import type { AllowedBlockPayload, HydratedTransaction, InvokerPermission, Permission, XyoConnectionProvider, XyoGatewayProvider, XyoRpcConnectionConfig, XyoSigner } from '@xyo-network/xl1-protocol';
|
|
4
4
|
export declare abstract class AbstractXyoGateway implements XyoGatewayProvider {
|
|
5
|
+
activeConnection(): Promisable<XyoConnectionProvider | undefined>;
|
|
6
|
+
addConnection(config: XyoRpcConnectionConfig): Promisable<XyoConnectionProvider>;
|
|
7
|
+
connections(): Promisable<Record<string, XyoConnectionProvider>>;
|
|
8
|
+
getPermissions(): Promisable<InvokerPermission[]>;
|
|
9
|
+
requestPermissions(permissions: Permission[]): Promisable<boolean>;
|
|
10
|
+
revokePermissions(permissions: Permission[]): Promisable<boolean>;
|
|
5
11
|
submitTransaction(elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[]): Promise<HydratedTransaction>;
|
|
6
|
-
abstract
|
|
7
|
-
abstract
|
|
8
|
-
abstract connections(): Promisable<Record<string, XyoConnectionProvider>>;
|
|
9
|
-
abstract getPermissions(): Promisable<InvokerPermission[]>;
|
|
10
|
-
abstract requestPermissions(permissions: Permission[]): Promisable<boolean>;
|
|
11
|
-
abstract revokePermissions(permissions: Permission[]): Promisable<boolean>;
|
|
12
|
+
abstract connection(): Promisable<XyoConnectionProvider>;
|
|
13
|
+
abstract signer(): Promisable<XyoSigner>;
|
|
12
14
|
}
|
|
13
15
|
//# sourceMappingURL=Abstract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Abstract.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/Abstract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Abstract.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/Abstract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AACzD,OAAO,KAAK,EACV,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAAE,UAAU,EAC7B,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,SAAS,EACV,MAAM,2BAA2B,CAAA;AAElC,8BAAsB,kBAAmB,YAAW,kBAAkB;IACpE,gBAAgB,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAIjE,aAAa,CAAC,MAAM,EAAE,sBAAsB,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAIhF,WAAW,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAIhE,cAAc,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC;IAIjD,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IAIlE,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IAI3D,iBAAiB,CAAC,gBAAgB,EAAE,mBAAmB,EAAE,EAAE,kBAAkB,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAU7H,QAAQ,CAAC,UAAU,IAAI,UAAU,CAAC,qBAAqB,CAAC;IACxD,QAAQ,CAAC,MAAM,IAAI,UAAU,CAAC,SAAS,CAAC;CACzC"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { InvokerPermission, Permission, XyoConnectionProvider, XyoRpcConnectionConfig, XyoSigner } from '@xyo-network/xl1-protocol';
|
|
3
|
-
import type { XyoConnection } from '../provider/index.ts';
|
|
1
|
+
import type { XyoConnectionProvider, XyoSigner } from '@xyo-network/xl1-protocol';
|
|
4
2
|
import { AbstractXyoGateway } from './Abstract.ts';
|
|
5
|
-
import type { PermissionsStore } from './PermissionsStore/index.ts';
|
|
6
3
|
export declare class MemoryXyoGateway extends AbstractXyoGateway {
|
|
7
|
-
private
|
|
8
|
-
private readonly _connections;
|
|
9
|
-
private readonly _permissionsStore;
|
|
4
|
+
private readonly _connection;
|
|
10
5
|
private readonly _signer;
|
|
11
|
-
constructor(signer: XyoSigner,
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
addConnection(config: XyoRpcConnectionConfig): Promisable<XyoConnectionProvider>;
|
|
15
|
-
addConnection(name: string, connection: XyoConnection): Promisable<XyoConnectionProvider>;
|
|
16
|
-
connections(): Promisable<Record<string, XyoConnectionProvider>>;
|
|
17
|
-
getPermissions(): Promisable<InvokerPermission[]>;
|
|
18
|
-
requestPermissions(permissions: Permission[]): Promisable<boolean>;
|
|
19
|
-
revokePermissions(permissions: Permission[]): Promisable<boolean>;
|
|
20
|
-
private setActiveConnectionIdIfUndefined;
|
|
6
|
+
constructor(signer: XyoSigner, connection: XyoConnectionProvider);
|
|
7
|
+
connection(): XyoConnectionProvider;
|
|
8
|
+
signer(): XyoSigner;
|
|
21
9
|
}
|
|
22
10
|
//# sourceMappingURL=MemoryXyoGateway.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryXyoGateway.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/MemoryXyoGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"MemoryXyoGateway.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/MemoryXyoGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AAEjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAuB;IACnD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAW;gBAEvB,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,qBAAqB;IAMhE,UAAU,IAAI,qBAAqB;IAInC,MAAM,IAAI,SAAS;CAGpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,uBAAuB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAA;AACjC,cAAc,iBAAiB,CAAA;AAC/B,cAAc,oBAAoB,CAAA;AAClC,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA;AACjC,cAAc,mBAAmB,CAAA"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { AccountInstance } from '@xyo-network/account-model';
|
|
2
|
-
import type { Signed } from '@xyo-network/boundwitness-model';
|
|
3
|
-
import type { TransactionBoundWitness } from '@xyo-network/xl1-protocol';
|
|
4
2
|
import { XyoConnection } from './XyoConnection.ts';
|
|
5
3
|
export interface RpcXyoProviderParams {
|
|
6
4
|
account?: AccountInstance;
|
|
@@ -8,6 +6,5 @@ export interface RpcXyoProviderParams {
|
|
|
8
6
|
}
|
|
9
7
|
export declare class RpcXyoConnection extends XyoConnection {
|
|
10
8
|
constructor(params: RpcXyoProviderParams);
|
|
11
|
-
confirm(tx: Signed<TransactionBoundWitness>, onConfirm?: (txBWHash: string) => void, onTimeout?: () => void): Promise<void>;
|
|
12
9
|
}
|
|
13
10
|
//# sourceMappingURL=RpcXyoConnection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RpcXyoConnection.d.ts","sourceRoot":"","sources":["../../../../src/provider/provider/RpcXyoConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"RpcXyoConnection.d.ts","sourceRoot":"","sources":["../../../../src/provider/provider/RpcXyoConnection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAQjE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAElD,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,eAAe,CAAA;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,qBAAa,gBAAiB,SAAQ,aAAa;gBACrC,MAAM,EAAE,oBAAoB;CASzC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { XyoGatewayProvider } from '@xyo-network/xl1-protocol';
|
|
2
2
|
export type XyoGatewayMethodPrefix = 'xyoGateway';
|
|
3
|
-
export type XyoGatewayMethodName = keyof XyoGatewayProvider
|
|
3
|
+
export type XyoGatewayMethodName = keyof Pick<XyoGatewayProvider, 'submitTransaction'>;
|
|
4
4
|
export type XyoGatewayRpcMethodName = `${XyoGatewayMethodPrefix}_${XyoGatewayMethodName}`;
|
|
5
5
|
export type XyoGatewayRpcMethodHandlers = {
|
|
6
6
|
[K in XyoGatewayMethodName as `${XyoGatewayMethodPrefix}_${K}`]: (params: Parameters<XyoGatewayProvider[K]>) => ReturnType<XyoGatewayProvider[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoGatewayRpc.d.ts","sourceRoot":"","sources":["../../../src/types/XyoGatewayRpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAA;AAEjD,MAAM,MAAM,oBAAoB,GAAG,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"XyoGatewayRpc.d.ts","sourceRoot":"","sources":["../../../src/types/XyoGatewayRpc.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAEnE,MAAM,MAAM,sBAAsB,GAAG,YAAY,CAAA;AAEjD,MAAM,MAAM,oBAAoB,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,CAAA;AAGtF,MAAM,MAAM,uBAAuB,GAAG,GAAG,sBAAsB,IAAI,oBAAoB,EAAE,CAAA;AAGzF,MAAM,MAAM,2BAA2B,GAAG;KACvC,CAAC,IAAI,oBAAoB,IAAI,GAAG,sBAAsB,IAAI,CAAC,EAAE,GAAG,CAC/D,MAAM,EAAE,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,KACtC,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CACvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"XyoGatewayRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoGatewayRpcSchemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAA;AAEF,eAAO,MAAM,iBAAiB,qEAAmE,CAAA;AAEjG,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2D,CAAA;AAE/F,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,uBAAuB,
|
|
1
|
+
{"version":3,"file":"XyoGatewayRpcSchemas.d.ts","sourceRoot":"","sources":["../../../../src/types/schema/XyoGatewayRpcSchemas.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAA;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAErD,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAA;AAEF,eAAO,MAAM,iBAAiB,qEAAmE,CAAA;AAEjG,eAAO,MAAM,aAAa;;;;;;;;;EAGxB,CAAA;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;EAI3B,CAAA;AAEF,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2D,CAAA;AAE/F,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAA;AAEnE,eAAO,MAAM,oBAAoB,EAAE,YAAY,CAAC,uBAAuB,CA6EtE,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.7.
|
|
4
|
+
"version": "1.7.19",
|
|
5
5
|
"description": "XYO Layer One API",
|
|
6
6
|
"homepage": "https://xylabs.com",
|
|
7
7
|
"bugs": {
|
|
@@ -75,9 +75,9 @@
|
|
|
75
75
|
"@xyo-network/payload-builder": "~4.1.7",
|
|
76
76
|
"@xyo-network/payload-model": "~4.1.7",
|
|
77
77
|
"@xyo-network/payload-wrapper": "~4.1.7",
|
|
78
|
-
"@xyo-network/xl1-protocol": "~1.7.
|
|
79
|
-
"@xyo-network/xl1-protocol-sdk": "~1.7.
|
|
80
|
-
"@xyo-network/xl1-wrappers": "~1.7.
|
|
78
|
+
"@xyo-network/xl1-protocol": "~1.7.22",
|
|
79
|
+
"@xyo-network/xl1-protocol-sdk": "~1.7.19",
|
|
80
|
+
"@xyo-network/xl1-wrappers": "~1.7.19",
|
|
81
81
|
"axios": "~1.11.0",
|
|
82
82
|
"uuid": "~11.1.0",
|
|
83
83
|
"zod": "~3.25.76"
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
1
|
+
import type {
|
|
2
|
+
PermissionsProvider, XyoClient, XyoGatewayProvider,
|
|
3
|
+
} from '@xyo-network/xl1-protocol'
|
|
3
4
|
|
|
4
5
|
export class MemoryXyoClient implements XyoClient {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
gateways: Readonly<Record<string, XyoGatewayProvider>>
|
|
7
|
+
permissionsProvider: PermissionsProvider
|
|
7
8
|
|
|
8
|
-
constructor(
|
|
9
|
-
this.permissionsStore = permissionsStore
|
|
9
|
+
constructor(gateways: Readonly<Record<string, XyoGatewayProvider>>, permissionsProvider: PermissionsProvider) {
|
|
10
10
|
this.gateways = gateways
|
|
11
|
+
this.permissionsProvider = permissionsProvider
|
|
11
12
|
}
|
|
12
13
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type RpcTransport } from '../../../transport/index.ts'
|
|
2
|
+
import type { XyoGatewayRpcSchemas } from '../../../types/index.ts'
|
|
3
|
+
import type { PermissionsStore } from './PermissionsStore.ts'
|
|
4
|
+
|
|
5
|
+
export const getPermissionsStoreFromTransport = (transport: RpcTransport<typeof XyoGatewayRpcSchemas>): PermissionsStore => {
|
|
6
|
+
throw new Error('Not implemented')
|
|
7
|
+
// return {
|
|
8
|
+
// getPermissions: () => transport.sendRequest('xyoGateway_getPermissions'),
|
|
9
|
+
// requestPermissions: (permissions: Permission[]) => transport.sendRequest('xyoGateway_requestPermissions', permissions),
|
|
10
|
+
// revokePermissions: (permissions: Permission[]) => transport.sendRequest('xyoGateway_revokePermissions', permissions),
|
|
11
|
+
// }
|
|
12
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './MemoryXyoClient.ts'
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './PermissionsStore/index.ts'
|
|
@@ -2,18 +2,20 @@ import type { AccountInstance } from '@xyo-network/account-model'
|
|
|
2
2
|
import { PayloadBuilder } from '@xyo-network/payload-builder'
|
|
3
3
|
import type { Payload } from '@xyo-network/payload-model'
|
|
4
4
|
import { HDWallet } from '@xyo-network/wallet'
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
AllowedBlockPayload, HashPayload, XyoClient,
|
|
7
|
+
} from '@xyo-network/xl1-protocol'
|
|
6
8
|
import { HashSchema } from '@xyo-network/xl1-protocol'
|
|
7
9
|
import { ADDRESS_INDEX, generateXyoBaseWalletFromPhrase } from '@xyo-network/xl1-protocol-sdk'
|
|
8
10
|
import {
|
|
9
11
|
beforeAll, beforeEach, describe, expect, it,
|
|
10
12
|
} from 'vitest'
|
|
11
13
|
|
|
12
|
-
import {
|
|
14
|
+
import { MemoryXyoGateway } from '../../host/index.ts'
|
|
13
15
|
import { RpcXyoConnection } from '../../provider/index.ts'
|
|
14
16
|
import { MemoryXyoSigner } from '../../signer/index.ts'
|
|
15
17
|
import { MemoryXyoClient } from '../MemoryXyoClient.ts'
|
|
16
|
-
import
|
|
18
|
+
import { MemoryPermissionsStore } from '../PermissionsStore/index.ts'
|
|
17
19
|
|
|
18
20
|
type TestPayload = Payload<{
|
|
19
21
|
id: string
|
|
@@ -26,6 +28,7 @@ describe('Client', () => {
|
|
|
26
28
|
let account: AccountInstance
|
|
27
29
|
let signer: MemoryXyoSigner
|
|
28
30
|
let store: MemoryPermissionsStore
|
|
31
|
+
let connection: RpcXyoConnection
|
|
29
32
|
let gateway: MemoryXyoGateway
|
|
30
33
|
let client: XyoClient
|
|
31
34
|
|
|
@@ -35,13 +38,13 @@ describe('Client', () => {
|
|
|
35
38
|
account = await wallet.derivePath(ADDRESS_INDEX.XYO)
|
|
36
39
|
signer = new MemoryXyoSigner(account)
|
|
37
40
|
store = new MemoryPermissionsStore()
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
client = new MemoryXyoClient(
|
|
41
|
+
connection = new RpcXyoConnection({ endpoint, account })
|
|
42
|
+
gateway = new MemoryXyoGateway(signer, connection)
|
|
43
|
+
client = new MemoryXyoClient({ localhost: gateway }, store)
|
|
41
44
|
})
|
|
42
45
|
|
|
43
46
|
describe('gateways', () => {
|
|
44
|
-
describe('
|
|
47
|
+
describe('connection', () => {
|
|
45
48
|
let onChainPayloads: AllowedBlockPayload[]
|
|
46
49
|
let offChainPayloads: Payload[]
|
|
47
50
|
beforeAll(async () => {
|
|
@@ -52,15 +55,15 @@ describe('Client', () => {
|
|
|
52
55
|
offChainPayloads = [id]
|
|
53
56
|
})
|
|
54
57
|
it('should be defined', () => {
|
|
55
|
-
const gateway = client.gateways.localhost.
|
|
58
|
+
const gateway = client.gateways.localhost.connection()
|
|
56
59
|
expect(gateway).toBeDefined()
|
|
57
60
|
})
|
|
58
61
|
it('should allow retrieving the chain ID', async () => {
|
|
59
|
-
const chainId = await client.gateways.localhost?.
|
|
62
|
+
const chainId = await (await client.gateways.localhost?.connection())?.viewer?.chainId()
|
|
60
63
|
expect(chainId).toBeDefined()
|
|
61
64
|
})
|
|
62
65
|
it.only('should allow for submitting transactions', async () => {
|
|
63
|
-
const transaction = await client.gateways.localhost?.
|
|
66
|
+
const transaction = await (await client.gateways.localhost?.connection())?.submitTransaction?.(onChainPayloads, offChainPayloads)
|
|
64
67
|
expect(transaction).toBeDefined()
|
|
65
68
|
})
|
|
66
69
|
})
|
|
@@ -8,23 +8,44 @@ import type {
|
|
|
8
8
|
XyoConnectionProvider,
|
|
9
9
|
XyoGatewayProvider,
|
|
10
10
|
XyoRpcConnectionConfig,
|
|
11
|
+
XyoSigner,
|
|
11
12
|
} from '@xyo-network/xl1-protocol'
|
|
12
13
|
|
|
13
14
|
export abstract class AbstractXyoGateway implements XyoGatewayProvider {
|
|
15
|
+
activeConnection(): Promisable<XyoConnectionProvider | undefined> {
|
|
16
|
+
throw new Error('Deprecated method not implemented.')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
addConnection(config: XyoRpcConnectionConfig): Promisable<XyoConnectionProvider> {
|
|
20
|
+
throw new Error('Deprecated method not implemented.')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
connections(): Promisable<Record<string, XyoConnectionProvider>> {
|
|
24
|
+
throw new Error('Deprecated method not implemented.')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
getPermissions(): Promisable<InvokerPermission[]> {
|
|
28
|
+
throw new Error('Deprecated method not implemented.')
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
requestPermissions(permissions: Permission[]): Promisable<boolean> {
|
|
32
|
+
throw new Error('Deprecated method not implemented.')
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
revokePermissions(permissions: Permission[]): Promisable<boolean> {
|
|
36
|
+
throw new Error('Deprecated method not implemented.')
|
|
37
|
+
}
|
|
38
|
+
|
|
14
39
|
async submitTransaction(elevatedPayloads: AllowedBlockPayload[], additionalPayloads: Payload[]): Promise<HydratedTransaction> {
|
|
15
40
|
return assertEx(
|
|
16
41
|
assertEx(
|
|
17
|
-
await this.
|
|
42
|
+
await this.connection(),
|
|
18
43
|
() => 'No active connection available for transaction submission',
|
|
19
44
|
).submitTransaction,
|
|
20
45
|
() => 'Active connection does not support transaction submission',
|
|
21
46
|
)(elevatedPayloads, additionalPayloads)
|
|
22
47
|
}
|
|
23
48
|
|
|
24
|
-
abstract
|
|
25
|
-
abstract
|
|
26
|
-
abstract connections(): Promisable<Record<string, XyoConnectionProvider>>
|
|
27
|
-
abstract getPermissions(): Promisable<InvokerPermission[]>
|
|
28
|
-
abstract requestPermissions(permissions: Permission[]): Promisable<boolean>
|
|
29
|
-
abstract revokePermissions(permissions: Permission[]): Promisable<boolean>
|
|
49
|
+
abstract connection(): Promisable<XyoConnectionProvider>
|
|
50
|
+
abstract signer(): Promisable<XyoSigner>
|
|
30
51
|
}
|
|
@@ -1,84 +1,22 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { isDefined } from '@xylabs/typeof'
|
|
3
|
-
import type {
|
|
4
|
-
InvokerPermission, Permission, XyoConnectionProvider, XyoRpcConnectionConfig, XyoSigner,
|
|
5
|
-
} from '@xyo-network/xl1-protocol'
|
|
1
|
+
import type { XyoConnectionProvider, XyoSigner } from '@xyo-network/xl1-protocol'
|
|
6
2
|
|
|
7
|
-
import type { XyoConnection } from '../provider/index.ts'
|
|
8
|
-
import { RpcXyoConnection } from '../provider/index.ts'
|
|
9
3
|
import { AbstractXyoGateway } from './Abstract.ts'
|
|
10
|
-
import type { PermissionsStore } from './PermissionsStore/index.ts'
|
|
11
4
|
|
|
12
5
|
export class MemoryXyoGateway extends AbstractXyoGateway {
|
|
13
|
-
private
|
|
14
|
-
private readonly _connections: Map<string, XyoConnectionProvider> = new Map()
|
|
15
|
-
private readonly _permissionsStore: PermissionsStore
|
|
6
|
+
private readonly _connection: XyoConnectionProvider
|
|
16
7
|
private readonly _signer: XyoSigner
|
|
17
8
|
|
|
18
|
-
constructor(signer: XyoSigner,
|
|
9
|
+
constructor(signer: XyoSigner, connection: XyoConnectionProvider) {
|
|
19
10
|
super()
|
|
20
11
|
this._signer = signer
|
|
21
|
-
this.
|
|
12
|
+
this._connection = connection
|
|
22
13
|
}
|
|
23
14
|
|
|
24
|
-
|
|
25
|
-
return this.
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
activeConnection(): XyoConnectionProvider | undefined {
|
|
29
|
-
return isDefined(this._activeConnectionId)
|
|
30
|
-
? this._connections.get(this._activeConnectionId)
|
|
31
|
-
: undefined
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// TODO: Deprecate connection config in favor of connection object
|
|
35
|
-
addConnection(config: XyoRpcConnectionConfig): Promisable<XyoConnectionProvider>
|
|
36
|
-
addConnection(name: string, connection: XyoConnection): Promisable<XyoConnectionProvider>
|
|
37
|
-
addConnection(configOrName: XyoRpcConnectionConfig | string, connection?: XyoConnection): Promisable<XyoConnectionProvider> {
|
|
38
|
-
if (typeof configOrName === 'string' && connection !== undefined) {
|
|
39
|
-
// Called with (name: string, connection: XyoConnection)
|
|
40
|
-
const name = configOrName
|
|
41
|
-
this._connections.set(name, connection)
|
|
42
|
-
this.setActiveConnectionIdIfUndefined(name)
|
|
43
|
-
return connection
|
|
44
|
-
} else if (typeof configOrName === 'object') {
|
|
45
|
-
// Called with (config: XyoRpcConnectionConfig)
|
|
46
|
-
const config = configOrName
|
|
47
|
-
const {
|
|
48
|
-
name, dataLakeEndpoint, networkEndpoint,
|
|
49
|
-
} = config
|
|
50
|
-
const rpcConnection = new RpcXyoConnection({ endpoint: networkEndpoint })
|
|
51
|
-
this._connections.set(name, rpcConnection)
|
|
52
|
-
this.setActiveConnectionIdIfUndefined(name)
|
|
53
|
-
return rpcConnection
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
throw new Error('Invalid arguments passed to addConnection')
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
connections(): Promisable<Record<string, XyoConnectionProvider>> {
|
|
60
|
-
const record: Record<string, XyoConnectionProvider> = {}
|
|
61
|
-
for (const [id, conn] of this._connections.entries()) {
|
|
62
|
-
record[id] = conn
|
|
63
|
-
}
|
|
64
|
-
return record
|
|
15
|
+
connection(): XyoConnectionProvider {
|
|
16
|
+
return this._connection
|
|
65
17
|
}
|
|
66
18
|
|
|
67
|
-
|
|
68
|
-
return this.
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
requestPermissions(permissions: Permission[]): Promisable<boolean> {
|
|
72
|
-
return this._permissionsStore.requestPermissions(permissions)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
revokePermissions(permissions: Permission[]): Promisable<boolean> {
|
|
76
|
-
return this._permissionsStore.revokePermissions(permissions)
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
private setActiveConnectionIdIfUndefined(id: string): void {
|
|
80
|
-
if (!isDefined(this._activeConnectionId)) {
|
|
81
|
-
this._activeConnectionId = id
|
|
82
|
-
}
|
|
19
|
+
signer(): XyoSigner {
|
|
20
|
+
return this._signer
|
|
83
21
|
}
|
|
84
22
|
}
|
|
@@ -7,72 +7,31 @@ import {
|
|
|
7
7
|
import { RpcXyoConnection } from '../../provider/index.ts'
|
|
8
8
|
import { MemoryXyoSigner } from '../../signer/index.ts'
|
|
9
9
|
import { MemoryXyoGateway } from '../MemoryXyoGateway.ts'
|
|
10
|
-
import { MemoryPermissionsStore } from '../PermissionsStore/index.ts'
|
|
11
10
|
|
|
12
11
|
describe('MemoryXyoGateway', () => {
|
|
13
12
|
const endpoint = 'http://localhost:8080/rpc'
|
|
14
13
|
const dataLakeEndpoint = 'http://localhost:8080/chain/archivist'
|
|
15
14
|
let account: AccountInstance
|
|
16
15
|
let signer: MemoryXyoSigner
|
|
17
|
-
let
|
|
16
|
+
let connection: RpcXyoConnection
|
|
18
17
|
let sut: MemoryXyoGateway
|
|
19
18
|
|
|
20
19
|
beforeEach(async () => {
|
|
21
20
|
account = await Account.random()
|
|
22
21
|
signer = new MemoryXyoSigner(account)
|
|
23
22
|
|
|
24
|
-
|
|
25
|
-
sut = new MemoryXyoGateway(signer,
|
|
23
|
+
connection = new RpcXyoConnection({ endpoint, account })
|
|
24
|
+
sut = new MemoryXyoGateway(signer, connection)
|
|
26
25
|
})
|
|
27
26
|
|
|
28
|
-
describe('
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const config = {
|
|
32
|
-
name: 'localhost', dataLakeEndpoint, networkEndpoint: endpoint,
|
|
33
|
-
}
|
|
34
|
-
const response = await sut.addConnection(config)
|
|
35
|
-
expect(response).toBeDefined()
|
|
36
|
-
})
|
|
37
|
-
it('with connection', async () => {
|
|
38
|
-
const connection = new RpcXyoConnection({ endpoint, account })
|
|
39
|
-
const response = await sut.addConnection('localhost', connection)
|
|
40
|
-
expect(response).toBeDefined()
|
|
41
|
-
expect(response).toBe(connection)
|
|
42
|
-
})
|
|
27
|
+
describe('connection', () => {
|
|
28
|
+
it('should return the connection', () => {
|
|
29
|
+
expect(sut.connection()).toBeDefined()
|
|
43
30
|
})
|
|
44
31
|
})
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
it('should have no active connection', () => {
|
|
49
|
-
expect(sut.activeConnection()).toBeUndefined()
|
|
50
|
-
})
|
|
51
|
-
})
|
|
52
|
-
describe('with connections', () => {
|
|
53
|
-
it('should return the active connection', async () => {
|
|
54
|
-
const connection = new RpcXyoConnection({ endpoint, account })
|
|
55
|
-
await sut.addConnection('localhost', connection)
|
|
56
|
-
expect(sut.activeConnection()).toBeDefined()
|
|
57
|
-
})
|
|
58
|
-
})
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
describe('connections', () => {
|
|
62
|
-
describe('with connections', () => {
|
|
63
|
-
const name = 'localhost'
|
|
64
|
-
let connection: RpcXyoConnection
|
|
65
|
-
beforeEach(async () => {
|
|
66
|
-
connection = new RpcXyoConnection({ endpoint, account })
|
|
67
|
-
await sut.addConnection(name, connection)
|
|
68
|
-
})
|
|
69
|
-
it('should return connections', async () => {
|
|
70
|
-
const response = await sut.connections()
|
|
71
|
-
expect(response).toBeDefined()
|
|
72
|
-
expect(response).toHaveProperty(name)
|
|
73
|
-
expect(Object.keys(response)).toHaveLength(1)
|
|
74
|
-
expect(response[name]).toBe(connection)
|
|
75
|
-
})
|
|
32
|
+
describe('signer', () => {
|
|
33
|
+
it('should return the signer', () => {
|
|
34
|
+
expect(sut.signer()).toBeDefined()
|
|
76
35
|
})
|
|
77
36
|
})
|
|
78
37
|
})
|
package/src/provider/index.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { AccountInstance } from '@xyo-network/account-model'
|
|
2
|
-
import type { Signed } from '@xyo-network/boundwitness-model'
|
|
3
|
-
import type { TransactionBoundWitness } from '@xyo-network/xl1-protocol'
|
|
4
2
|
|
|
5
3
|
import {
|
|
6
4
|
HttpRpcTransport, XyoRunnerRpcSchemas, XyoViewerRpcSchemas,
|
|
@@ -8,7 +6,6 @@ import {
|
|
|
8
6
|
import { JsonRpcXyoRunner } from '../runner/index.ts'
|
|
9
7
|
import { MemoryXyoSigner } from '../signer/index.ts'
|
|
10
8
|
import { JsonRpcXyoViewer } from '../viewer/index.ts'
|
|
11
|
-
import { confirmTransaction } from './confirmTransaction.ts'
|
|
12
9
|
import { XyoConnection } from './XyoConnection.ts'
|
|
13
10
|
|
|
14
11
|
export interface RpcXyoProviderParams {
|
|
@@ -26,12 +23,4 @@ export class RpcXyoConnection extends XyoConnection {
|
|
|
26
23
|
signer, runner, viewer,
|
|
27
24
|
})
|
|
28
25
|
}
|
|
29
|
-
|
|
30
|
-
async confirm(
|
|
31
|
-
tx: Signed<TransactionBoundWitness>,
|
|
32
|
-
onConfirm?: (txBWHash: string) => void,
|
|
33
|
-
onTimeout?: () => void,
|
|
34
|
-
) {
|
|
35
|
-
return await confirmTransaction(this, tx, onConfirm, onTimeout)
|
|
36
|
-
}
|
|
37
26
|
}
|
|
@@ -2,7 +2,7 @@ import type { XyoGatewayProvider } from '@xyo-network/xl1-protocol'
|
|
|
2
2
|
|
|
3
3
|
export type XyoGatewayMethodPrefix = 'xyoGateway'
|
|
4
4
|
|
|
5
|
-
export type XyoGatewayMethodName = keyof XyoGatewayProvider
|
|
5
|
+
export type XyoGatewayMethodName = keyof Pick<XyoGatewayProvider, 'submitTransaction'>
|
|
6
6
|
|
|
7
7
|
// Convert `getPermissions` to `xyoGateway_getPermissions`, etc.
|
|
8
8
|
export type XyoGatewayRpcMethodName = `${XyoGatewayMethodPrefix}_${XyoGatewayMethodName}`
|
|
@@ -29,6 +29,7 @@ export const InvokerPermissionSchema = PermissionSchema.extend({ date: z.number(
|
|
|
29
29
|
export type ChainConnection = z.infer<typeof ChainConnectionSchema>
|
|
30
30
|
|
|
31
31
|
export const XyoGatewayRpcSchemas: RpcSchemaMap<XyoGatewayRpcMethodName> = {
|
|
32
|
+
/*
|
|
32
33
|
xyoGateway_addConnection: {
|
|
33
34
|
params: {
|
|
34
35
|
to: z.tuple([ChainConnectionSchema]),
|
|
@@ -89,6 +90,7 @@ export const XyoGatewayRpcSchemas: RpcSchemaMap<XyoGatewayRpcMethodName> = {
|
|
|
89
90
|
to: z.string().optional(),
|
|
90
91
|
},
|
|
91
92
|
},
|
|
93
|
+
*/
|
|
92
94
|
xyoGateway_submitTransaction: {
|
|
93
95
|
params: {
|
|
94
96
|
from: z.array(
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"XyoClient.d.ts","sourceRoot":"","sources":["../../../../src/provider/client/XyoClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAA;AAE1E,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAA;IACpD,gBAAgB,EAAE,gBAAgB,CAAA;CACnC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Promisable } from '@xylabs/promise';
|
|
2
|
-
import type { InvokerPermission, Permission, XyoConnectionProvider, XyoRpcConnectionConfig } from '@xyo-network/xl1-protocol';
|
|
3
|
-
import type { RpcTransport } from '../../transport/index.ts';
|
|
4
|
-
import type { XyoGatewayRpcSchemas } from '../../types/index.ts';
|
|
5
|
-
import { AbstractXyoGateway } from './Abstract.ts';
|
|
6
|
-
export declare class JsonRpcXyoGateway extends AbstractXyoGateway {
|
|
7
|
-
private readonly _transport;
|
|
8
|
-
constructor(transport: RpcTransport<typeof XyoGatewayRpcSchemas>);
|
|
9
|
-
activeConnection(): Promisable<XyoConnectionProvider | undefined>;
|
|
10
|
-
addConnection(_config: XyoRpcConnectionConfig): Promisable<XyoConnectionProvider>;
|
|
11
|
-
connections(): Promisable<Record<string, XyoConnectionProvider>>;
|
|
12
|
-
getPermissions(): Promisable<InvokerPermission[]>;
|
|
13
|
-
requestPermissions(permissions: Permission[]): Promisable<boolean>;
|
|
14
|
-
revokePermissions(permissions: Permission[]): Promisable<boolean>;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=JsonRpcXyoGateway.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"JsonRpcXyoGateway.d.ts","sourceRoot":"","sources":["../../../../src/provider/host/JsonRpcXyoGateway.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EACV,iBAAiB,EAAE,UAAU,EAAE,qBAAqB,EAAE,sBAAsB,EAC7E,MAAM,2BAA2B,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAElD,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA2C;gBAE1D,SAAS,EAAE,YAAY,CAAC,OAAO,oBAAoB,CAAC;IAKhE,gBAAgB,IAAI,UAAU,CAAC,qBAAqB,GAAG,SAAS,CAAC;IAIjE,aAAa,CAAC,OAAO,EAAE,sBAAsB,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAIjF,WAAW,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;IAIhE,cAAc,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC;IAIjD,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IAIlE,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;CAGlE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MemoryPermissionsStore.d.ts","sourceRoot":"","sources":["../../../../../src/provider/host/PermissionsStore/MemoryPermissionsStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE9E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,qBAAa,sBAAuB,YAAW,gBAAgB;IAC7D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA4C;IAEnE,cAAc,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC;IAIjD,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IASlE,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC;IAQjE,OAAO,CAAC,MAAM;CAGf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PermissionsStore.d.ts","sourceRoot":"","sources":["../../../../../src/provider/host/PermissionsStore/PermissionsStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAA;AAE9E,MAAM,WAAW,gBAAgB;IAC/B,cAAc,IAAI,UAAU,CAAC,iBAAiB,EAAE,CAAC,CAAA;IACjD,kBAAkB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;IAClE,iBAAiB,CAAC,WAAW,EAAE,UAAU,EAAE,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;CAClE"}
|