@chainlink/cre-sdk 0.0.1-alpha → 0.0.2-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/generated/capabilities/internal/nodeaction/v1/node_action_pb.d.ts +69 -0
- package/dist/generated/capabilities/internal/nodeaction/v1/node_action_pb.js +29 -0
- package/dist/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.d.ts +13 -18
- package/dist/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen.js +71 -260
- package/dist/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.d.ts +4 -9
- package/dist/generated-sdk/capabilities/internal/actionandtrigger/v1/basic_sdk_gen.js +14 -45
- package/dist/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.d.ts +3 -7
- package/dist/generated-sdk/capabilities/internal/basicaction/v1/basicaction_sdk_gen.js +9 -36
- package/dist/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.d.ts +2 -8
- package/dist/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen.js +8 -21
- package/dist/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.d.ts +5 -8
- package/dist/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen.js +16 -60
- package/dist/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.d.ts +19 -0
- package/dist/generated-sdk/capabilities/internal/nodeaction/v1/basicaction_sdk_gen.js +36 -0
- package/dist/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.d.ts +3 -7
- package/dist/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.js +9 -36
- package/dist/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.d.ts +2 -8
- package/dist/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen.js +8 -21
- package/dist/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.d.ts +2 -8
- package/dist/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen.js +8 -21
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/sdk/cre/index.d.ts +5 -19
- package/dist/sdk/cre/index.js +1 -17
- package/dist/sdk/errors.d.ts +12 -0
- package/dist/sdk/errors.js +21 -0
- package/dist/sdk/impl/runtime-impl.d.ts +38 -0
- package/dist/sdk/impl/runtime-impl.js +190 -0
- package/dist/sdk/impl/runtime-impl.test.js +334 -0
- package/dist/sdk/index.d.ts +3 -0
- package/dist/sdk/index.js +2 -0
- package/dist/sdk/runtime.d.ts +24 -0
- package/dist/sdk/utils/capabilities/capability-error.d.ts +0 -3
- package/dist/sdk/utils/capabilities/capability-error.js +0 -2
- package/dist/sdk/utils/config/configHandler.test.d.ts +1 -0
- package/dist/sdk/utils/config/configHandler.test.js +193 -0
- package/dist/sdk/utils/config/index.d.ts +4 -6
- package/dist/sdk/utils/config/index.js +10 -34
- package/dist/sdk/utils/index.d.ts +0 -3
- package/dist/sdk/utils/index.js +0 -3
- package/dist/sdk/utils/values/consensus_aggregators.d.ts +1 -1
- package/dist/sdk/{runtime → wasm}/host-bindings.d.ts +0 -1
- package/dist/sdk/{runtime → wasm}/host-bindings.js +0 -4
- package/dist/sdk/wasm/index.d.ts +1 -0
- package/dist/sdk/wasm/index.js +1 -0
- package/dist/sdk/wasm/runner.d.ts +14 -0
- package/dist/sdk/wasm/runner.js +114 -0
- package/dist/sdk/wasm/runner.test.d.ts +1 -0
- package/dist/sdk/wasm/runner.test.js +270 -0
- package/dist/sdk/wasm/runtime.d.ts +7 -0
- package/dist/sdk/wasm/runtime.js +55 -0
- package/dist/sdk/workflow.d.ts +13 -15
- package/dist/sdk/workflow.js +1 -21
- package/package.json +2 -2
- package/dist/sdk/engine/execute.d.ts +0 -4
- package/dist/sdk/engine/execute.js +0 -12
- package/dist/sdk/engine/execute.test.js +0 -129
- package/dist/sdk/engine/handleExecutionPhase.d.ts +0 -4
- package/dist/sdk/engine/handleExecutionPhase.js +0 -34
- package/dist/sdk/engine/handleSubscribePhase.d.ts +0 -3
- package/dist/sdk/engine/handleSubscribePhase.js +0 -23
- package/dist/sdk/logger.d.ts +0 -7
- package/dist/sdk/logger.js +0 -18
- package/dist/sdk/runtime/errors.d.ts +0 -23
- package/dist/sdk/runtime/errors.js +0 -30
- package/dist/sdk/runtime/index.d.ts +0 -3
- package/dist/sdk/runtime/index.js +0 -2
- package/dist/sdk/runtime/run-in-node-mode.d.ts +0 -12
- package/dist/sdk/runtime/run-in-node-mode.js +0 -47
- package/dist/sdk/runtime/run-in-node-mode.test.js +0 -116
- package/dist/sdk/runtime/runtime.d.ts +0 -36
- package/dist/sdk/runtime/runtime.js +0 -84
- package/dist/sdk/runtime/runtime.test.d.ts +0 -1
- package/dist/sdk/runtime/runtime.test.js +0 -58
- package/dist/sdk/testhelpers/dangerously-call-capability.d.ts +0 -10
- package/dist/sdk/testhelpers/dangerously-call-capability.js +0 -26
- package/dist/sdk/testhelpers/mock-host-bindings.d.ts +0 -15
- package/dist/sdk/testhelpers/mock-host-bindings.js +0 -25
- package/dist/sdk/testhelpers/mock-runtime.d.ts +0 -2
- package/dist/sdk/testhelpers/mock-runtime.js +0 -16
- package/dist/sdk/utils/await-async-request.d.ts +0 -9
- package/dist/sdk/utils/await-async-request.js +0 -27
- package/dist/sdk/utils/capabilities/call-capability.d.ts +0 -22
- package/dist/sdk/utils/capabilities/call-capability.js +0 -33
- package/dist/sdk/utils/capabilities/callback-id.d.ts +0 -3
- package/dist/sdk/utils/capabilities/callback-id.js +0 -22
- package/dist/sdk/utils/capabilities/http/fetch.d.ts +0 -44
- package/dist/sdk/utils/capabilities/http/fetch.js +0 -63
- package/dist/sdk/utils/do-request-async.d.ts +0 -12
- package/dist/sdk/utils/do-request-async.js +0 -17
- package/dist/sdk/utils/error-boundary.d.ts +0 -2
- package/dist/sdk/utils/error-boundary.js +0 -30
- package/dist/sdk/utils/get-request.d.ts +0 -1
- package/dist/sdk/utils/get-request.js +0 -15
- package/dist/sdk/utils/lazy-promise.d.ts +0 -59
- package/dist/sdk/utils/lazy-promise.js +0 -81
- package/dist/sdk/utils/random/get-rand.d.ts +0 -3
- package/dist/sdk/utils/random/get-rand.js +0 -6
- package/dist/sdk/utils/random/random.d.ts +0 -35
- package/dist/sdk/utils/random/random.js +0 -123
- package/dist/sdk/utils/secrets/await-async-secret.d.ts +0 -1
- package/dist/sdk/utils/secrets/await-async-secret.js +0 -29
- package/dist/sdk/utils/secrets/do-get-secret.d.ts +0 -1
- package/dist/sdk/utils/secrets/do-get-secret.js +0 -14
- package/dist/sdk/utils/secrets/get-secret.d.ts +0 -1
- package/dist/sdk/utils/secrets/get-secret.js +0 -10
- package/dist/sdk/utils/send-error.d.ts +0 -1
- package/dist/sdk/utils/send-error.js +0 -16
- package/dist/sdk/utils/send-response-value.d.ts +0 -2
- package/dist/sdk/utils/send-response-value.js +0 -15
- package/dist/sdk/utils/time/get-time.d.ts +0 -16
- package/dist/sdk/utils/time/get-time.js +0 -21
- /package/dist/sdk/{engine/execute.test.d.ts → impl/runtime-impl.test.d.ts} +0 -0
- /package/dist/sdk/{runtime/run-in-node-mode.test.d.ts → runtime.js} +0 -0
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type { Message } from '@bufbuild/protobuf';
|
|
2
|
+
import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2';
|
|
3
|
+
/**
|
|
4
|
+
* Describes the file capabilities/internal/nodeaction/v1/node_action.proto.
|
|
5
|
+
*/
|
|
6
|
+
export declare const file_capabilities_internal_nodeaction_v1_node_action: GenFile;
|
|
7
|
+
/**
|
|
8
|
+
* @generated from message capabilities.internal.nodeaction.v1.NodeInputs
|
|
9
|
+
*/
|
|
10
|
+
export type NodeInputs = Message<'capabilities.internal.nodeaction.v1.NodeInputs'> & {
|
|
11
|
+
/**
|
|
12
|
+
* @generated from field: bool input_thing = 1;
|
|
13
|
+
*/
|
|
14
|
+
inputThing: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @generated from message capabilities.internal.nodeaction.v1.NodeInputs
|
|
18
|
+
*/
|
|
19
|
+
export type NodeInputsJson = {
|
|
20
|
+
/**
|
|
21
|
+
* @generated from field: bool input_thing = 1;
|
|
22
|
+
*/
|
|
23
|
+
inputThing?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Describes the message capabilities.internal.nodeaction.v1.NodeInputs.
|
|
27
|
+
* Use `create(NodeInputsSchema)` to create a new message.
|
|
28
|
+
*/
|
|
29
|
+
export declare const NodeInputsSchema: GenMessage<NodeInputs, {
|
|
30
|
+
jsonType: NodeInputsJson;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* @generated from message capabilities.internal.nodeaction.v1.NodeOutputs
|
|
34
|
+
*/
|
|
35
|
+
export type NodeOutputs = Message<'capabilities.internal.nodeaction.v1.NodeOutputs'> & {
|
|
36
|
+
/**
|
|
37
|
+
* @generated from field: int32 output_thing = 1;
|
|
38
|
+
*/
|
|
39
|
+
outputThing: number;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* @generated from message capabilities.internal.nodeaction.v1.NodeOutputs
|
|
43
|
+
*/
|
|
44
|
+
export type NodeOutputsJson = {
|
|
45
|
+
/**
|
|
46
|
+
* @generated from field: int32 output_thing = 1;
|
|
47
|
+
*/
|
|
48
|
+
outputThing?: number;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Describes the message capabilities.internal.nodeaction.v1.NodeOutputs.
|
|
52
|
+
* Use `create(NodeOutputsSchema)` to create a new message.
|
|
53
|
+
*/
|
|
54
|
+
export declare const NodeOutputsSchema: GenMessage<NodeOutputs, {
|
|
55
|
+
jsonType: NodeOutputsJson;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* @generated from service capabilities.internal.nodeaction.v1.BasicAction
|
|
59
|
+
*/
|
|
60
|
+
export declare const BasicAction: GenService<{
|
|
61
|
+
/**
|
|
62
|
+
* @generated from rpc capabilities.internal.nodeaction.v1.BasicAction.PerformAction
|
|
63
|
+
*/
|
|
64
|
+
performAction: {
|
|
65
|
+
methodKind: 'unary';
|
|
66
|
+
input: typeof NodeInputsSchema;
|
|
67
|
+
output: typeof NodeOutputsSchema;
|
|
68
|
+
};
|
|
69
|
+
}>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
// @generated by protoc-gen-es v2.6.3 with parameter "target=ts,import_extension=none,json_types=true,keep_empty_files=false"
|
|
2
|
+
// @generated from file capabilities/internal/nodeaction/v1/node_action.proto (package capabilities.internal.nodeaction.v1, syntax proto3)
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2';
|
|
5
|
+
import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb';
|
|
6
|
+
/**
|
|
7
|
+
* Describes the file capabilities/internal/nodeaction/v1/node_action.proto.
|
|
8
|
+
*/
|
|
9
|
+
export const file_capabilities_internal_nodeaction_v1_node_action =
|
|
10
|
+
/*@__PURE__*/
|
|
11
|
+
fileDesc('CjVjYXBhYmlsaXRpZXMvaW50ZXJuYWwvbm9kZWFjdGlvbi92MS9ub2RlX2FjdGlvbi5wcm90bxIjY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEiIQoKTm9kZUlucHV0cxITCgtpbnB1dF90aGluZxgBIAEoCCIjCgtOb2RlT3V0cHV0cxIUCgxvdXRwdXRfdGhpbmcYASABKAUypwEKC0Jhc2ljQWN0aW9uEnIKDVBlcmZvcm1BY3Rpb24SLy5jYXBhYmlsaXRpZXMuaW50ZXJuYWwubm9kZWFjdGlvbi52MS5Ob2RlSW5wdXRzGjAuY2FwYWJpbGl0aWVzLmludGVybmFsLm5vZGVhY3Rpb24udjEuTm9kZU91dHB1dHMaJIK1GCAIAhIcYmFzaWMtdGVzdC1ub2RlLWFjdGlvbkAxLjAuMELpAQonY29tLmNhcGFiaWxpdGllcy5pbnRlcm5hbC5ub2RlYWN0aW9uLnYxQg9Ob2RlQWN0aW9uUHJvdG9QAaICA0NJTqoCI0NhcGFiaWxpdGllcy5JbnRlcm5hbC5Ob2RlYWN0aW9uLlYxygIjQ2FwYWJpbGl0aWVzXEludGVybmFsXE5vZGVhY3Rpb25cVjHiAi9DYXBhYmlsaXRpZXNcSW50ZXJuYWxcTm9kZWFjdGlvblxWMVxHUEJNZXRhZGF0YeoCJkNhcGFiaWxpdGllczo6SW50ZXJuYWw6Ok5vZGVhY3Rpb246OlYxYgZwcm90bzM', [file_tools_generator_v1alpha_cre_metadata]);
|
|
12
|
+
/**
|
|
13
|
+
* Describes the message capabilities.internal.nodeaction.v1.NodeInputs.
|
|
14
|
+
* Use `create(NodeInputsSchema)` to create a new message.
|
|
15
|
+
*/
|
|
16
|
+
export const NodeInputsSchema =
|
|
17
|
+
/*@__PURE__*/
|
|
18
|
+
messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 0);
|
|
19
|
+
/**
|
|
20
|
+
* Describes the message capabilities.internal.nodeaction.v1.NodeOutputs.
|
|
21
|
+
* Use `create(NodeOutputsSchema)` to create a new message.
|
|
22
|
+
*/
|
|
23
|
+
export const NodeOutputsSchema =
|
|
24
|
+
/*@__PURE__*/
|
|
25
|
+
messageDesc(file_capabilities_internal_nodeaction_v1_node_action, 1);
|
|
26
|
+
/**
|
|
27
|
+
* @generated from service capabilities.internal.nodeaction.v1.BasicAction
|
|
28
|
+
*/
|
|
29
|
+
export const BasicAction = /*@__PURE__*/ serviceDesc(file_capabilities_internal_nodeaction_v1_node_action, 0);
|
|
@@ -1,22 +1,18 @@
|
|
|
1
1
|
import { type Any, type Empty } from '@bufbuild/protobuf/wkt';
|
|
2
2
|
import { type BalanceAtReply, type BalanceAtRequest, type BalanceAtRequestJson, type CallContractReply, type CallContractRequest, type CallContractRequestJson, type EstimateGasReply, type EstimateGasRequest, type EstimateGasRequestJson, type FilterLogsReply, type FilterLogsRequest, type FilterLogsRequestJson, type FilterLogTriggerRequest, type FilterLogTriggerRequestJson, type GetTransactionByHashReply, type GetTransactionByHashRequest, type GetTransactionByHashRequestJson, type GetTransactionReceiptReply, type GetTransactionReceiptRequest, type GetTransactionReceiptRequestJson, type HeaderByNumberReply, type HeaderByNumberRequest, type HeaderByNumberRequestJson, type Log, type RegisterLogTrackingRequest, type RegisterLogTrackingRequestJson, type UnregisterLogTrackingRequest, type UnregisterLogTrackingRequestJson, type WriteReportReply, type WriteReportRequest, type WriteReportRequestJson } from '../../../../../generated/capabilities/blockchain/evm/v1alpha/client_pb';
|
|
3
|
-
import {
|
|
3
|
+
import { type Runtime } from '../../../../../sdk/runtime';
|
|
4
4
|
import { type Trigger } from '../../../../../sdk/utils/triggers/trigger-interface';
|
|
5
5
|
/**
|
|
6
6
|
* Client Capability
|
|
7
7
|
*
|
|
8
8
|
* Capability ID: evm@1.0.0
|
|
9
|
-
* Default Mode: Mode.DON
|
|
10
9
|
* Capability Name: evm
|
|
11
10
|
* Capability Version: 1.0.0
|
|
12
11
|
*/
|
|
13
12
|
export declare class ClientCapability {
|
|
14
|
-
private readonly mode;
|
|
15
13
|
private readonly chainSelector?;
|
|
16
14
|
/** The capability ID for this service */
|
|
17
15
|
static readonly CAPABILITY_ID = "evm@1.0.0";
|
|
18
|
-
/** The default execution mode for this capability */
|
|
19
|
-
static readonly DEFAULT_MODE = Mode.DON;
|
|
20
16
|
static readonly CAPABILITY_NAME = "evm";
|
|
21
17
|
static readonly CAPABILITY_VERSION = "1.0.0";
|
|
22
18
|
/** Available chain selectors */
|
|
@@ -35,36 +31,36 @@ export declare class ClientCapability {
|
|
|
35
31
|
readonly 'polygon-mainnet': 4051577828743386545n;
|
|
36
32
|
readonly 'polygon-testnet-amoy': 16281711391670634445n;
|
|
37
33
|
};
|
|
38
|
-
constructor(
|
|
39
|
-
callContract(input: CallContractRequest | CallContractRequestJson): {
|
|
34
|
+
constructor(chainSelector?: bigint | undefined);
|
|
35
|
+
callContract(runtime: Runtime<any>, input: CallContractRequest | CallContractRequestJson): {
|
|
40
36
|
result: () => Promise<CallContractReply>;
|
|
41
37
|
};
|
|
42
|
-
filterLogs(input: FilterLogsRequest | FilterLogsRequestJson): {
|
|
38
|
+
filterLogs(runtime: Runtime<any>, input: FilterLogsRequest | FilterLogsRequestJson): {
|
|
43
39
|
result: () => Promise<FilterLogsReply>;
|
|
44
40
|
};
|
|
45
|
-
balanceAt(input: BalanceAtRequest | BalanceAtRequestJson): {
|
|
41
|
+
balanceAt(runtime: Runtime<any>, input: BalanceAtRequest | BalanceAtRequestJson): {
|
|
46
42
|
result: () => Promise<BalanceAtReply>;
|
|
47
43
|
};
|
|
48
|
-
estimateGas(input: EstimateGasRequest | EstimateGasRequestJson): {
|
|
44
|
+
estimateGas(runtime: Runtime<any>, input: EstimateGasRequest | EstimateGasRequestJson): {
|
|
49
45
|
result: () => Promise<EstimateGasReply>;
|
|
50
46
|
};
|
|
51
|
-
getTransactionByHash(input: GetTransactionByHashRequest | GetTransactionByHashRequestJson): {
|
|
47
|
+
getTransactionByHash(runtime: Runtime<any>, input: GetTransactionByHashRequest | GetTransactionByHashRequestJson): {
|
|
52
48
|
result: () => Promise<GetTransactionByHashReply>;
|
|
53
49
|
};
|
|
54
|
-
getTransactionReceipt(input: GetTransactionReceiptRequest | GetTransactionReceiptRequestJson): {
|
|
50
|
+
getTransactionReceipt(runtime: Runtime<any>, input: GetTransactionReceiptRequest | GetTransactionReceiptRequestJson): {
|
|
55
51
|
result: () => Promise<GetTransactionReceiptReply>;
|
|
56
52
|
};
|
|
57
|
-
headerByNumber(input: HeaderByNumberRequest | HeaderByNumberRequestJson): {
|
|
53
|
+
headerByNumber(runtime: Runtime<any>, input: HeaderByNumberRequest | HeaderByNumberRequestJson): {
|
|
58
54
|
result: () => Promise<HeaderByNumberReply>;
|
|
59
55
|
};
|
|
60
|
-
registerLogTracking(input: RegisterLogTrackingRequest | RegisterLogTrackingRequestJson): {
|
|
56
|
+
registerLogTracking(runtime: Runtime<any>, input: RegisterLogTrackingRequest | RegisterLogTrackingRequestJson): {
|
|
61
57
|
result: () => Promise<Empty>;
|
|
62
58
|
};
|
|
63
|
-
unregisterLogTracking(input: UnregisterLogTrackingRequest | UnregisterLogTrackingRequestJson): {
|
|
59
|
+
unregisterLogTracking(runtime: Runtime<any>, input: UnregisterLogTrackingRequest | UnregisterLogTrackingRequestJson): {
|
|
64
60
|
result: () => Promise<Empty>;
|
|
65
61
|
};
|
|
66
62
|
logTrigger(config: FilterLogTriggerRequestJson): ClientLogTrigger;
|
|
67
|
-
writeReport(input: WriteReportRequest | WriteReportRequestJson): {
|
|
63
|
+
writeReport(runtime: Runtime<any>, input: WriteReportRequest | WriteReportRequestJson): {
|
|
68
64
|
result: () => Promise<WriteReportReply>;
|
|
69
65
|
};
|
|
70
66
|
}
|
|
@@ -72,11 +68,10 @@ export declare class ClientCapability {
|
|
|
72
68
|
* Trigger implementation for LogTrigger
|
|
73
69
|
*/
|
|
74
70
|
declare class ClientLogTrigger implements Trigger<Log, Log> {
|
|
75
|
-
readonly mode: Mode;
|
|
76
71
|
private readonly _capabilityId;
|
|
77
72
|
private readonly _method;
|
|
78
73
|
readonly config: FilterLogTriggerRequest;
|
|
79
|
-
constructor(
|
|
74
|
+
constructor(config: FilterLogTriggerRequest | FilterLogTriggerRequestJson, _capabilityId: string, _method: string);
|
|
80
75
|
capabilityId(): string;
|
|
81
76
|
method(): string;
|
|
82
77
|
outputSchema(): import("@bufbuild/protobuf/codegenv2").GenMessage<Log, {
|