mirror of
https://github.com/fluencelabs/eip712-validation-node
synced 2025-06-27 13:41:50 +00:00
bump peer versions
This commit is contained in:
3779
client-peer/package-lock.json
generated
3779
client-peer/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -14,8 +14,8 @@
|
|||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/aqua-lib": "^0.2.0",
|
"@fluencelabs/aqua-lib": "^0.2.0",
|
||||||
"@fluencelabs/fluence": "^0.14.2",
|
"@fluencelabs/fluence": "^0.19.1",
|
||||||
"@fluencelabs/fluence-network-environment": "^1.0.10",
|
"@fluencelabs/fluence-network-environment": "^1.0.13",
|
||||||
"it-all": "^1.0.5"
|
"it-all": "^1.0.5"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@ -38,8 +38,8 @@
|
|||||||
},
|
},
|
||||||
"homepage": "git+https://github.com/fluencelabs/eip712-validation-node/blob/main/README.md",
|
"homepage": "git+https://github.com/fluencelabs/eip712-validation-node/blob/main/README.md",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/aqua": "^0.5.0-246",
|
"@fluencelabs/aqua": "^0.6.0-246",
|
||||||
"typescript": "^4.5.2",
|
"typescript": "^4.5.5",
|
||||||
"ts-node": "^10.4.0"
|
"ts-node": "^10.4.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.1-239
|
* Aqua version: 0.6.0-272
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -16,69 +16,6 @@ import {
|
|||||||
|
|
||||||
// Services
|
// Services
|
||||||
|
|
||||||
export interface EIPValidatorDef {
|
|
||||||
eip712_validation_string: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
|
||||||
eip712_validation_url: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
|
||||||
}
|
|
||||||
export function registerEIPValidator(service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(serviceId: string, service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(peer: FluencePeer, service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(peer: FluencePeer, serviceId: string, service: EIPValidatorDef): void;
|
|
||||||
|
|
||||||
|
|
||||||
export function registerEIPValidator(...args: any) {
|
|
||||||
registerService(
|
|
||||||
args,
|
|
||||||
{
|
|
||||||
"defaultServiceId" : "EIPValidator",
|
|
||||||
"functions" : [
|
|
||||||
{
|
|
||||||
"functionName" : "eip712_validation_string",
|
|
||||||
"argDefs" : [
|
|
||||||
{
|
|
||||||
"name" : "eip_str",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name" : "peer_id",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"functionName" : "eip712_validation_url",
|
|
||||||
"argDefs" : [
|
|
||||||
{
|
|
||||||
"name" : "eip_str",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name" : "peer_id",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface DataProviderDef {
|
export interface DataProviderDef {
|
||||||
delete_records: (password: string, callParams: CallParams<'password'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
delete_records: (password: string, callParams: CallParams<'password'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
||||||
get_record: (signature: string, callParams: CallParams<'signature'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
get_record: (signature: string, callParams: CallParams<'signature'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
||||||
@ -188,15 +125,91 @@ export function registerConsensusService(...args: any) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface EIPValidatorDef {
|
||||||
|
eip712_validation_string: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
||||||
|
eip712_validation_url: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
||||||
|
}
|
||||||
|
export function registerEIPValidator(service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(serviceId: string, service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(peer: FluencePeer, service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(peer: FluencePeer, serviceId: string, service: EIPValidatorDef): void;
|
||||||
|
|
||||||
|
|
||||||
|
export function registerEIPValidator(...args: any) {
|
||||||
|
registerService(
|
||||||
|
args,
|
||||||
|
{
|
||||||
|
"defaultServiceId" : "EIPValidator",
|
||||||
|
"functions" : [
|
||||||
|
{
|
||||||
|
"functionName" : "eip712_validation_string",
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "eip_str",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "peer_id",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"functionName" : "eip712_validation_url",
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "eip_str",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "peer_id",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
export type Get_recordResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Get_recordResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function get_record(signature: string, node: string, relay: string, config?: {ttl?: number}): Promise<Get_recordResult>;
|
export function get_record(
|
||||||
export function get_record(peer: FluencePeer, signature: string, node: string, relay: string, config?: {ttl?: number}): Promise<Get_recordResult>;
|
signature: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordResult>;
|
||||||
|
|
||||||
|
export function get_record(
|
||||||
|
peer: FluencePeer,
|
||||||
|
signature: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordResult>;
|
||||||
|
|
||||||
export function get_record(...args: any) {
|
export function get_record(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -204,36 +217,33 @@ export function get_record(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call node ("DataProvider" "get_record") [signature] res)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call node ("DataProvider" "get_record") [signature] res)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||||
@ -286,12 +296,25 @@ export function get_record(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Delete_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Delete_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function delete_records(password: string, node: string, relay: string, config?: {ttl?: number}): Promise<Delete_recordsResult>;
|
export function delete_records(
|
||||||
export function delete_records(peer: FluencePeer, password: string, node: string, relay: string, config?: {ttl?: number}): Promise<Delete_recordsResult>;
|
password: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Delete_recordsResult>;
|
||||||
|
|
||||||
|
export function delete_records(
|
||||||
|
peer: FluencePeer,
|
||||||
|
password: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Delete_recordsResult>;
|
||||||
|
|
||||||
export function delete_records(...args: any) {
|
export function delete_records(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -299,36 +322,33 @@ export function delete_records(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "password") [] password)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "password") [] password)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call node ("DataProvider" "delete_records") [password] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call node ("DataProvider" "delete_records") [password] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -381,12 +401,25 @@ export function delete_records(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type ValidateResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
export type ValidateResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
||||||
export function validate(eip712_url: string, node: string, relay: string, config?: {ttl?: number}): Promise<ValidateResult>;
|
export function validate(
|
||||||
export function validate(peer: FluencePeer, eip712_url: string, node: string, relay: string, config?: {ttl?: number}): Promise<ValidateResult>;
|
eip712_url: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<ValidateResult>;
|
||||||
|
|
||||||
|
export function validate(
|
||||||
|
peer: FluencePeer,
|
||||||
|
eip712_url: string,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<ValidateResult>;
|
||||||
|
|
||||||
export function validate(...args: any) {
|
export function validate(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -394,36 +427,33 @@ export function validate(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "eip712_url") [] eip712_url)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "eip712_url") [] eip712_url)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call node ("EIPValidator" "eip712_validation_url") [eip712_url node] res)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call node ("EIPValidator" "eip712_validation_url") [eip712_url node] res)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||||
@ -476,46 +506,54 @@ export function validate(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function get_record_count(node: string, relay: string, config?: {ttl?: number}): Promise<number>;
|
export function get_record_count(
|
||||||
export function get_record_count(peer: FluencePeer, node: string, relay: string, config?: {ttl?: number}): Promise<number>;
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<number>;
|
||||||
|
|
||||||
|
export function get_record_count(
|
||||||
|
peer: FluencePeer,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<number>;
|
||||||
|
|
||||||
export function get_record_count(...args: any) {
|
export function get_record_count(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call node ("DataProvider" "get_record_count") [] res)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call node ("DataProvider" "get_record_count") [] res)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||||
@ -562,46 +600,54 @@ export function get_record_count(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Get_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Get_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: string; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function get_records(node: string, relay: string, config?: {ttl?: number}): Promise<Get_recordsResult>;
|
export function get_records(
|
||||||
export function get_records(peer: FluencePeer, node: string, relay: string, config?: {ttl?: number}): Promise<Get_recordsResult>;
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordsResult>;
|
||||||
|
|
||||||
|
export function get_records(
|
||||||
|
peer: FluencePeer,
|
||||||
|
node: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordsResult>;
|
||||||
|
|
||||||
export function get_records(...args: any) {
|
export function get_records(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "node") [] node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call node ("DataProvider" "get_records") [] res)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call node ("DataProvider" "get_records") [] res)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [res])
|
(call %init_peer_id% ("callbackSrv" "response") [res])
|
||||||
@ -648,12 +694,29 @@ export function get_records(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Eip_consensusResult = { stderr: string; stdout: { consensus: boolean; invalid: number; n: number; threshold: number; valid: number; }[]; }
|
export type Eip_consensusResult = { stderr: string; stdout: { consensus: boolean; invalid: number; n: number; threshold: number; valid: number; }[]; }
|
||||||
export function eip_consensus(signature: string, locations: { node_id: string; relay_id: string; }[], service_node: string, consensus_service: string, threshold: number, config?: {ttl?: number}): Promise<Eip_consensusResult>;
|
export function eip_consensus(
|
||||||
export function eip_consensus(peer: FluencePeer, signature: string, locations: { node_id: string; relay_id: string; }[], service_node: string, consensus_service: string, threshold: number, config?: {ttl?: number}): Promise<Eip_consensusResult>;
|
signature: string,
|
||||||
|
locations: { node_id: string; relay_id: string; }[],
|
||||||
|
service_node: string,
|
||||||
|
consensus_service: string,
|
||||||
|
threshold: number,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Eip_consensusResult>;
|
||||||
|
|
||||||
|
export function eip_consensus(
|
||||||
|
peer: FluencePeer,
|
||||||
|
signature: string,
|
||||||
|
locations: { node_id: string; relay_id: string; }[],
|
||||||
|
service_node: string,
|
||||||
|
consensus_service: string,
|
||||||
|
threshold: number,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Eip_consensusResult>;
|
||||||
|
|
||||||
export function eip_consensus(...args: any) {
|
export function eip_consensus(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -661,94 +724,84 @@ export function eip_consensus(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
||||||
(seq
|
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "locations") [] locations)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "service_node") [] service_node)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "consensus_service") [] consensus_service)
|
|
||||||
)
|
)
|
||||||
(call %init_peer_id% ("getDataSrv" "threshold") [] threshold)
|
(call %init_peer_id% ("getDataSrv" "locations") [] locations)
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "service_node") [] service_node)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "consensus_service") [] consensus_service)
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "threshold") [] threshold)
|
||||||
|
)
|
||||||
|
(new $result
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
(fold locations loc
|
(fold locations loc
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
(call loc.$.relay_id! ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call loc.$.node_id! ("DataProvider" "get_record") [signature] res)
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(match res.$.stdout.[0].ts_validation! true
|
||||||
(call loc.$.node_id! ("DataProvider" "get_record") [signature] res)
|
|
||||||
(xor
|
(xor
|
||||||
(match res.$.stdout.[0].ts_validation! true
|
|
||||||
(xor
|
|
||||||
(ap true $result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
|
||||||
)
|
|
||||||
)
|
|
||||||
)
|
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(ap false $result)
|
(ap true $result)
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
(call loc.$.relay_id! ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call loc.$.relay_id! ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
(seq
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
|
(call loc.$.relay_id! ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(ap false $result)
|
||||||
)
|
)
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
(call loc.$.relay_id! ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(call loc.$.relay_id! ("op" "noop") [])
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
(next loc)
|
(next loc)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(seq
|
|
||||||
(call -relay- ("op" "noop") [])
|
(call -relay- ("op" "noop") [])
|
||||||
(call service_node (consensus_service "consensus") [$result threshold] consensus)
|
|
||||||
)
|
)
|
||||||
(seq
|
(xor
|
||||||
(call -relay- ("op" "noop") [])
|
(seq
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
(call service_node (consensus_service "consensus") [$result threshold] consensus)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 3])
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [consensus])
|
(call %init_peer_id% ("callbackSrv" "response") [consensus])
|
||||||
|
Binary file not shown.
@ -11,17 +11,17 @@
|
|||||||
"author": "",
|
"author": "",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@fluencelabs/aqua": "^0.5.0-246",
|
"@fluencelabs/aqua": "^0.6.0-246",
|
||||||
"chokidar-cli": "^1.2.0",
|
"chokidar-cli": "^3.0.0",
|
||||||
"ts-node": "^10.4.0",
|
"ts-node": "^10.4.0",
|
||||||
"typescript": "^4.5.2"
|
"typescript": "^4.5.5"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@fluencelabs/fluence": "^0.15.1",
|
"@fluencelabs/fluence": "^0.19.1",
|
||||||
"@fluencelabs/fluence-network-environment": "1.0.10",
|
"@fluencelabs/fluence-network-environment": "1.0.13",
|
||||||
"@types/sqlite3": "^3.1.7",
|
"@types/sqlite3": "^3.1.8",
|
||||||
"base64-js": "^1.5.1",
|
"base64-js": "^1.5.1",
|
||||||
"ethers": "^5.4.7",
|
"ethers": "^5.5.4",
|
||||||
"ethers-eip712": "^0.2.0",
|
"ethers-eip712": "^0.2.0",
|
||||||
"got": "^11.8.2",
|
"got": "^11.8.2",
|
||||||
"sqlite3": "^5.0.2"
|
"sqlite3": "^5.0.2"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* This file is auto-generated. Do not edit manually: changes may be erased.
|
* This file is auto-generated. Do not edit manually: changes may be erased.
|
||||||
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
* Generated by Aqua compiler: https://github.com/fluencelabs/aqua/.
|
||||||
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
* If you find any bugs, please write an issue on GitHub: https://github.com/fluencelabs/aqua/issues
|
||||||
* Aqua version: 0.4.1-239
|
* Aqua version: 0.6.0-272
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
import { Fluence, FluencePeer } from '@fluencelabs/fluence';
|
||||||
@ -16,69 +16,6 @@ import {
|
|||||||
|
|
||||||
// Services
|
// Services
|
||||||
|
|
||||||
export interface EIPValidatorDef {
|
|
||||||
eip712_validation_string: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
|
||||||
eip712_validation_url: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
|
||||||
}
|
|
||||||
export function registerEIPValidator(service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(serviceId: string, service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(peer: FluencePeer, service: EIPValidatorDef): void;
|
|
||||||
export function registerEIPValidator(peer: FluencePeer, serviceId: string, service: EIPValidatorDef): void;
|
|
||||||
|
|
||||||
|
|
||||||
export function registerEIPValidator(...args: any) {
|
|
||||||
registerService(
|
|
||||||
args,
|
|
||||||
{
|
|
||||||
"defaultServiceId" : "snapshot",
|
|
||||||
"functions" : [
|
|
||||||
{
|
|
||||||
"functionName" : "eip712_validation_string",
|
|
||||||
"argDefs" : [
|
|
||||||
{
|
|
||||||
"name" : "eip_str",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name" : "peer_id",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"functionName" : "eip712_validation_url",
|
|
||||||
"argDefs" : [
|
|
||||||
{
|
|
||||||
"name" : "eip_str",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name" : "peer_id",
|
|
||||||
"argType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"returnType" : {
|
|
||||||
"tag" : "primitive"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface DataProviderDef {
|
export interface DataProviderDef {
|
||||||
delete_records: (password: string, callParams: CallParams<'password'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
delete_records: (password: string, callParams: CallParams<'password'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
||||||
get_record: (signnature: string, callParams: CallParams<'signnature'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
get_record: (signnature: string, callParams: CallParams<'signnature'>) => { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; } | Promise<{ stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }>;
|
||||||
@ -146,15 +83,91 @@ export function registerDataProvider(...args: any) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export interface EIPValidatorDef {
|
||||||
|
eip712_validation_string: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
||||||
|
eip712_validation_url: (eip_str: string, peer_id: string, callParams: CallParams<'eip_str' | 'peer_id'>) => { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; } | Promise<{ stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }>;
|
||||||
|
}
|
||||||
|
export function registerEIPValidator(service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(serviceId: string, service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(peer: FluencePeer, service: EIPValidatorDef): void;
|
||||||
|
export function registerEIPValidator(peer: FluencePeer, serviceId: string, service: EIPValidatorDef): void;
|
||||||
|
|
||||||
|
|
||||||
|
export function registerEIPValidator(...args: any) {
|
||||||
|
registerService(
|
||||||
|
args,
|
||||||
|
{
|
||||||
|
"defaultServiceId" : "snapshot",
|
||||||
|
"functions" : [
|
||||||
|
{
|
||||||
|
"functionName" : "eip712_validation_string",
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "eip_str",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "peer_id",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"functionName" : "eip712_validation_url",
|
||||||
|
"argDefs" : [
|
||||||
|
{
|
||||||
|
"name" : "eip_str",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name" : "peer_id",
|
||||||
|
"argType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"returnType" : {
|
||||||
|
"tag" : "primitive"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Functions
|
// Functions
|
||||||
|
|
||||||
export type Validate_from_urlResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
export type Validate_from_urlResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
||||||
export function validate_from_url(relay: string, peer_: string, eip712_url: string, config?: {ttl?: number}): Promise<Validate_from_urlResult>;
|
export function validate_from_url(
|
||||||
export function validate_from_url(peer: FluencePeer, relay: string, peer_: string, eip712_url: string, config?: {ttl?: number}): Promise<Validate_from_urlResult>;
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
eip712_url: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Validate_from_urlResult>;
|
||||||
|
|
||||||
|
export function validate_from_url(
|
||||||
|
peer: FluencePeer,
|
||||||
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
eip712_url: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Validate_from_urlResult>;
|
||||||
|
|
||||||
export function validate_from_url(...args: any) {
|
export function validate_from_url(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -162,36 +175,33 @@ export function validate_from_url(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "eip712_url") [] eip712_url)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "eip712_validation_url") [eip712_url peer] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "eip712_url") [] eip712_url)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "eip712_validation_url") [eip712_url peer] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -244,46 +254,54 @@ export function validate_from_url(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
export function get_count(relay: string, peer_: string, config?: {ttl?: number}): Promise<number>;
|
export function get_count(
|
||||||
export function get_count(peer: FluencePeer, relay: string, peer_: string, config?: {ttl?: number}): Promise<number>;
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<number>;
|
||||||
|
|
||||||
|
export function get_count(
|
||||||
|
peer: FluencePeer,
|
||||||
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<number>;
|
||||||
|
|
||||||
export function get_count(...args: any) {
|
export function get_count(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "get_record_count") [] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "get_record_count") [] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -330,12 +348,25 @@ export function get_count(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Get_recordResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Get_recordResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function get_record(relay: string, peer_: string, signature: string, config?: {ttl?: number}): Promise<Get_recordResult>;
|
export function get_record(
|
||||||
export function get_record(peer: FluencePeer, relay: string, peer_: string, signature: string, config?: {ttl?: number}): Promise<Get_recordResult>;
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
signature: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordResult>;
|
||||||
|
|
||||||
|
export function get_record(
|
||||||
|
peer: FluencePeer,
|
||||||
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
signature: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordResult>;
|
||||||
|
|
||||||
export function get_record(...args: any) {
|
export function get_record(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -343,36 +374,33 @@ export function get_record(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "get_record") [signature] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "signature") [] signature)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "get_record") [signature] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -425,12 +453,25 @@ export function get_record(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Delete_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Delete_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function delete_records(passwd: string, peer_: string, relay: string, config?: {ttl?: number}): Promise<Delete_recordsResult>;
|
export function delete_records(
|
||||||
export function delete_records(peer: FluencePeer, passwd: string, peer_: string, relay: string, config?: {ttl?: number}): Promise<Delete_recordsResult>;
|
passwd: string,
|
||||||
|
peer_: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Delete_recordsResult>;
|
||||||
|
|
||||||
|
export function delete_records(
|
||||||
|
peer: FluencePeer,
|
||||||
|
passwd: string,
|
||||||
|
peer_: string,
|
||||||
|
relay: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Delete_recordsResult>;
|
||||||
|
|
||||||
export function delete_records(...args: any) {
|
export function delete_records(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -438,36 +479,33 @@ export function delete_records(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "passwd") [] passwd)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "passwd") [] passwd)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "delete_records") [passwd] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "delete_records") [passwd] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -520,12 +558,25 @@ export function delete_records(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type ValidateResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
export type ValidateResult = { stderr: string; stdout: { signature: string; validation: { eip_validation: boolean; peer_id: string; timestamp: number; ts_validation: boolean; }; }; }
|
||||||
export function validate(relay: string, peer_: string, eip712_json: string, config?: {ttl?: number}): Promise<ValidateResult>;
|
export function validate(
|
||||||
export function validate(peer: FluencePeer, relay: string, peer_: string, eip712_json: string, config?: {ttl?: number}): Promise<ValidateResult>;
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
eip712_json: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<ValidateResult>;
|
||||||
|
|
||||||
|
export function validate(
|
||||||
|
peer: FluencePeer,
|
||||||
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
eip712_json: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<ValidateResult>;
|
||||||
|
|
||||||
export function validate(...args: any) {
|
export function validate(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
@ -533,36 +584,33 @@ export function validate(...args: any) {
|
|||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "eip712_json") [] eip712_json)
|
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "eip712_validation_string") [eip712_json peer] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "eip712_json") [] eip712_json)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "eip712_validation_string") [eip712_json peer] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
@ -615,46 +663,54 @@ export function validate(...args: any) {
|
|||||||
|
|
||||||
|
|
||||||
export type Get_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
export type Get_recordsResult = { stderr: string; stdout: { eip712_doc: string; eip_validation: boolean; event_address: string; peer_id: string; signature: number; signed_response: string; timestamp: number; ts_validation: boolean; }[]; }
|
||||||
export function get_records(relay: string, peer_: string, config?: {ttl?: number}): Promise<Get_recordsResult>;
|
export function get_records(
|
||||||
export function get_records(peer: FluencePeer, relay: string, peer_: string, config?: {ttl?: number}): Promise<Get_recordsResult>;
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordsResult>;
|
||||||
|
|
||||||
|
export function get_records(
|
||||||
|
peer: FluencePeer,
|
||||||
|
relay: string,
|
||||||
|
peer_: string,
|
||||||
|
config?: {ttl?: number}
|
||||||
|
): Promise<Get_recordsResult>;
|
||||||
|
|
||||||
export function get_records(...args: any) {
|
export function get_records(...args: any) {
|
||||||
|
|
||||||
let script = `
|
let script = `
|
||||||
(xor
|
(xor
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(seq
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
||||||
(seq
|
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
||||||
(call %init_peer_id% ("getDataSrv" "-relay-") [] -relay-)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "relay") [] relay)
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(xor
|
|
||||||
(call peer ("snapshot" "get_records") [] result)
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(seq
|
|
||||||
(call relay ("op" "noop") [])
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
|
||||||
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
|
||||||
)
|
|
||||||
(call -relay- ("op" "noop") [])
|
|
||||||
)
|
)
|
||||||
|
(call %init_peer_id% ("getDataSrv" "peer") [] peer)
|
||||||
)
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call relay ("op" "noop") [])
|
(call relay ("op" "noop") [])
|
||||||
)
|
)
|
||||||
(call -relay- ("op" "noop") [])
|
(xor
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call peer ("snapshot" "get_records") [] result)
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(seq
|
||||||
|
(seq
|
||||||
|
(call relay ("op" "noop") [])
|
||||||
|
(call -relay- ("op" "noop") [])
|
||||||
|
)
|
||||||
|
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
|
||||||
|
)
|
||||||
|
)
|
||||||
)
|
)
|
||||||
(xor
|
(xor
|
||||||
(call %init_peer_id% ("callbackSrv" "response") [result])
|
(call %init_peer_id% ("callbackSrv" "response") [result])
|
||||||
|
Reference in New Issue
Block a user