bump peer versions

This commit is contained in:
boneyard93501
2022-02-06 14:59:43 -06:00
parent 55ff01e60c
commit bd1c59122f
6 changed files with 3878 additions and 984 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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"
} }
} }

View File

@ -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,11 +125,87 @@ 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 = `
@ -201,8 +214,6 @@ export function get_record(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -218,8 +229,13 @@ export function get_record(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call node ("DataProvider" "get_record") [signature] res)
(seq (seq
(seq
(call node ("DataProvider" "get_record") [signature] res)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -227,14 +243,8 @@ export function get_record(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [res]) (call %init_peer_id% ("callbackSrv" "response") [res])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -286,8 +296,21 @@ 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 = `
@ -296,8 +319,6 @@ export function delete_records(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -313,8 +334,13 @@ export function delete_records(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call node ("DataProvider" "delete_records") [password] result)
(seq (seq
(seq
(call node ("DataProvider" "delete_records") [password] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -322,14 +348,8 @@ export function delete_records(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -381,8 +401,21 @@ 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 = `
@ -391,8 +424,6 @@ export function validate(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -408,8 +439,13 @@ export function validate(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call node ("EIPValidator" "eip712_validation_url") [eip712_url node] res)
(seq (seq
(seq
(call node ("EIPValidator" "eip712_validation_url") [eip712_url node] res)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -417,14 +453,8 @@ export function validate(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [res]) (call %init_peer_id% ("callbackSrv" "response") [res])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -476,8 +506,19 @@ 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 = `
@ -485,8 +526,6 @@ export function get_record_count(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -500,8 +539,13 @@ export function get_record_count(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call node ("DataProvider" "get_record_count") [] res)
(seq (seq
(seq
(call node ("DataProvider" "get_record_count") [] res)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -509,14 +553,8 @@ export function get_record_count(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [res]) (call %init_peer_id% ("callbackSrv" "response") [res])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -562,8 +600,19 @@ 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 = `
@ -571,8 +620,6 @@ export function get_records(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -586,8 +633,13 @@ export function get_records(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call node ("DataProvider" "get_records") [] res)
(seq (seq
(seq
(call node ("DataProvider" "get_records") [] res)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -595,14 +647,8 @@ export function get_records(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [res]) (call %init_peer_id% ("callbackSrv" "response") [res])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -648,8 +694,25 @@ 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 = `
@ -657,9 +720,6 @@ export function eip_consensus(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -675,9 +735,10 @@ export function eip_consensus(...args: any) {
) )
(call %init_peer_id% ("getDataSrv" "threshold") [] threshold) (call %init_peer_id% ("getDataSrv" "threshold") [] threshold)
) )
(new $result
(seq
(seq
(fold locations loc (fold locations loc
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -690,9 +751,13 @@ export function eip_consensus(...args: any) {
(xor (xor
(match res.$.stdout.[0].ts_validation! true (match res.$.stdout.[0].ts_validation! true
(xor (xor
(seq
(seq
(ap true $result) (ap true $result)
(seq (call loc.$.relay_id! ("op" "noop") [])
(seq )
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call loc.$.relay_id! ("op" "noop") []) (call loc.$.relay_id! ("op" "noop") [])
@ -700,47 +765,35 @@ export function eip_consensus(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
)
(seq
(seq
(seq
(seq
(call -relay- ("op" "noop") [])
(call loc.$.relay_id! ("op" "noop") []) (call loc.$.relay_id! ("op" "noop") [])
) )
)
)
(seq
(seq
(ap false $result) (ap false $result)
)
(call loc.$.relay_id! ("op" "noop") []) (call loc.$.relay_id! ("op" "noop") [])
) )
(call -relay- ("op" "noop") []) (call -relay- ("op" "noop") [])
) )
) )
) )
(seq
(seq
(seq
(call loc.$.relay_id! ("op" "noop") [])
(call -relay- ("op" "noop") [])
)
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
) )
(call -relay- ("op" "noop") [])
)
)
)
(call loc.$.relay_id! ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
) )
(next loc) (next loc)
) )
) )
)
(call -relay- ("op" "noop") []) (call -relay- ("op" "noop") [])
) )
(xor (xor
(seq (seq
(call -relay- ("op" "noop") [])
(call service_node (consensus_service "consensus") [$result threshold] consensus) (call service_node (consensus_service "consensus") [$result threshold] consensus)
(call -relay- ("op" "noop") [])
) )
(seq (seq
(call -relay- ("op" "noop") []) (call -relay- ("op" "noop") [])
@ -748,7 +801,7 @@ export function eip_consensus(...args: any) {
) )
) )
) )
(call -relay- ("op" "noop") []) )
) )
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [consensus]) (call %init_peer_id% ("callbackSrv" "response") [consensus])

Binary file not shown.

View File

@ -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"

View File

@ -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,11 +83,87 @@ 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 = `
@ -159,8 +172,6 @@ export function validate_from_url(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -176,8 +187,13 @@ export function validate_from_url(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "eip712_validation_url") [eip712_url peer] result)
(seq (seq
(seq
(call peer ("snapshot" "eip712_validation_url") [eip712_url peer] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -185,14 +201,8 @@ export function validate_from_url(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -244,8 +254,19 @@ 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 = `
@ -253,8 +274,6 @@ export function get_count(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -268,8 +287,13 @@ export function get_count(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "get_record_count") [] result)
(seq (seq
(seq
(call peer ("snapshot" "get_record_count") [] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -277,14 +301,8 @@ export function get_count(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -330,8 +348,21 @@ 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 = `
@ -340,8 +371,6 @@ export function get_record(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -357,8 +386,13 @@ export function get_record(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "get_record") [signature] result)
(seq (seq
(seq
(call peer ("snapshot" "get_record") [signature] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -366,14 +400,8 @@ export function get_record(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -425,8 +453,21 @@ 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 = `
@ -435,8 +476,6 @@ export function delete_records(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -452,8 +491,13 @@ export function delete_records(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "delete_records") [passwd] result)
(seq (seq
(seq
(call peer ("snapshot" "delete_records") [passwd] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -461,14 +505,8 @@ export function delete_records(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -520,8 +558,21 @@ 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 = `
@ -530,8 +581,6 @@ export function validate(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -547,8 +596,13 @@ export function validate(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "eip712_validation_string") [eip712_json peer] result)
(seq (seq
(seq
(call peer ("snapshot" "eip712_validation_string") [eip712_json peer] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -556,14 +610,8 @@ export function validate(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])
@ -615,8 +663,19 @@ 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 = `
@ -624,8 +683,6 @@ export function get_records(...args: any) {
(seq (seq
(seq (seq
(seq (seq
(seq
(seq
(seq (seq
(seq (seq
(seq (seq
@ -639,8 +696,13 @@ export function get_records(...args: any) {
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
) )
(xor (xor
(call peer ("snapshot" "get_records") [] result)
(seq (seq
(seq
(call peer ("snapshot" "get_records") [] result)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(seq (seq
(seq (seq
(call relay ("op" "noop") []) (call relay ("op" "noop") [])
@ -648,14 +710,8 @@ export function get_records(...args: any) {
) )
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 1])
) )
(call -relay- ("op" "noop") [])
) )
) )
)
(call relay ("op" "noop") [])
)
(call -relay- ("op" "noop") [])
)
(xor (xor
(call %init_peer_id% ("callbackSrv" "response") [result]) (call %init_peer_id% ("callbackSrv" "response") [result])
(call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2]) (call %init_peer_id% ("errorHandlingSrv" "error") [%last_error% 2])