Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
12 changes: 12 additions & 0 deletions packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ unsafe extern "C" {
fn random_seed(mode: i32) -> i64;

fn now(result_timestamp: *mut u8) -> i32;

fn emit_metric(data_ptr: *const u8, data_len: i32) -> i32;
}

import_namespace!("javy_chainlink_sdk");
Expand Down Expand Up @@ -226,6 +228,16 @@ pub fn modify_runtime(runtime: Runtime) -> Runtime {
}),
);

extend_wasm_exports(
&ctx,
"emitMetric",
Func::from(|_ctx: Ctx<'_>, data: ArgBytes| {
let bytes = data.0;
let rc = unsafe { emit_metric(bytes.as_ptr(), bytes.len() as i32) };
Ok::<i32, Error>(rc)
}),
);

extend_wasm_exports(
&ctx,
"sendResponse",
Expand Down
2 changes: 1 addition & 1 deletion packages/cre-sdk/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
COMMON_VERSION ?= cre-std-tests@0.6.0
COMMON_VERSION ?= 8c592883ed580efbf21afd2c15bc0b40727fb071
MODULE := github.com/smartcontractkit/chainlink-common
TEST_PATTERN ?= ^TestStandard

Expand Down
6 changes: 6 additions & 0 deletions packages/cre-sdk/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ inputs:
- ../../submodules/chainlink-protos/cre/sdk/v1alpha
- ../../submodules/chainlink-protos/cre/tools/generator/v1alpha
- ../../submodules/chainlink-protos/cre/values/v1
- directory: ../../submodules/chainlink-protos/workflows
# Allowlist of workflow protos exposed in the SDK (e.g. user metrics).
paths:
- ../../submodules/chainlink-protos/workflows/workflows/v2/workflow_user_metric.proto
- ../../submodules/chainlink-protos/workflows/workflows/v2/cre_info.proto
- ../../submodules/chainlink-protos/workflows/workflows/v2/workflow_key.proto

plugins:
# Modern @bufbuild/protoc-gen-es plugin
Expand Down
156 changes: 156 additions & 0 deletions packages/cre-sdk/src/generated/workflows/v2/cre_info_pb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// @generated by protoc-gen-es v2.6.3 with parameter "target=ts,import_extension=none,json_types=true,keep_empty_files=false"
// @generated from file workflows/v2/cre_info.proto (package workflows.v2, syntax proto3)
/* eslint-disable */

import type { Message } from '@bufbuild/protobuf'
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'

/**
* Describes the file workflows/v2/cre_info.proto.
*/
export const file_workflows_v2_cre_info: GenFile =
/*@__PURE__*/
fileDesc(
'Cht3b3JrZmxvd3MvdjIvY3JlX2luZm8ucHJvdG8SDHdvcmtmbG93cy52MiKMAgoHQ3JlSW5mbxINCgVkb25JRBgBIAEoBRIMCgRkb25GGAIgASgFEgwKBGRvbk4YAyABKAUSDQoFcDJwSUQYBCABKAkSHwoXd29ya2Zsb3dSZWdpc3RyeUFkZHJlc3MYBSABKAkSHwoXd29ya2Zsb3dSZWdpc3RyeVZlcnNpb24YBiABKAkSHQoVd29ya2Zsb3dSZWdpc3RyeUNoYWluGAcgASgJEhUKDWVuZ2luZVZlcnNpb24YCCABKAkSIwobY2FwYWJpbGl0aWVzUmVnaXN0cnlWZXJzaW9uGAkgASgJEhIKCmRvblZlcnNpb24YCiABKAkSFgoOd29ya2Zsb3dTb3VyY2UYCyABKAlCrwEKEGNvbS53b3JrZmxvd3MudjJCDENyZUluZm9Qcm90b1ABWjxnaXRodWIuY29tL3NtYXJ0Y29udHJhY3RraXQvY2hhaW5saW5rLXByb3Rvcy93b3JrZmxvd3MvZ28vdjKiAgNXWFiqAgxXb3JrZmxvd3MuVjLKAgxXb3JrZmxvd3NcVjLiAhhXb3JrZmxvd3NcVjJcR1BCTWV0YWRhdGHqAg1Xb3JrZmxvd3M6OlYyYgZwcm90bzM',
)

/**
* @generated from message workflows.v2.CreInfo
*/
export type CreInfo = Message<'workflows.v2.CreInfo'> & {
/**
* @generated from field: int32 donID = 1;
*/
donID: number

/**
* @generated from field: int32 donF = 2;
*/
donF: number

/**
* @generated from field: int32 donN = 3;
*/
donN: number

/**
* @generated from field: string p2pID = 4;
*/
p2pID: string

/**
* @generated from field: string workflowRegistryAddress = 5;
*/
workflowRegistryAddress: string

/**
* @generated from field: string workflowRegistryVersion = 6;
*/
workflowRegistryVersion: string

/**
* @generated from field: string workflowRegistryChain = 7;
*/
workflowRegistryChain: string

/**
* @generated from field: string engineVersion = 8;
*/
engineVersion: string

/**
* @generated from field: string capabilitiesRegistryVersion = 9;
*/
capabilitiesRegistryVersion: string

/**
* @generated from field: string donVersion = 10;
*/
donVersion: string

/**
* workflowSource identifies where the workflow was deployed from.
* Format varies by source type:
* - Onchain contract: "contract:{chain_selector}:{contract_address}"
* - GRPC source: "grpc:{source_name}:v1"
* - File source: "file:{source_name}:v1"
*
* @generated from field: string workflowSource = 11;
*/
workflowSource: string
}

/**
* @generated from message workflows.v2.CreInfo
*/
export type CreInfoJson = {
/**
* @generated from field: int32 donID = 1;
*/
donID?: number

/**
* @generated from field: int32 donF = 2;
*/
donF?: number

/**
* @generated from field: int32 donN = 3;
*/
donN?: number

/**
* @generated from field: string p2pID = 4;
*/
p2pID?: string

/**
* @generated from field: string workflowRegistryAddress = 5;
*/
workflowRegistryAddress?: string

/**
* @generated from field: string workflowRegistryVersion = 6;
*/
workflowRegistryVersion?: string

/**
* @generated from field: string workflowRegistryChain = 7;
*/
workflowRegistryChain?: string

/**
* @generated from field: string engineVersion = 8;
*/
engineVersion?: string

/**
* @generated from field: string capabilitiesRegistryVersion = 9;
*/
capabilitiesRegistryVersion?: string

/**
* @generated from field: string donVersion = 10;
*/
donVersion?: string

/**
* workflowSource identifies where the workflow was deployed from.
* Format varies by source type:
* - Onchain contract: "contract:{chain_selector}:{contract_address}"
* - GRPC source: "grpc:{source_name}:v1"
* - File source: "file:{source_name}:v1"
*
* @generated from field: string workflowSource = 11;
*/
workflowSource?: string
}

/**
* Describes the message workflows.v2.CreInfo.
* Use `create(CreInfoSchema)` to create a new message.
*/
export const CreInfoSchema: GenMessage<CreInfo, { jsonType: CreInfoJson }> =
/*@__PURE__*/
messageDesc(file_workflows_v2_cre_info, 0)
74 changes: 74 additions & 0 deletions packages/cre-sdk/src/generated/workflows/v2/workflow_key_pb.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// @generated by protoc-gen-es v2.6.3 with parameter "target=ts,import_extension=none,json_types=true,keep_empty_files=false"
// @generated from file workflows/v2/workflow_key.proto (package workflows.v2, syntax proto3)
/* eslint-disable */

import type { Message } from '@bufbuild/protobuf'
import type { GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2'
import { fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2'

/**
* Describes the file workflows/v2/workflow_key.proto.
*/
export const file_workflows_v2_workflow_key: GenFile =
/*@__PURE__*/
fileDesc(
'Ch93b3JrZmxvd3MvdjIvd29ya2Zsb3dfa2V5LnByb3RvEgx3b3JrZmxvd3MudjIiZgoLV29ya2Zsb3dLZXkSFQoNd29ya2Zsb3dPd25lchgBIAEoCRIUCgx3b3JrZmxvd05hbWUYAiABKAkSEgoKd29ya2Zsb3dJRBgDIAEoCRIWCg5vcmdhbml6YXRpb25JRBgEIAEoCUKzAQoQY29tLndvcmtmbG93cy52MkIQV29ya2Zsb3dLZXlQcm90b1ABWjxnaXRodWIuY29tL3NtYXJ0Y29udHJhY3RraXQvY2hhaW5saW5rLXByb3Rvcy93b3JrZmxvd3MvZ28vdjKiAgNXWFiqAgxXb3JrZmxvd3MuVjLKAgxXb3JrZmxvd3NcVjLiAhhXb3JrZmxvd3NcVjJcR1BCTWV0YWRhdGHqAg1Xb3JrZmxvd3M6OlYyYgZwcm90bzM',
)

/**
* @generated from message workflows.v2.WorkflowKey
*/
export type WorkflowKey = Message<'workflows.v2.WorkflowKey'> & {
/**
* @generated from field: string workflowOwner = 1;
*/
workflowOwner: string

/**
* @generated from field: string workflowName = 2;
*/
workflowName: string

/**
* @generated from field: string workflowID = 3;
*/
workflowID: string

/**
* @generated from field: string organizationID = 4;
*/
organizationID: string
}

/**
* @generated from message workflows.v2.WorkflowKey
*/
export type WorkflowKeyJson = {
/**
* @generated from field: string workflowOwner = 1;
*/
workflowOwner?: string

/**
* @generated from field: string workflowName = 2;
*/
workflowName?: string

/**
* @generated from field: string workflowID = 3;
*/
workflowID?: string

/**
* @generated from field: string organizationID = 4;
*/
organizationID?: string
}

/**
* Describes the message workflows.v2.WorkflowKey.
* Use `create(WorkflowKeySchema)` to create a new message.
*/
export const WorkflowKeySchema: GenMessage<WorkflowKey, { jsonType: WorkflowKeyJson }> =
/*@__PURE__*/
messageDesc(file_workflows_v2_workflow_key, 0)
Loading