diff --git a/.gitmodules b/.gitmodules index aad5d5e1..3637c300 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,4 @@ [submodule "submodules/chainlink-protos"] path = submodules/chainlink-protos url = https://github.com/smartcontractkit/chainlink-protos.git + branch = capabilities-development diff --git a/packages/cre-sdk-javy-plugin/dist/javy-chainlink-sdk.plugin.wasm b/packages/cre-sdk-javy-plugin/dist/javy-chainlink-sdk.plugin.wasm index 0943e512..f78531a2 100644 Binary files a/packages/cre-sdk-javy-plugin/dist/javy-chainlink-sdk.plugin.wasm and b/packages/cre-sdk-javy-plugin/dist/javy-chainlink-sdk.plugin.wasm differ diff --git a/packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/src/lib.rs b/packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/src/lib.rs index 351daebb..7c3dd738 100644 --- a/packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/src/lib.rs +++ b/packages/cre-sdk-javy-plugin/src/javy_chainlink_sdk/src/lib.rs @@ -53,6 +53,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"); @@ -225,6 +227,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::(rc) + }), + ); + extend_wasm_exports( &ctx, "sendResponse", diff --git a/packages/cre-sdk/buf.gen.yaml b/packages/cre-sdk/buf.gen.yaml index e03ff006..bb44e0f4 100644 --- a/packages/cre-sdk/buf.gen.yaml +++ b/packages/cre-sdk/buf.gen.yaml @@ -31,6 +31,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 diff --git a/packages/cre-sdk/scripts/src/generate-sdks.ts b/packages/cre-sdk/scripts/src/generate-sdks.ts index 9903b72e..e75d290c 100644 --- a/packages/cre-sdk/scripts/src/generate-sdks.ts +++ b/packages/cre-sdk/scripts/src/generate-sdks.ts @@ -1,4 +1,5 @@ import { rmSync } from 'node:fs' +import { file_capabilities_blockchain_aptos_v1alpha_client } from '@cre/generated/capabilities/blockchain/aptos/v1alpha/client_pb' import { file_capabilities_blockchain_evm_v1alpha_client } from '@cre/generated/capabilities/blockchain/evm/v1alpha/client_pb' import { file_capabilities_blockchain_solana_v1alpha_client } from '@cre/generated/capabilities/blockchain/solana/v1alpha/client_pb' import { file_capabilities_internal_actionandtrigger_v1_action_and_trigger } from '@cre/generated/capabilities/internal/actionandtrigger/v1/action_and_trigger_pb' @@ -64,6 +65,11 @@ export const main = () => { ...generateMocks(file_capabilities_blockchain_evm_v1alpha_client, TEST_GENERATED_DIR), ) + generateSdk(file_capabilities_blockchain_aptos_v1alpha_client, './src/generated-sdk') + allMockExports.push( + ...generateMocks(file_capabilities_blockchain_aptos_v1alpha_client, TEST_GENERATED_DIR), + ) + generateSdk(file_capabilities_blockchain_solana_v1alpha_client, './src/generated-sdk') allMockExports.push( ...generateMocks(file_capabilities_blockchain_solana_v1alpha_client, TEST_GENERATED_DIR), diff --git a/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/aptos/v1alpha/client_sdk_gen.ts b/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/aptos/v1alpha/client_sdk_gen.ts new file mode 100644 index 00000000..79bc94fc --- /dev/null +++ b/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/aptos/v1alpha/client_sdk_gen.ts @@ -0,0 +1,316 @@ +import { create, fromJson } from '@bufbuild/protobuf' +import { + type AccountAPTBalanceReply, + AccountAPTBalanceReplySchema, + type AccountAPTBalanceRequest, + type AccountAPTBalanceRequestJson, + AccountAPTBalanceRequestSchema, + type AccountTransactionsReply, + AccountTransactionsReplySchema, + type AccountTransactionsRequest, + type AccountTransactionsRequestJson, + AccountTransactionsRequestSchema, + type GasConfig, + type GasConfigJson, + GasConfigSchema, + type TransactionByHashReply, + TransactionByHashReplySchema, + type TransactionByHashRequest, + type TransactionByHashRequestJson, + TransactionByHashRequestSchema, + type ViewReply, + ViewReplySchema, + type ViewRequest, + type ViewRequestJson, + ViewRequestSchema, + type WriteReportReply, + WriteReportReplySchema, + type WriteReportRequest, + type WriteReportRequestJson, + WriteReportRequestSchema, +} from '@cre/generated/capabilities/blockchain/aptos/v1alpha/client_pb' +import { + type ReportResponse, + type ReportResponseJson, + ReportResponseSchema, +} from '@cre/generated/sdk/v1alpha/sdk_pb' +import type { Runtime } from '@cre/sdk' +import { Report } from '@cre/sdk/report' +import { hexToBytes } from '@cre/sdk/utils/hex-utils' +import type { CapabilityInput } from '@cre/sdk/utils/types/no-excess' + +export type WriteCreReportRequest = { + receiver: Uint8Array + gasConfig?: GasConfig + report?: Report + $report: true +} + +export type WriteCreReportRequestJson = { + receiver: string + gasConfig?: GasConfigJson + report?: Report +} + +export function x_generatedCodeOnly_wrap_WriteCreReportRequest( + input: WriteReportRequest, +): WriteCreReportRequest { + return { + receiver: input.receiver, + gasConfig: input.gasConfig, + report: input.report !== undefined ? new Report(input.report) : undefined, + $report: true, + } +} + +export function createWriteCreReportRequest( + input: WriteCreReportRequestJson, +): WriteCreReportRequest { + return { + receiver: hexToBytes(input.receiver), + gasConfig: + input.gasConfig !== undefined ? fromJson(GasConfigSchema, input.gasConfig) : undefined, + report: input.report, + $report: true, + } +} + +export function x_generatedCodeOnly_unwrap_WriteCreReportRequest( + input: WriteCreReportRequest, +): WriteReportRequest { + return create(WriteReportRequestSchema, { + receiver: input.receiver, + gasConfig: input.gasConfig, + report: input.report !== undefined ? input.report.x_generatedCodeOnly_unwrap() : undefined, + }) +} + +/** + * Client Capability + * + * Capability ID: aptos@1.0.0 + * Capability Name: aptos + * Capability Version: 1.0.0 + */ +export class ClientCapability { + /** The capability ID for this service */ + static readonly CAPABILITY_ID = 'aptos@1.0.0' + + static readonly CAPABILITY_NAME = 'aptos' + static readonly CAPABILITY_VERSION = '1.0.0' + + /** Available ChainSelector values */ + static readonly SUPPORTED_CHAIN_SELECTORS = { + 'aptos-mainnet': 4741433654826277614n, + 'aptos-testnet': 743186221051783445n, + } as const + + constructor(private readonly ChainSelector: bigint) {} + + accountAPTBalance( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => AccountAPTBalanceReply } + accountAPTBalance( + runtime: Runtime, + input: AccountAPTBalanceRequest | AccountAPTBalanceRequestJson, + ): { result: () => AccountAPTBalanceReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: AccountAPTBalanceRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as AccountAPTBalanceRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(AccountAPTBalanceRequestSchema, input as AccountAPTBalanceRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + AccountAPTBalanceRequest, + AccountAPTBalanceReply + >({ + capabilityId, + method: 'AccountAPTBalance', + payload, + inputSchema: AccountAPTBalanceRequestSchema, + outputSchema: AccountAPTBalanceReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + view( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => ViewReply } + view( + runtime: Runtime, + input: ViewRequest | ViewRequestJson, + ): { result: () => ViewReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: ViewRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as ViewRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(ViewRequestSchema, input as ViewRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'View', + payload, + inputSchema: ViewRequestSchema, + outputSchema: ViewReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + transactionByHash( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => TransactionByHashReply } + transactionByHash( + runtime: Runtime, + input: TransactionByHashRequest | TransactionByHashRequestJson, + ): { result: () => TransactionByHashReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: TransactionByHashRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as TransactionByHashRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(TransactionByHashRequestSchema, input as TransactionByHashRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + TransactionByHashRequest, + TransactionByHashReply + >({ + capabilityId, + method: 'TransactionByHash', + payload, + inputSchema: TransactionByHashRequestSchema, + outputSchema: TransactionByHashReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + accountTransactions( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => AccountTransactionsReply } + accountTransactions( + runtime: Runtime, + input: AccountTransactionsRequest | AccountTransactionsRequestJson, + ): { result: () => AccountTransactionsReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: AccountTransactionsRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as AccountTransactionsRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(AccountTransactionsRequestSchema, input as AccountTransactionsRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + AccountTransactionsRequest, + AccountTransactionsReply + >({ + capabilityId, + method: 'AccountTransactions', + payload, + inputSchema: AccountTransactionsRequestSchema, + outputSchema: AccountTransactionsReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + writeReport( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => WriteReportReply } + writeReport( + runtime: Runtime, + input: WriteCreReportRequest | WriteCreReportRequestJson, + ): { result: () => WriteReportReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: WriteReportRequest + + // Check if it's a wrapped type by looking for the $report property + if ((input as unknown as { $report?: boolean }).$report) { + // It's a wrapped type, unwrap it + payload = x_generatedCodeOnly_unwrap_WriteCreReportRequest(input as WriteCreReportRequest) + } else { + // It's wrapped JSON, convert using create function + payload = x_generatedCodeOnly_unwrap_WriteCreReportRequest( + createWriteCreReportRequest(input as WriteCreReportRequestJson), + ) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'WriteReport', + payload, + inputSchema: WriteReportRequestSchema, + outputSchema: WriteReportReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } +} diff --git a/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/solana/v1alpha/client_sdk_gen.ts b/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/solana/v1alpha/client_sdk_gen.ts index 612bd21a..7359be92 100644 --- a/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/solana/v1alpha/client_sdk_gen.ts +++ b/packages/cre-sdk/src/generated-sdk/capabilities/blockchain/solana/v1alpha/client_sdk_gen.ts @@ -1,4 +1,5 @@ import { create, fromJson } from '@bufbuild/protobuf' +import { type Any, AnySchema, anyPack } from '@bufbuild/protobuf/wkt' import { type AccountMeta, type AccountMetaJson, @@ -6,6 +7,51 @@ import { type ComputeConfig, type ComputeConfigJson, ComputeConfigSchema, + type FilterLogTriggerRequest, + type FilterLogTriggerRequestJson, + FilterLogTriggerRequestSchema, + type GetAccountInfoWithOptsReply, + GetAccountInfoWithOptsReplySchema, + type GetAccountInfoWithOptsRequest, + type GetAccountInfoWithOptsRequestJson, + GetAccountInfoWithOptsRequestSchema, + type GetBalanceReply, + GetBalanceReplySchema, + type GetBalanceRequest, + type GetBalanceRequestJson, + GetBalanceRequestSchema, + type GetBlockReply, + GetBlockReplySchema, + type GetBlockRequest, + type GetBlockRequestJson, + GetBlockRequestSchema, + type GetFeeForMessageReply, + GetFeeForMessageReplySchema, + type GetFeeForMessageRequest, + type GetFeeForMessageRequestJson, + GetFeeForMessageRequestSchema, + type GetMultipleAccountsWithOptsReply, + GetMultipleAccountsWithOptsReplySchema, + type GetMultipleAccountsWithOptsRequest, + type GetMultipleAccountsWithOptsRequestJson, + GetMultipleAccountsWithOptsRequestSchema, + type GetSignatureStatusesReply, + GetSignatureStatusesReplySchema, + type GetSignatureStatusesRequest, + type GetSignatureStatusesRequestJson, + GetSignatureStatusesRequestSchema, + type GetSlotHeightReply, + GetSlotHeightReplySchema, + type GetSlotHeightRequest, + type GetSlotHeightRequestJson, + GetSlotHeightRequestSchema, + type GetTransactionReply, + GetTransactionReplySchema, + type GetTransactionRequest, + type GetTransactionRequestJson, + GetTransactionRequestSchema, + type Log, + LogSchema, type WriteReportReply, WriteReportReplySchema, type WriteReportRequest, @@ -20,7 +66,8 @@ import { import type { Runtime } from '@cre/sdk' import { Report } from '@cre/sdk/report' import { hexToBytes } from '@cre/sdk/utils/hex-utils' -import type { CapabilityInput } from '@cre/sdk/utils/types/no-excess' +import type { Trigger } from '@cre/sdk/utils/triggers/trigger-interface' +import type { CapabilityInput, NoExcess } from '@cre/sdk/utils/types/no-excess' export type WriteCreReportRequest = { remainingAccounts: AccountMeta[] @@ -92,11 +139,364 @@ export class ClientCapability { /** Available ChainSelector values */ static readonly SUPPORTED_CHAIN_SELECTORS = { 'solana-devnet': 16423721717087811551n, - 'solana-mainnet': 124615329519749607n, } as const constructor(private readonly ChainSelector: bigint) {} + getAccountInfoWithOpts( + runtime: Runtime, + input: CapabilityInput< + TInput, + GetAccountInfoWithOptsRequest, + GetAccountInfoWithOptsRequestJson + >, + ): { result: () => GetAccountInfoWithOptsReply } + getAccountInfoWithOpts( + runtime: Runtime, + input: GetAccountInfoWithOptsRequest | GetAccountInfoWithOptsRequestJson, + ): { result: () => GetAccountInfoWithOptsReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetAccountInfoWithOptsRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetAccountInfoWithOptsRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson( + GetAccountInfoWithOptsRequestSchema, + input as GetAccountInfoWithOptsRequestJson, + ) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + GetAccountInfoWithOptsRequest, + GetAccountInfoWithOptsReply + >({ + capabilityId, + method: 'GetAccountInfoWithOpts', + payload, + inputSchema: GetAccountInfoWithOptsRequestSchema, + outputSchema: GetAccountInfoWithOptsReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getBalance( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetBalanceReply } + getBalance( + runtime: Runtime, + input: GetBalanceRequest | GetBalanceRequestJson, + ): { result: () => GetBalanceReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetBalanceRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetBalanceRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(GetBalanceRequestSchema, input as GetBalanceRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'GetBalance', + payload, + inputSchema: GetBalanceRequestSchema, + outputSchema: GetBalanceReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getBlock( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetBlockReply } + getBlock( + runtime: Runtime, + input: GetBlockRequest | GetBlockRequestJson, + ): { result: () => GetBlockReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetBlockRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetBlockRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(GetBlockRequestSchema, input as GetBlockRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'GetBlock', + payload, + inputSchema: GetBlockRequestSchema, + outputSchema: GetBlockReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getFeeForMessage( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetFeeForMessageReply } + getFeeForMessage( + runtime: Runtime, + input: GetFeeForMessageRequest | GetFeeForMessageRequestJson, + ): { result: () => GetFeeForMessageReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetFeeForMessageRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetFeeForMessageRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(GetFeeForMessageRequestSchema, input as GetFeeForMessageRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + GetFeeForMessageRequest, + GetFeeForMessageReply + >({ + capabilityId, + method: 'GetFeeForMessage', + payload, + inputSchema: GetFeeForMessageRequestSchema, + outputSchema: GetFeeForMessageReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getMultipleAccountsWithOpts( + runtime: Runtime, + input: CapabilityInput< + TInput, + GetMultipleAccountsWithOptsRequest, + GetMultipleAccountsWithOptsRequestJson + >, + ): { result: () => GetMultipleAccountsWithOptsReply } + getMultipleAccountsWithOpts( + runtime: Runtime, + input: GetMultipleAccountsWithOptsRequest | GetMultipleAccountsWithOptsRequestJson, + ): { result: () => GetMultipleAccountsWithOptsReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetMultipleAccountsWithOptsRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetMultipleAccountsWithOptsRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson( + GetMultipleAccountsWithOptsRequestSchema, + input as GetMultipleAccountsWithOptsRequestJson, + ) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + GetMultipleAccountsWithOptsRequest, + GetMultipleAccountsWithOptsReply + >({ + capabilityId, + method: 'GetMultipleAccountsWithOpts', + payload, + inputSchema: GetMultipleAccountsWithOptsRequestSchema, + outputSchema: GetMultipleAccountsWithOptsReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getSignatureStatuses( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetSignatureStatusesReply } + getSignatureStatuses( + runtime: Runtime, + input: GetSignatureStatusesRequest | GetSignatureStatusesRequestJson, + ): { result: () => GetSignatureStatusesReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetSignatureStatusesRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetSignatureStatusesRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson( + GetSignatureStatusesRequestSchema, + input as GetSignatureStatusesRequestJson, + ) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability< + GetSignatureStatusesRequest, + GetSignatureStatusesReply + >({ + capabilityId, + method: 'GetSignatureStatuses', + payload, + inputSchema: GetSignatureStatusesRequestSchema, + outputSchema: GetSignatureStatusesReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getSlotHeight( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetSlotHeightReply } + getSlotHeight( + runtime: Runtime, + input: GetSlotHeightRequest | GetSlotHeightRequestJson, + ): { result: () => GetSlotHeightReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetSlotHeightRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetSlotHeightRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(GetSlotHeightRequestSchema, input as GetSlotHeightRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'GetSlotHeight', + payload, + inputSchema: GetSlotHeightRequestSchema, + outputSchema: GetSlotHeightReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + getTransaction( + runtime: Runtime, + input: CapabilityInput, + ): { result: () => GetTransactionReply } + getTransaction( + runtime: Runtime, + input: GetTransactionRequest | GetTransactionRequestJson, + ): { result: () => GetTransactionReply } { + // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed + let payload: GetTransactionRequest + + if ((input as unknown as { $typeName?: string }).$typeName) { + // It's the original protobuf type + payload = input as GetTransactionRequest + } else { + // It's regular JSON, convert using fromJson + payload = fromJson(GetTransactionRequestSchema, input as GetTransactionRequestJson) + } + + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + + const capabilityResponse = runtime.callCapability({ + capabilityId, + method: 'GetTransaction', + payload, + inputSchema: GetTransactionRequestSchema, + outputSchema: GetTransactionReplySchema, + }) + + return { + result: () => { + const result = capabilityResponse.result() + + return result + }, + } + } + + logTrigger( + config: NoExcess, + ): ClientLogTrigger { + // Include all labels in capability ID for routing when specified + const capabilityId = `${ClientCapability.CAPABILITY_NAME}:ChainSelector:${this.ChainSelector}@${ClientCapability.CAPABILITY_VERSION}` + return new ClientLogTrigger( + config as FilterLogTriggerRequestJson, + capabilityId, + 'LogTrigger', + this.ChainSelector, + ) + } + writeReport( runtime: Runtime, input: CapabilityInput, @@ -139,3 +539,45 @@ export class ClientCapability { } } } + +/** + * Trigger implementation for LogTrigger + */ +class ClientLogTrigger implements Trigger { + public readonly config: FilterLogTriggerRequest + constructor( + config: FilterLogTriggerRequest | FilterLogTriggerRequestJson, + private readonly _capabilityId: string, + private readonly _method: string, + private readonly ChainSelector: bigint, + ) { + // biome-ignore lint/suspicious/noExplicitAny: Needed for runtime type checking of protocol buffer messages + this.config = (config as any).$typeName + ? (config as FilterLogTriggerRequest) + : fromJson(FilterLogTriggerRequestSchema, config as FilterLogTriggerRequestJson) + } + + capabilityId(): string { + return this._capabilityId + } + + method(): string { + return this._method + } + + outputSchema() { + return LogSchema + } + + configAsAny(): Any { + return anyPack(FilterLogTriggerRequestSchema, this.config) + } + + /** + * Transform the raw trigger output - override this method if needed + * Default implementation returns the raw output unchanged + */ + adapt(rawOutput: Log): Log { + return rawOutput + } +} diff --git a/packages/cre-sdk/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts b/packages/cre-sdk/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts index ddb29b2d..9c094a09 100644 --- a/packages/cre-sdk/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts +++ b/packages/cre-sdk/src/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen.ts @@ -6,7 +6,7 @@ import { type Response, ResponseSchema, } from '@cre/generated/capabilities/networking/http/v1alpha/client_pb' -import type { NodeRuntime, Runtime } from '@cre/sdk' +import type { NodeRuntime, Runtime, TeeRuntime } from '@cre/sdk' import { Report } from '@cre/sdk/report' import type { ConsensusAggregation, PrimitiveTypes, UnwrapOptions } from '@cre/sdk/utils' import type { CapabilityInput } from '@cre/sdk/utils/types/no-excess' @@ -37,10 +37,18 @@ export class ClientCapability { static readonly CAPABILITY_NAME = 'http-actions' static readonly CAPABILITY_VERSION = '1.0.0-alpha' + sendRequest( + runtime: TeeRuntime, + input: CapabilityInput, + ): { result: () => Response } sendRequest( runtime: NodeRuntime, input: CapabilityInput, ): { result: () => Response } + sendRequest( + runtime: NodeRuntime | TeeRuntime, + input: CapabilityInput, + ): { result: () => Response } sendRequest( runtime: Runtime, fn: (sendRequester: SendRequester, ...args: TArgs) => TOutput, @@ -59,11 +67,14 @@ export class ClientCapability { return this.sendRequestSugarHelper(runtime, fn, consensusAggregation, unwrapOptions) } // Otherwise, this is the basic call overload - const [runtime, input] = args as [NodeRuntime, Request | RequestJson] + const [runtime, input] = args as [ + NodeRuntime | TeeRuntime, + Request | RequestJson, + ] return this.sendRequestCallHelper(runtime, input) } private sendRequestCallHelper( - runtime: NodeRuntime, + runtime: NodeRuntime | TeeRuntime, input: Request | RequestJson, ): { result: () => Response } { // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed diff --git a/packages/cre-sdk/src/generated/capabilities/blockchain/aptos/v1alpha/client_pb.ts b/packages/cre-sdk/src/generated/capabilities/blockchain/aptos/v1alpha/client_pb.ts index b5c67964..2bfac32b 100644 --- a/packages/cre-sdk/src/generated/capabilities/blockchain/aptos/v1alpha/client_pb.ts +++ b/packages/cre-sdk/src/generated/capabilities/blockchain/aptos/v1alpha/client_pb.ts @@ -15,7 +15,7 @@ import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/gen export const file_capabilities_blockchain_aptos_v1alpha_client: GenFile = /*@__PURE__*/ fileDesc( - 'CjJjYXBhYmlsaXRpZXMvYmxvY2tjaGFpbi9hcHRvcy92MWFscGhhL2NsaWVudC5wcm90bxIlY2FwYWJpbGl0aWVzLmJsb2NrY2hhaW4uYXB0b3MudjFhbHBoYSIrChhBY2NvdW50QVBUQmFsYW5jZVJlcXVlc3QSDwoHYWRkcmVzcxgBIAEoDCIrChZBY2NvdW50QVBUQmFsYW5jZVJlcGx5EhEKBXZhbHVlGAEgASgEQgIwACKGAQoLVmlld1JlcXVlc3QSQwoHcGF5bG9hZBgBIAEoCzIyLmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLmFwdG9zLnYxYWxwaGEuVmlld1BheWxvYWQSHwoObGVkZ2VyX3ZlcnNpb24YAiABKARCAjAASACIAQFCEQoPX2xlZGdlcl92ZXJzaW9uIhkKCVZpZXdSZXBseRIMCgRkYXRhGAEgASgMIrEBCgtWaWV3UGF5bG9hZBI/CgZtb2R1bGUYASABKAsyLy5jYXBhYmlsaXRpZXMuYmxvY2tjaGFpbi5hcHRvcy52MWFscGhhLk1vZHVsZUlEEhAKCGZ1bmN0aW9uGAIgASgJEkEKCWFyZ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b3MudjFhbHBoYS5Xcml0ZVJlcG9ydFJlcGx5Gl6CtRhaCAESC2FwdG9zQDEuMC4wGkkKDUNoYWluU2VsZWN0b3ISOBI2ChkKDWFwdG9zLW1haW5uZXQQ7rWCkJuZveZBChkKDWFwdG9zLXRlc3RuZXQQldKGnuP9lKgKQu8BCiljb20uY2FwYWJpbGl0aWVzLmJsb2NrY2hhaW4uYXB0b3MudjFhbHBoYUILQ2xpZW50UHJvdG9QAaICA0NCQaoCJUNhcGFiaWxpdGllcy5CbG9ja2NoYWluLkFwdG9zLlYxYWxwaGHKAiVDYXBhYmlsaXRpZXNcQmxvY2tjaGFpblxBcHRvc1xWMWFscGhh4gIxQ2FwYWJpbGl0aWVzXEJsb2NrY2hhaW5cQXB0b3NcVjFhbHBoYVxHUEJNZXRhZGF0YeoCKENhcGFiaWxpdGllczo6QmxvY2tjaGFpbjo6QXB0b3M6OlYxYWxwaGFiBnByb3RvMw', [file_sdk_v1alpha_sdk, file_tools_generator_v1alpha_cre_metadata], ) @@ -912,6 +912,11 @@ export type WriteReportReply = Message<'capabilities.blockchain.aptos.v1alpha.Wr * @generated from field: optional string error_message = 4; */ errorMessage?: string + + /** + * @generated from field: optional capabilities.blockchain.aptos.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 5; + */ + receiverContractExecutionStatus?: ReceiverContractExecutionStatus } /** @@ -941,6 +946,11 @@ export type WriteReportReplyJson = { * @generated from field: optional string error_message = 4; */ errorMessage?: string + + /** + * @generated from field: optional capabilities.blockchain.aptos.v1alpha.ReceiverContractExecutionStatus receiver_contract_execution_status = 5; + */ + receiverContractExecutionStatus?: ReceiverContractExecutionStatusJson } /** @@ -1148,6 +1158,36 @@ export const TransactionVariantSchema: GenEnum = /*@__PURE__*/ enumDesc(file_capabilities_blockchain_aptos_v1alpha_client, 3) + /** * @generated from service capabilities.blockchain.aptos.v1alpha.Client */ diff --git a/packages/cre-sdk/src/generated/capabilities/blockchain/solana/v1alpha/client_pb.ts b/packages/cre-sdk/src/generated/capabilities/blockchain/solana/v1alpha/client_pb.ts index fe57fc57..5c299c55 100644 --- a/packages/cre-sdk/src/generated/capabilities/blockchain/solana/v1alpha/client_pb.ts +++ b/packages/cre-sdk/src/generated/capabilities/blockchain/solana/v1alpha/client_pb.ts @@ -8,6 +8,8 @@ import { enumDesc, fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf import type { ReportResponse, ReportResponseJson } from '../../../../sdk/v1alpha/sdk_pb' import { file_sdk_v1alpha_sdk } from '../../../../sdk/v1alpha/sdk_pb' import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' +import type { BigInt, BigIntJson } from '../../../../values/v1/values_pb' +import { file_values_v1_values } from '../../../../values/v1/values_pb' /** * Describes the file capabilities/blockchain/solana/v1alpha/client.proto. @@ -15,45 +17,2777 @@ import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/gen export const file_capabilities_blockchain_solana_v1alpha_client: GenFile = /*@__PURE__*/ fileDesc( - 'CjNjYXBhYmlsaXRpZXMvYmxvY2tjaGFpbi9zb2xhbmEvdjFhbHBoYS9jbGllbnQucHJvdG8SJmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLnNvbGFuYS52MWFscGhhIiYKDUNvbXB1dGVDb25maWcSFQoNY29tcHV0ZV9saW1pdBgBIAEoDSI2CgtBY2NvdW50TWV0YRISCgpwdWJsaWNfa2V5GAEgASgMEhMKC2lzX3dyaXRhYmxlGAIgASgIIosCChJXcml0ZVJlcG9ydFJlcXVlc3QSTwoScmVtYWluaW5nX2FjY291bnRzGAEgAygLMjMuY2FwYWJpbGl0aWVzLmJsb2NrY2hhaW4uc29sYW5hLnYxYWxwaGEuQWNjb3VudE1ldGESEAoIcmVjZWl2ZXIYAiABKAwSUgoOY29tcHV0ZV9jb25maWcYAyABKAsyNS5jYXBhYmlsaXRpZXMuYmxvY2tjaGFpbi5zb2xhbmEudjFhbHBoYS5Db21wdXRlQ29uZmlnSACI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hYmlsaXRpZXMuYmxvY2tjaGFpbi5zb2xhbmEudjFhbHBoYS5HZXRUcmFuc2FjdGlvblJlcGx5EnwKCkxvZ1RyaWdnZXISPy5jYXBhYmlsaXRpZXMuYmxvY2tjaGFpbi5zb2xhbmEudjFhbHBoYS5GaWx0ZXJMb2dUcmlnZ2VyUmVxdWVzdBorLmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLnNvbGFuYS52MWFscGhhLkxvZzABEoMBCgtXcml0ZVJlcG9ydBI6LmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLnNvbGFuYS52MWFscGhhLldyaXRlUmVwb3J0UmVxdWVzdBo4LmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLnNvbGFuYS52MWFscGhhLldyaXRlUmVwb3J0UmVwbHkaRYK1GEEIARIMc29sYW5hQDEuMC4wGi8KDUNoYWluU2VsZWN0b3ISHhIcChoKDXNvbGFuYS1kZXZuZXQQ3++Mp6n8sfbjAUL0AQoqY29tLmNhcGFiaWxpdGllcy5ibG9ja2NoYWluLnNvbGFuYS52MWFscGhhQgtDbGllbnRQcm90b1ABogIDQ0JTqgImQ2FwYWJpbGl0aWVzLkJsb2NrY2hhaW4uU29sYW5hLlYxYWxwaGHKAiZDYXBhYmlsaXRpZXNcQmxvY2tjaGFpblxTb2xhbmFcVjFhbHBoYeICMkNhcGFiaWxpdGllc1xCbG9ja2NoYWluXFNvbGFuYVxWMWFscGhhXEdQQk1ldGFkYXRh6gIpQ2FwYWJpbGl0aWVzOjpCbG9ja2NoYWluOjpTb2xhbmE6OlYxYWxwaGFiBnByb3RvMw', + [file_sdk_v1alpha_sdk, file_tools_generator_v1alpha_cre_metadata, file_values_v1_values], ) +/** + * On-chain account state. + * + * @generated from message capabilities.blockchain.solana.v1alpha.Account + */ +export type Account = Message<'capabilities.blockchain.solana.v1alpha.Account'> & { + /** + * balance in lamports (1e-9 SOL) + * + * @generated from field: uint64 lamports = 1 [jstype = JS_NORMAL]; + */ + lamports: bigint + + /** + * 32-byte program id (Pubkey) + * + * @generated from field: bytes owner = 2; + */ + owner: Uint8Array + + /** + * account data (encoded or JSON) + * + * @generated from field: capabilities.blockchain.solana.v1alpha.DataBytesOrJSON data = 3; + */ + data?: DataBytesOrJSON + + /** + * true if this is a program account + * + * @generated from field: bool executable = 4; + */ + executable: boolean + + /** + * next rent epoch + * + * @generated from field: values.v1.BigInt rent_epoch = 5; + */ + rentEpoch?: BigInt + + /** + * data length in bytes + * + * @generated from field: uint64 space = 6 [jstype = JS_NORMAL]; + */ + space: bigint +} + +/** + * On-chain account state. + * + * @generated from message capabilities.blockchain.solana.v1alpha.Account + */ +export type AccountJson = { + /** + * balance in lamports (1e-9 SOL) + * + * @generated from field: uint64 lamports = 1 [jstype = JS_NORMAL]; + */ + lamports?: string + + /** + * 32-byte program id (Pubkey) + * + * @generated from field: bytes owner = 2; + */ + owner?: string + + /** + * account data (encoded or JSON) + * + * @generated from field: capabilities.blockchain.solana.v1alpha.DataBytesOrJSON data = 3; + */ + data?: DataBytesOrJSONJson + + /** + * true if this is a program account + * + * @generated from field: bool executable = 4; + */ + executable?: boolean + + /** + * next rent epoch + * + * @generated from field: values.v1.BigInt rent_epoch = 5; + */ + rentEpoch?: BigIntJson + + /** + * data length in bytes + * + * @generated from field: uint64 space = 6 [jstype = JS_NORMAL]; + */ + space?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.Account. + * Use `create(AccountSchema)` to create a new message. + */ +export const AccountSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 0) + +/** + * Compute budget configuration when submitting txs. + * + * @generated from message capabilities.blockchain.solana.v1alpha.ComputeConfig + */ +export type ComputeConfig = Message<'capabilities.blockchain.solana.v1alpha.ComputeConfig'> & { + /** + * max CUs (approx per-tx limit) + * + * @generated from field: uint32 compute_limit = 1; + */ + computeLimit: number +} + /** * Compute budget configuration when submitting txs. * * @generated from message capabilities.blockchain.solana.v1alpha.ComputeConfig */ -export type ComputeConfig = Message<'capabilities.blockchain.solana.v1alpha.ComputeConfig'> & { +export type ComputeConfigJson = { + /** + * max CUs (approx per-tx limit) + * + * @generated from field: uint32 compute_limit = 1; + */ + computeLimit?: number +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.ComputeConfig. + * Use `create(ComputeConfigSchema)` to create a new message. + */ +export const ComputeConfigSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 1) + +/** + * Raw bytes vs parsed JSON (as returned by RPC). + * + * @generated from message capabilities.blockchain.solana.v1alpha.DataBytesOrJSON + */ +export type DataBytesOrJSON = Message<'capabilities.blockchain.solana.v1alpha.DataBytesOrJSON'> & { + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding: EncodingType + + /** + * @generated from oneof capabilities.blockchain.solana.v1alpha.DataBytesOrJSON.body + */ + body: + | { + /** + * program data (node’s base64/base58 decoded) + * + * @generated from field: bytes raw = 2; + */ + value: Uint8Array + case: 'raw' + } + | { + /** + * json: UTF-8 bytes of the jsonParsed payload. + * + * @generated from field: bytes json = 3; + */ + value: Uint8Array + case: 'json' + } + | { case: undefined; value?: undefined } +} + +/** + * Raw bytes vs parsed JSON (as returned by RPC). + * + * @generated from message capabilities.blockchain.solana.v1alpha.DataBytesOrJSON + */ +export type DataBytesOrJSONJson = { + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding?: EncodingTypeJson + + /** + * program data (node’s base64/base58 decoded) + * + * @generated from field: bytes raw = 2; + */ + raw?: string + + /** + * json: UTF-8 bytes of the jsonParsed payload. + * + * @generated from field: bytes json = 3; + */ + json?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.DataBytesOrJSON. + * Use `create(DataBytesOrJSONSchema)` to create a new message. + */ +export const DataBytesOrJSONSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 2) + +/** + * Return a slice of account data. + * + * @generated from message capabilities.blockchain.solana.v1alpha.DataSlice + */ +export type DataSlice = Message<'capabilities.blockchain.solana.v1alpha.DataSlice'> & { + /** + * start byte + * + * @generated from field: uint64 offset = 1 [jstype = JS_NORMAL]; + */ + offset: bigint + + /** + * number of bytes + * + * @generated from field: uint64 length = 2 [jstype = JS_NORMAL]; + */ + length: bigint +} + +/** + * Return a slice of account data. + * + * @generated from message capabilities.blockchain.solana.v1alpha.DataSlice + */ +export type DataSliceJson = { + /** + * start byte + * + * @generated from field: uint64 offset = 1 [jstype = JS_NORMAL]; + */ + offset?: string + + /** + * number of bytes + * + * @generated from field: uint64 length = 2 [jstype = JS_NORMAL]; + */ + length?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.DataSlice. + * Use `create(DataSliceSchema)` to create a new message. + */ +export const DataSliceSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 3) + +/** + * Options for GetAccountInfo. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts + */ +export type GetAccountInfoOpts = + Message<'capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts'> & { + /** + * data encoding + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding: EncodingType + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment: CommitmentType + + /** + * optional slice window + * + * @generated from field: capabilities.blockchain.solana.v1alpha.DataSlice data_slice = 3; + */ + dataSlice?: DataSlice + + /** + * lower bound slot + * + * @generated from field: uint64 min_context_slot = 4 [jstype = JS_NORMAL]; + */ + minContextSlot: bigint + } + +/** + * Options for GetAccountInfo. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts + */ +export type GetAccountInfoOptsJson = { + /** + * data encoding + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding?: EncodingTypeJson + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment?: CommitmentTypeJson + + /** + * optional slice window + * + * @generated from field: capabilities.blockchain.solana.v1alpha.DataSlice data_slice = 3; + */ + dataSlice?: DataSliceJson + + /** + * lower bound slot + * + * @generated from field: uint64 min_context_slot = 4 [jstype = JS_NORMAL]; + */ + minContextSlot?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts. + * Use `create(GetAccountInfoOptsSchema)` to create a new message. + */ +export const GetAccountInfoOptsSchema: GenMessage< + GetAccountInfoOpts, + { jsonType: GetAccountInfoOptsJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 4) + +/** + * Reply for GetAccountInfoWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply + */ +export type GetAccountInfoWithOptsReply = + Message<'capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply'> & { + /** + * account (may be empty) + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.Account value = 2; + */ + value?: Account + } + +/** + * Reply for GetAccountInfoWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply + */ +export type GetAccountInfoWithOptsReplyJson = { + /** + * account (may be empty) + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.Account value = 2; + */ + value?: AccountJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsReply. + * Use `create(GetAccountInfoWithOptsReplySchema)` to create a new message. + */ +export const GetAccountInfoWithOptsReplySchema: GenMessage< + GetAccountInfoWithOptsReply, + { jsonType: GetAccountInfoWithOptsReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 5) + +/** + * Request for GetAccountInfoWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest + */ +export type GetAccountInfoWithOptsRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest'> & { + /** + * 32-byte Pubkey + * + * @generated from field: bytes account = 1; + */ + account: Uint8Array + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts opts = 2; + */ + opts?: GetAccountInfoOpts + } + +/** + * Request for GetAccountInfoWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest + */ +export type GetAccountInfoWithOptsRequestJson = { + /** + * 32-byte Pubkey + * + * @generated from field: bytes account = 1; + */ + account?: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetAccountInfoOpts opts = 2; + */ + opts?: GetAccountInfoOptsJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetAccountInfoWithOptsRequest. + * Use `create(GetAccountInfoWithOptsRequestSchema)` to create a new message. + */ +export const GetAccountInfoWithOptsRequestSchema: GenMessage< + GetAccountInfoWithOptsRequest, + { jsonType: GetAccountInfoWithOptsRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 6) + +/** + * Reply for GetBalance. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBalanceReply + */ +export type GetBalanceReply = Message<'capabilities.blockchain.solana.v1alpha.GetBalanceReply'> & { + /** + * lamports + * + * @generated from field: uint64 value = 1 [jstype = JS_NORMAL]; + */ + value: bigint +} + +/** + * Reply for GetBalance. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBalanceReply + */ +export type GetBalanceReplyJson = { + /** + * lamports + * + * @generated from field: uint64 value = 1 [jstype = JS_NORMAL]; + */ + value?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetBalanceReply. + * Use `create(GetBalanceReplySchema)` to create a new message. + */ +export const GetBalanceReplySchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 7) + +/** + * Request for GetBalance. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBalanceRequest + */ +export type GetBalanceRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetBalanceRequest'> & { + /** + * 32-byte Pubkey + * + * @generated from field: bytes addr = 1; + */ + addr: Uint8Array + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment: CommitmentType + } + +/** + * Request for GetBalance. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBalanceRequest + */ +export type GetBalanceRequestJson = { + /** + * 32-byte Pubkey + * + * @generated from field: bytes addr = 1; + */ + addr?: string + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment?: CommitmentTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetBalanceRequest. + * Use `create(GetBalanceRequestSchema)` to create a new message. + */ +export const GetBalanceRequestSchema: GenMessage< + GetBalanceRequest, + { jsonType: GetBalanceRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 8) + +/** + * Options for GetBlock. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockOpts + */ +export type GetBlockOpts = Message<'capabilities.blockchain.solana.v1alpha.GetBlockOpts'> & { + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 4; + */ + commitment: CommitmentType +} + +/** + * Options for GetBlock. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockOpts + */ +export type GetBlockOptsJson = { + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 4; + */ + commitment?: CommitmentTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetBlockOpts. + * Use `create(GetBlockOptsSchema)` to create a new message. + */ +export const GetBlockOptsSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 9) + +/** + * Block response. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockReply + */ +export type GetBlockReply = Message<'capabilities.blockchain.solana.v1alpha.GetBlockReply'> & { + /** + * 32-byte block hash + * + * @generated from field: bytes blockhash = 1; + */ + blockhash: Uint8Array + + /** + * 32-byte parent hash + * + * @generated from field: bytes previous_blockhash = 2; + */ + previousBlockhash: Uint8Array + + /** + * @generated from field: uint64 parent_slot = 3 [jstype = JS_NORMAL]; + */ + parentSlot: bigint + + /** + * unix seconds, node may not report it + * + * @generated from field: optional int64 block_time = 4 [jstype = JS_NORMAL]; + */ + blockTime?: bigint + + /** + * chain height + * + * @generated from field: uint64 block_height = 5 [jstype = JS_NORMAL]; + */ + blockHeight: bigint +} + +/** + * Block response. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockReply + */ +export type GetBlockReplyJson = { + /** + * 32-byte block hash + * + * @generated from field: bytes blockhash = 1; + */ + blockhash?: string + + /** + * 32-byte parent hash + * + * @generated from field: bytes previous_blockhash = 2; + */ + previousBlockhash?: string + + /** + * @generated from field: uint64 parent_slot = 3 [jstype = JS_NORMAL]; + */ + parentSlot?: string + + /** + * unix seconds, node may not report it + * + * @generated from field: optional int64 block_time = 4 [jstype = JS_NORMAL]; + */ + blockTime?: string + + /** + * chain height + * + * @generated from field: uint64 block_height = 5 [jstype = JS_NORMAL]; + */ + blockHeight?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetBlockReply. + * Use `create(GetBlockReplySchema)` to create a new message. + */ +export const GetBlockReplySchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 10) + +/** + * Request for GetBlock. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockRequest + */ +export type GetBlockRequest = Message<'capabilities.blockchain.solana.v1alpha.GetBlockRequest'> & { + /** + * target slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot: bigint + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetBlockOpts opts = 2; + */ + opts?: GetBlockOpts +} + +/** + * Request for GetBlock. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetBlockRequest + */ +export type GetBlockRequestJson = { + /** + * target slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot?: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetBlockOpts opts = 2; + */ + opts?: GetBlockOptsJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetBlockRequest. + * Use `create(GetBlockRequestSchema)` to create a new message. + */ +export const GetBlockRequestSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 11) + +/** + * Fee quote for a base58-encoded Message. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply + */ +export type GetFeeForMessageReply = + Message<'capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply'> & { + /** + * lamports + * + * @generated from field: uint64 fee = 1 [jstype = JS_NORMAL]; + */ + fee: bigint + } + +/** + * Fee quote for a base58-encoded Message. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply + */ +export type GetFeeForMessageReplyJson = { + /** + * lamports + * + * @generated from field: uint64 fee = 1 [jstype = JS_NORMAL]; + */ + fee?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetFeeForMessageReply. + * Use `create(GetFeeForMessageReplySchema)` to create a new message. + */ +export const GetFeeForMessageReplySchema: GenMessage< + GetFeeForMessageReply, + { jsonType: GetFeeForMessageReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 12) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest + */ +export type GetFeeForMessageRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest'> & { + /** + * must be base58-encoded Message + * + * @generated from field: string message = 1; + */ + message: string + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment: CommitmentType + } + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest + */ +export type GetFeeForMessageRequestJson = { + /** + * must be base58-encoded Message + * + * @generated from field: string message = 1; + */ + message?: string + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment?: CommitmentTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetFeeForMessageRequest. + * Use `create(GetFeeForMessageRequestSchema)` to create a new message. + */ +export const GetFeeForMessageRequestSchema: GenMessage< + GetFeeForMessageRequest, + { jsonType: GetFeeForMessageRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 13) + +/** + * Options for GetMultipleAccounts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts + */ +export type GetMultipleAccountsOpts = + Message<'capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts'> & { + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding: EncodingType + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment: CommitmentType + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.DataSlice data_slice = 3; + */ + dataSlice?: DataSlice + + /** + * @generated from field: uint64 min_context_slot = 4 [jstype = JS_NORMAL]; + */ + minContextSlot: bigint + } + +/** + * Options for GetMultipleAccounts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts + */ +export type GetMultipleAccountsOptsJson = { + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding?: EncodingTypeJson + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment?: CommitmentTypeJson + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.DataSlice data_slice = 3; + */ + dataSlice?: DataSliceJson + + /** + * @generated from field: uint64 min_context_slot = 4 [jstype = JS_NORMAL]; + */ + minContextSlot?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts. + * Use `create(GetMultipleAccountsOptsSchema)` to create a new message. + */ +export const GetMultipleAccountsOptsSchema: GenMessage< + GetMultipleAccountsOpts, + { jsonType: GetMultipleAccountsOptsJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 14) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper + */ +export type OptionalAccountWrapper = + Message<'capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper'> & { + /** + * @generated from field: optional capabilities.blockchain.solana.v1alpha.Account account = 1; + */ + account?: Account + } + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper + */ +export type OptionalAccountWrapperJson = { + /** + * @generated from field: optional capabilities.blockchain.solana.v1alpha.Account account = 1; + */ + account?: AccountJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper. + * Use `create(OptionalAccountWrapperSchema)` to create a new message. + */ +export const OptionalAccountWrapperSchema: GenMessage< + OptionalAccountWrapper, + { jsonType: OptionalAccountWrapperJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 15) + +/** + * Reply for GetMultipleAccountsWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply + */ +export type GetMultipleAccountsWithOptsReply = + Message<'capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply'> & { + /** + * accounts (nil entries allowed) + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper value = 2; + */ + value: OptionalAccountWrapper[] + } + +/** + * Reply for GetMultipleAccountsWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply + */ +export type GetMultipleAccountsWithOptsReplyJson = { + /** + * accounts (nil entries allowed) + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.OptionalAccountWrapper value = 2; + */ + value?: OptionalAccountWrapperJson[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsReply. + * Use `create(GetMultipleAccountsWithOptsReplySchema)` to create a new message. + */ +export const GetMultipleAccountsWithOptsReplySchema: GenMessage< + GetMultipleAccountsWithOptsReply, + { jsonType: GetMultipleAccountsWithOptsReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 16) + +/** + * Request for GetMultipleAccountsWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest + */ +export type GetMultipleAccountsWithOptsRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest'> & { + /** + * list of 32-byte Pubkeys + * + * @generated from field: repeated bytes accounts = 1; + */ + accounts: Uint8Array[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts opts = 2; + */ + opts?: GetMultipleAccountsOpts + } + +/** + * Request for GetMultipleAccountsWithOpts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest + */ +export type GetMultipleAccountsWithOptsRequestJson = { + /** + * list of 32-byte Pubkeys + * + * @generated from field: repeated bytes accounts = 1; + */ + accounts?: string[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.GetMultipleAccountsOpts opts = 2; + */ + opts?: GetMultipleAccountsOptsJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetMultipleAccountsWithOptsRequest. + * Use `create(GetMultipleAccountsWithOptsRequestSchema)` to create a new message. + */ +export const GetMultipleAccountsWithOptsRequestSchema: GenMessage< + GetMultipleAccountsWithOptsRequest, + { jsonType: GetMultipleAccountsWithOptsRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 17) + +/** + * Reply for GetSignatureStatuses. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply + */ +export type GetSignatureStatusesReply = + Message<'capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply'> & { + /** + * 1:1 with input + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult results = 1; + */ + results: GetSignatureStatusesResult[] + } + +/** + * Reply for GetSignatureStatuses. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply + */ +export type GetSignatureStatusesReplyJson = { + /** + * 1:1 with input + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult results = 1; + */ + results?: GetSignatureStatusesResultJson[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesReply. + * Use `create(GetSignatureStatusesReplySchema)` to create a new message. + */ +export const GetSignatureStatusesReplySchema: GenMessage< + GetSignatureStatusesReply, + { jsonType: GetSignatureStatusesReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 18) + +/** + * Request for GetSignatureStatuses. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest + */ +export type GetSignatureStatusesRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest'> & { + /** + * 64-byte signatures + * + * @generated from field: repeated bytes sigs = 1; + */ + sigs: Uint8Array[] + } + +/** + * Request for GetSignatureStatuses. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest + */ +export type GetSignatureStatusesRequestJson = { + /** + * 64-byte signatures + * + * @generated from field: repeated bytes sigs = 1; + */ + sigs?: string[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesRequest. + * Use `create(GetSignatureStatusesRequestSchema)` to create a new message. + */ +export const GetSignatureStatusesRequestSchema: GenMessage< + GetSignatureStatusesRequest, + { jsonType: GetSignatureStatusesRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 19) + +/** + * Per-signature status. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult + */ +export type GetSignatureStatusesResult = + Message<'capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult'> & { + /** + * processed slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot: bigint + + /** + * null->0 here + * + * @generated from field: optional uint64 confirmations = 2 [jstype = JS_NORMAL]; + */ + confirmations?: bigint + + /** + * error JSON string (empty on success) + * + * @generated from field: string err = 3; + */ + err: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ConfirmationStatusType confirmation_status = 4; + */ + confirmationStatus: ConfirmationStatusType + } + +/** + * Per-signature status. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult + */ +export type GetSignatureStatusesResultJson = { + /** + * processed slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot?: string + + /** + * null->0 here + * + * @generated from field: optional uint64 confirmations = 2 [jstype = JS_NORMAL]; + */ + confirmations?: string + + /** + * error JSON string (empty on success) + * + * @generated from field: string err = 3; + */ + err?: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ConfirmationStatusType confirmation_status = 4; + */ + confirmationStatus?: ConfirmationStatusTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetSignatureStatusesResult. + * Use `create(GetSignatureStatusesResultSchema)` to create a new message. + */ +export const GetSignatureStatusesResultSchema: GenMessage< + GetSignatureStatusesResult, + { jsonType: GetSignatureStatusesResultJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 20) + +/** + * Current “height” (blocks below latest). + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSlotHeightReply + */ +export type GetSlotHeightReply = + Message<'capabilities.blockchain.solana.v1alpha.GetSlotHeightReply'> & { + /** + * @generated from field: uint64 height = 1 [jstype = JS_NORMAL]; + */ + height: bigint + } + +/** + * Current “height” (blocks below latest). + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetSlotHeightReply + */ +export type GetSlotHeightReplyJson = { + /** + * @generated from field: uint64 height = 1 [jstype = JS_NORMAL]; + */ + height?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetSlotHeightReply. + * Use `create(GetSlotHeightReplySchema)` to create a new message. + */ +export const GetSlotHeightReplySchema: GenMessage< + GetSlotHeightReply, + { jsonType: GetSlotHeightReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 21) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest + */ +export type GetSlotHeightRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest'> & { + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 1; + */ + commitment: CommitmentType + } + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest + */ +export type GetSlotHeightRequestJson = { + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 1; + */ + commitment?: CommitmentTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetSlotHeightRequest. + * Use `create(GetSlotHeightRequestSchema)` to create a new message. + */ +export const GetSlotHeightRequestSchema: GenMessage< + GetSlotHeightRequest, + { jsonType: GetSlotHeightRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 22) + +/** + * Message header counts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.MessageHeader + */ +export type MessageHeader = Message<'capabilities.blockchain.solana.v1alpha.MessageHeader'> & { + /** + * signer count + * + * @generated from field: uint32 num_required_signatures = 1; + */ + numRequiredSignatures: number + + /** + * trailing signed RO + * + * @generated from field: uint32 num_readonly_signed_accounts = 2; + */ + numReadonlySignedAccounts: number + + /** + * trailing unsigned RO + * + * @generated from field: uint32 num_readonly_unsigned_accounts = 3; + */ + numReadonlyUnsignedAccounts: number +} + +/** + * Message header counts. + * + * @generated from message capabilities.blockchain.solana.v1alpha.MessageHeader + */ +export type MessageHeaderJson = { + /** + * signer count + * + * @generated from field: uint32 num_required_signatures = 1; + */ + numRequiredSignatures?: number + + /** + * trailing signed RO + * + * @generated from field: uint32 num_readonly_signed_accounts = 2; + */ + numReadonlySignedAccounts?: number + + /** + * trailing unsigned RO + * + * @generated from field: uint32 num_readonly_unsigned_accounts = 3; + */ + numReadonlyUnsignedAccounts?: number +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.MessageHeader. + * Use `create(MessageHeaderSchema)` to create a new message. + */ +export const MessageHeaderSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 23) + +/** + * Parsed message (no address tables). + * + * @generated from message capabilities.blockchain.solana.v1alpha.ParsedMessage + */ +export type ParsedMessage = Message<'capabilities.blockchain.solana.v1alpha.ParsedMessage'> & { + /** + * 32-byte Hash + * + * @generated from field: bytes recent_blockhash = 1; + */ + recentBlockhash: Uint8Array + + /** + * list of 32-byte Pubkeys + * + * @generated from field: repeated bytes account_keys = 2; + */ + accountKeys: Uint8Array[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.MessageHeader header = 3; + */ + header?: MessageHeader + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.CompiledInstruction instructions = 4; + */ + instructions: CompiledInstruction[] +} + +/** + * Parsed message (no address tables). + * + * @generated from message capabilities.blockchain.solana.v1alpha.ParsedMessage + */ +export type ParsedMessageJson = { + /** + * 32-byte Hash + * + * @generated from field: bytes recent_blockhash = 1; + */ + recentBlockhash?: string + + /** + * list of 32-byte Pubkeys + * + * @generated from field: repeated bytes account_keys = 2; + */ + accountKeys?: string[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.MessageHeader header = 3; + */ + header?: MessageHeaderJson + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.CompiledInstruction instructions = 4; + */ + instructions?: CompiledInstructionJson[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.ParsedMessage. + * Use `create(ParsedMessageSchema)` to create a new message. + */ +export const ParsedMessageSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 24) + +/** + * Parsed transaction (signatures + message). + * + * @generated from message capabilities.blockchain.solana.v1alpha.ParsedTransaction + */ +export type ParsedTransaction = + Message<'capabilities.blockchain.solana.v1alpha.ParsedTransaction'> & { + /** + * 64-byte signatures + * + * @generated from field: repeated bytes signatures = 1; + */ + signatures: Uint8Array[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ParsedMessage message = 2; + */ + message?: ParsedMessage + } + +/** + * Parsed transaction (signatures + message). + * + * @generated from message capabilities.blockchain.solana.v1alpha.ParsedTransaction + */ +export type ParsedTransactionJson = { + /** + * 64-byte signatures + * + * @generated from field: repeated bytes signatures = 1; + */ + signatures?: string[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ParsedMessage message = 2; + */ + message?: ParsedMessageJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.ParsedTransaction. + * Use `create(ParsedTransactionSchema)` to create a new message. + */ +export const ParsedTransactionSchema: GenMessage< + ParsedTransaction, + { jsonType: ParsedTransactionJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 25) + +/** + * Token amount (UI-friendly). + * + * @generated from message capabilities.blockchain.solana.v1alpha.UiTokenAmount + */ +export type UiTokenAmount = Message<'capabilities.blockchain.solana.v1alpha.UiTokenAmount'> & { + /** + * raw integer string + * + * @generated from field: string amount = 1; + */ + amount: string + + /** + * mint decimals + * + * @generated from field: uint32 decimals = 2; + */ + decimals: number + + /** + * amount / 10^decimals + * + * @generated from field: string ui_amount_string = 4; + */ + uiAmountString: string +} + +/** + * Token amount (UI-friendly). + * + * @generated from message capabilities.blockchain.solana.v1alpha.UiTokenAmount + */ +export type UiTokenAmountJson = { + /** + * raw integer string + * + * @generated from field: string amount = 1; + */ + amount?: string + + /** + * mint decimals + * + * @generated from field: uint32 decimals = 2; + */ + decimals?: number + + /** + * amount / 10^decimals + * + * @generated from field: string ui_amount_string = 4; + */ + uiAmountString?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.UiTokenAmount. + * Use `create(UiTokenAmountSchema)` to create a new message. + */ +export const UiTokenAmountSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 26) + +/** + * SPL token balance entry. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TokenBalance + */ +export type TokenBalance = Message<'capabilities.blockchain.solana.v1alpha.TokenBalance'> & { + /** + * index in account_keys + * + * @generated from field: uint32 account_index = 1; + */ + accountIndex: number + + /** + * 32-byte owner (optional) + * + * @generated from field: optional bytes owner = 2; + */ + owner?: Uint8Array + + /** + * 32-byte token program (optional) + * + * @generated from field: optional bytes program_id = 3; + */ + programId?: Uint8Array + + /** + * 32-byte mint + * + * @generated from field: bytes mint = 4; + */ + mint: Uint8Array + + /** + * formatted amounts + * + * @generated from field: capabilities.blockchain.solana.v1alpha.UiTokenAmount ui = 5; + */ + ui?: UiTokenAmount +} + +/** + * SPL token balance entry. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TokenBalance + */ +export type TokenBalanceJson = { + /** + * index in account_keys + * + * @generated from field: uint32 account_index = 1; + */ + accountIndex?: number + + /** + * 32-byte owner (optional) + * + * @generated from field: optional bytes owner = 2; + */ + owner?: string + + /** + * 32-byte token program (optional) + * + * @generated from field: optional bytes program_id = 3; + */ + programId?: string + + /** + * 32-byte mint + * + * @generated from field: bytes mint = 4; + */ + mint?: string + + /** + * formatted amounts + * + * @generated from field: capabilities.blockchain.solana.v1alpha.UiTokenAmount ui = 5; + */ + ui?: UiTokenAmountJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.TokenBalance. + * Use `create(TokenBalanceSchema)` to create a new message. + */ +export const TokenBalanceSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 27) + +/** + * Inner instruction list at a given outer instruction index. + * + * @generated from message capabilities.blockchain.solana.v1alpha.InnerInstruction + */ +export type InnerInstruction = + Message<'capabilities.blockchain.solana.v1alpha.InnerInstruction'> & { + /** + * outer ix index + * + * @generated from field: uint32 index = 1; + */ + index: number + + /** + * invoked ixs + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.CompiledInstruction instructions = 2; + */ + instructions: CompiledInstruction[] + } + +/** + * Inner instruction list at a given outer instruction index. + * + * @generated from message capabilities.blockchain.solana.v1alpha.InnerInstruction + */ +export type InnerInstructionJson = { + /** + * outer ix index + * + * @generated from field: uint32 index = 1; + */ + index?: number + + /** + * invoked ixs + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.CompiledInstruction instructions = 2; + */ + instructions?: CompiledInstructionJson[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.InnerInstruction. + * Use `create(InnerInstructionSchema)` to create a new message. + */ +export const InnerInstructionSchema: GenMessage< + InnerInstruction, + { jsonType: InnerInstructionJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 28) + +/** + * Address table lookups expanded by loader. + * + * @generated from message capabilities.blockchain.solana.v1alpha.LoadedAddresses + */ +export type LoadedAddresses = Message<'capabilities.blockchain.solana.v1alpha.LoadedAddresses'> & { + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes readonly = 1; + */ + readonly: Uint8Array[] + + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes writable = 2; + */ + writable: Uint8Array[] +} + +/** + * Address table lookups expanded by loader. + * + * @generated from message capabilities.blockchain.solana.v1alpha.LoadedAddresses + */ +export type LoadedAddressesJson = { + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes readonly = 1; + */ + readonly?: string[] + + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes writable = 2; + */ + writable?: string[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.LoadedAddresses. + * Use `create(LoadedAddressesSchema)` to create a new message. + */ +export const LoadedAddressesSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 29) + +/** + * Compiled (program) instruction. + * + * @generated from message capabilities.blockchain.solana.v1alpha.CompiledInstruction + */ +export type CompiledInstruction = + Message<'capabilities.blockchain.solana.v1alpha.CompiledInstruction'> & { + /** + * index into account_keys + * + * @generated from field: uint32 program_id_index = 1; + */ + programIdIndex: number + + /** + * indices into account_keys + * + * @generated from field: repeated uint32 accounts = 2; + */ + accounts: number[] + + /** + * program input bytes + * + * @generated from field: bytes data = 3; + */ + data: Uint8Array + + /** + * if recorded by node + * + * @generated from field: uint32 stack_height = 4; + */ + stackHeight: number + } + +/** + * Compiled (program) instruction. + * + * @generated from message capabilities.blockchain.solana.v1alpha.CompiledInstruction + */ +export type CompiledInstructionJson = { + /** + * index into account_keys + * + * @generated from field: uint32 program_id_index = 1; + */ + programIdIndex?: number + + /** + * indices into account_keys + * + * @generated from field: repeated uint32 accounts = 2; + */ + accounts?: number[] + + /** + * program input bytes + * + * @generated from field: bytes data = 3; + */ + data?: string + + /** + * if recorded by node + * + * @generated from field: uint32 stack_height = 4; + */ + stackHeight?: number +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.CompiledInstruction. + * Use `create(CompiledInstructionSchema)` to create a new message. + */ +export const CompiledInstructionSchema: GenMessage< + CompiledInstruction, + { jsonType: CompiledInstructionJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 30) + +/** + * Raw bytes with encoding tag. + * + * @generated from message capabilities.blockchain.solana.v1alpha.Data + */ +export type Data = Message<'capabilities.blockchain.solana.v1alpha.Data'> & { + /** + * raw bytes + * + * @generated from field: bytes content = 1; + */ + content: Uint8Array + + /** + * how it was encoded originally + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 2; + */ + encoding: EncodingType +} + +/** + * Raw bytes with encoding tag. + * + * @generated from message capabilities.blockchain.solana.v1alpha.Data + */ +export type DataJson = { + /** + * raw bytes + * + * @generated from field: bytes content = 1; + */ + content?: string + + /** + * how it was encoded originally + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 2; + */ + encoding?: EncodingTypeJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.Data. + * Use `create(DataSchema)` to create a new message. + */ +export const DataSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 31) + +/** + * Program return data. + * + * @generated from message capabilities.blockchain.solana.v1alpha.ReturnData + */ +export type ReturnData = Message<'capabilities.blockchain.solana.v1alpha.ReturnData'> & { + /** + * 32-byte Pubkey + * + * @generated from field: bytes program_id = 1; + */ + programId: Uint8Array + + /** + * raw return bytes + * + * @generated from field: capabilities.blockchain.solana.v1alpha.Data data = 2; + */ + data?: Data +} + +/** + * Program return data. + * + * @generated from message capabilities.blockchain.solana.v1alpha.ReturnData + */ +export type ReturnDataJson = { + /** + * 32-byte Pubkey + * + * @generated from field: bytes program_id = 1; + */ + programId?: string + + /** + * raw return bytes + * + * @generated from field: capabilities.blockchain.solana.v1alpha.Data data = 2; + */ + data?: DataJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.ReturnData. + * Use `create(ReturnDataSchema)` to create a new message. + */ +export const ReturnDataSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 32) + +/** + * Transaction execution metadata. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TransactionMeta + */ +export type TransactionMeta = Message<'capabilities.blockchain.solana.v1alpha.TransactionMeta'> & { + /** + * error JSON (empty on success) + * + * @generated from field: string err_json = 1; + */ + errJson: string + + /** + * lamports + * + * @generated from field: uint64 fee = 2 [jstype = JS_NORMAL]; + */ + fee: bigint + + /** + * lamports per account + * + * @generated from field: repeated uint64 pre_balances = 3 [jstype = JS_NORMAL]; + */ + preBalances: bigint[] + + /** + * lamports per account + * + * @generated from field: repeated uint64 post_balances = 4 [jstype = JS_NORMAL]; + */ + postBalances: bigint[] + + /** + * runtime logs + * + * @generated from field: repeated string log_messages = 5; + */ + logMessages: string[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.TokenBalance pre_token_balances = 6; + */ + preTokenBalances: TokenBalance[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.TokenBalance post_token_balances = 7; + */ + postTokenBalances: TokenBalance[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.InnerInstruction inner_instructions = 8; + */ + innerInstructions: InnerInstruction[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.LoadedAddresses loaded_addresses = 9; + */ + loadedAddresses?: LoadedAddresses + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ReturnData return_data = 10; + */ + returnData?: ReturnData + + /** + * CUs + * + * @generated from field: optional uint64 compute_units_consumed = 11 [jstype = JS_NORMAL]; + */ + computeUnitsConsumed?: bigint +} + +/** + * Transaction execution metadata. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TransactionMeta + */ +export type TransactionMetaJson = { + /** + * error JSON (empty on success) + * + * @generated from field: string err_json = 1; + */ + errJson?: string + + /** + * lamports + * + * @generated from field: uint64 fee = 2 [jstype = JS_NORMAL]; + */ + fee?: string + + /** + * lamports per account + * + * @generated from field: repeated uint64 pre_balances = 3 [jstype = JS_NORMAL]; + */ + preBalances?: string[] + + /** + * lamports per account + * + * @generated from field: repeated uint64 post_balances = 4 [jstype = JS_NORMAL]; + */ + postBalances?: string[] + + /** + * runtime logs + * + * @generated from field: repeated string log_messages = 5; + */ + logMessages?: string[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.TokenBalance pre_token_balances = 6; + */ + preTokenBalances?: TokenBalanceJson[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.TokenBalance post_token_balances = 7; + */ + postTokenBalances?: TokenBalanceJson[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.InnerInstruction inner_instructions = 8; + */ + innerInstructions?: InnerInstructionJson[] + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.LoadedAddresses loaded_addresses = 9; + */ + loadedAddresses?: LoadedAddressesJson + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ReturnData return_data = 10; + */ + returnData?: ReturnDataJson + + /** + * CUs + * + * @generated from field: optional uint64 compute_units_consumed = 11 [jstype = JS_NORMAL]; + */ + computeUnitsConsumed?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.TransactionMeta. + * Use `create(TransactionMetaSchema)` to create a new message. + */ +export const TransactionMetaSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 33) + +/** + * Transaction envelope: raw bytes or parsed struct. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TransactionEnvelope + */ +export type TransactionEnvelope = + Message<'capabilities.blockchain.solana.v1alpha.TransactionEnvelope'> & { + /** + * @generated from oneof capabilities.blockchain.solana.v1alpha.TransactionEnvelope.transaction + */ + transaction: + | { + /** + * raw tx bytes (for RAW/base64) + * + * @generated from field: bytes raw = 1; + */ + value: Uint8Array + case: 'raw' + } + | { + /** + * parsed tx (for JSON_PARSED) + * + * @generated from field: capabilities.blockchain.solana.v1alpha.ParsedTransaction parsed = 2; + */ + value: ParsedTransaction + case: 'parsed' + } + | { case: undefined; value?: undefined } + } + +/** + * Transaction envelope: raw bytes or parsed struct. + * + * @generated from message capabilities.blockchain.solana.v1alpha.TransactionEnvelope + */ +export type TransactionEnvelopeJson = { + /** + * raw tx bytes (for RAW/base64) + * + * @generated from field: bytes raw = 1; + */ + raw?: string + + /** + * parsed tx (for JSON_PARSED) + * + * @generated from field: capabilities.blockchain.solana.v1alpha.ParsedTransaction parsed = 2; + */ + parsed?: ParsedTransactionJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.TransactionEnvelope. + * Use `create(TransactionEnvelopeSchema)` to create a new message. + */ +export const TransactionEnvelopeSchema: GenMessage< + TransactionEnvelope, + { jsonType: TransactionEnvelopeJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 34) + +/** + * GetTransaction reply. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetTransactionReply + */ +export type GetTransactionReply = + Message<'capabilities.blockchain.solana.v1alpha.GetTransactionReply'> & { + /** + * processed slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot: bigint + + /** + * unix seconds + * + * @generated from field: optional int64 block_time = 2 [jstype = JS_NORMAL]; + */ + blockTime?: bigint + + /** + * tx bytes or parsed + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.TransactionEnvelope transaction = 3; + */ + transaction?: TransactionEnvelope + + /** + * may be omitted by node + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.TransactionMeta meta = 4; + */ + meta?: TransactionMeta + } + +/** + * GetTransaction reply. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetTransactionReply + */ +export type GetTransactionReplyJson = { + /** + * processed slot + * + * @generated from field: uint64 slot = 1 [jstype = JS_NORMAL]; + */ + slot?: string + + /** + * unix seconds + * + * @generated from field: optional int64 block_time = 2 [jstype = JS_NORMAL]; + */ + blockTime?: string + + /** + * tx bytes or parsed + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.TransactionEnvelope transaction = 3; + */ + transaction?: TransactionEnvelopeJson + + /** + * may be omitted by node + * + * @generated from field: optional capabilities.blockchain.solana.v1alpha.TransactionMeta meta = 4; + */ + meta?: TransactionMetaJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetTransactionReply. + * Use `create(GetTransactionReplySchema)` to create a new message. + */ +export const GetTransactionReplySchema: GenMessage< + GetTransactionReply, + { jsonType: GetTransactionReplyJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 35) + +/** + * GetTransaction request. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetTransactionRequest + */ +export type GetTransactionRequest = + Message<'capabilities.blockchain.solana.v1alpha.GetTransactionRequest'> & { + /** + * 64-byte signature + * + * @generated from field: bytes signature = 1; + */ + signature: Uint8Array + } + +/** + * GetTransaction request. + * + * @generated from message capabilities.blockchain.solana.v1alpha.GetTransactionRequest + */ +export type GetTransactionRequestJson = { + /** + * 64-byte signature + * + * @generated from field: bytes signature = 1; + */ + signature?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.GetTransactionRequest. + * Use `create(GetTransactionRequestSchema)` to create a new message. + */ +export const GetTransactionRequestSchema: GenMessage< + GetTransactionRequest, + { jsonType: GetTransactionRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 36) + +/** + * Simulation options. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXOpts + */ +export type SimulateTXOpts = Message<'capabilities.blockchain.solana.v1alpha.SimulateTXOpts'> & { + /** + * verify sigs + * + * @generated from field: bool sig_verify = 1; + */ + sigVerify: boolean + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment: CommitmentType + + /** + * refresh blockhash + * + * @generated from field: bool replace_recent_blockhash = 3; + */ + replaceRecentBlockhash: boolean + + /** + * return accounts + * + * @generated from field: capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts accounts = 4; + */ + accounts?: SimulateTransactionAccountsOpts +} + +/** + * Simulation options. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXOpts + */ +export type SimulateTXOptsJson = { + /** + * verify sigs + * + * @generated from field: bool sig_verify = 1; + */ + sigVerify?: boolean + + /** + * read consistency + * + * @generated from field: capabilities.blockchain.solana.v1alpha.CommitmentType commitment = 2; + */ + commitment?: CommitmentTypeJson + + /** + * refresh blockhash + * + * @generated from field: bool replace_recent_blockhash = 3; + */ + replaceRecentBlockhash?: boolean + + /** + * return accounts + * + * @generated from field: capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts accounts = 4; + */ + accounts?: SimulateTransactionAccountsOptsJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.SimulateTXOpts. + * Use `create(SimulateTXOptsSchema)` to create a new message. + */ +export const SimulateTXOptsSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 37) + +/** + * Simulation result. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXReply + */ +export type SimulateTXReply = Message<'capabilities.blockchain.solana.v1alpha.SimulateTXReply'> & { + /** + * empty on success + * + * @generated from field: string err = 1; + */ + err: string + + /** + * runtime logs + * + * @generated from field: repeated string logs = 2; + */ + logs: string[] + + /** + * returned accounts + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.Account accounts = 3; + */ + accounts: Account[] + + /** + * CUs + * + * @generated from field: uint64 units_consumed = 4 [jstype = JS_NORMAL]; + */ + unitsConsumed: bigint +} + +/** + * Simulation result. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXReply + */ +export type SimulateTXReplyJson = { + /** + * empty on success + * + * @generated from field: string err = 1; + */ + err?: string + + /** + * runtime logs + * + * @generated from field: repeated string logs = 2; + */ + logs?: string[] + + /** + * returned accounts + * + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.Account accounts = 3; + */ + accounts?: AccountJson[] + + /** + * CUs + * + * @generated from field: uint64 units_consumed = 4 [jstype = JS_NORMAL]; + */ + unitsConsumed?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.SimulateTXReply. + * Use `create(SimulateTXReplySchema)` to create a new message. + */ +export const SimulateTXReplySchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 38) + +/** + * Simulation request. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXRequest + */ +export type SimulateTXRequest = + Message<'capabilities.blockchain.solana.v1alpha.SimulateTXRequest'> & { + /** + * 32-byte program id (target) + * + * @generated from field: bytes receiver = 1; + */ + receiver: Uint8Array + + /** + * base64/base58 tx + * + * @generated from field: string encoded_transaction = 2; + */ + encodedTransaction: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.SimulateTXOpts opts = 3; + */ + opts?: SimulateTXOpts + } + +/** + * Simulation request. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTXRequest + */ +export type SimulateTXRequestJson = { + /** + * 32-byte program id (target) + * + * @generated from field: bytes receiver = 1; + */ + receiver?: string + + /** + * base64/base58 tx + * + * @generated from field: string encoded_transaction = 2; + */ + encodedTransaction?: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.SimulateTXOpts opts = 3; + */ + opts?: SimulateTXOptsJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.SimulateTXRequest. + * Use `create(SimulateTXRequestSchema)` to create a new message. + */ +export const SimulateTXRequestSchema: GenMessage< + SimulateTXRequest, + { jsonType: SimulateTXRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 39) + +/** + * Accounts to return during simulation. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts + */ +export type SimulateTransactionAccountsOpts = + Message<'capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts'> & { + /** + * account data encoding + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding: EncodingType + + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes addresses = 2; + */ + addresses: Uint8Array[] + } + +/** + * Accounts to return during simulation. + * + * @generated from message capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts + */ +export type SimulateTransactionAccountsOptsJson = { + /** + * account data encoding + * + * @generated from field: capabilities.blockchain.solana.v1alpha.EncodingType encoding = 1; + */ + encoding?: EncodingTypeJson + + /** + * 32-byte Pubkeys + * + * @generated from field: repeated bytes addresses = 2; + */ + addresses?: string[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.SimulateTransactionAccountsOpts. + * Use `create(SimulateTransactionAccountsOptsSchema)` to create a new message. + */ +export const SimulateTransactionAccountsOptsSchema: GenMessage< + SimulateTransactionAccountsOpts, + { jsonType: SimulateTransactionAccountsOptsJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 40) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.ValueComparator + */ +export type ValueComparator = Message<'capabilities.blockchain.solana.v1alpha.ValueComparator'> & { + /** + * @generated from field: bytes value = 1; + */ + value: Uint8Array + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ComparisonOperator operator = 2; + */ + operator: ComparisonOperator +} + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.ValueComparator + */ +export type ValueComparatorJson = { + /** + * @generated from field: bytes value = 1; + */ + value?: string + + /** + * @generated from field: capabilities.blockchain.solana.v1alpha.ComparisonOperator operator = 2; + */ + operator?: ComparisonOperatorJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.ValueComparator. + * Use `create(ValueComparatorSchema)` to create a new message. + */ +export const ValueComparatorSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 41) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.SubkeyConfig + */ +export type SubkeyConfig = Message<'capabilities.blockchain.solana.v1alpha.SubkeyConfig'> & { + /** + * @generated from field: repeated string path = 1; + */ + path: string[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.ValueComparator comparers = 2; + */ + comparers: ValueComparator[] +} + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.SubkeyConfig + */ +export type SubkeyConfigJson = { + /** + * @generated from field: repeated string path = 1; + */ + path?: string[] + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.ValueComparator comparers = 2; + */ + comparers?: ValueComparatorJson[] +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.SubkeyConfig. + * Use `create(SubkeyConfigSchema)` to create a new message. + */ +export const SubkeyConfigSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 42) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.CPIFilterConfig + */ +export type CPIFilterConfig = Message<'capabilities.blockchain.solana.v1alpha.CPIFilterConfig'> & { + /** + * @generated from field: bytes dest_address = 1; + */ + destAddress: Uint8Array + + /** + * @generated from field: bytes method_name = 2; + */ + methodName: Uint8Array +} + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.CPIFilterConfig + */ +export type CPIFilterConfigJson = { + /** + * @generated from field: bytes dest_address = 1; + */ + destAddress?: string + + /** + * @generated from field: bytes method_name = 2; + */ + methodName?: string +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.CPIFilterConfig. + * Use `create(CPIFilterConfigSchema)` to create a new message. + */ +export const CPIFilterConfigSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 43) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + */ +export type FilterLogTriggerRequest = + Message<'capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest'> & { + /** + * @generated from field: string name = 1; + */ + name: string + + /** + * Solana PublicKey (32 bytes) + * + * @generated from field: bytes address = 2; + */ + address: Uint8Array + + /** + * @generated from field: string event_name = 3; + */ + eventName: string + + /** + * @generated from field: bytes contract_idl_json = 4; + */ + contractIdlJson: Uint8Array + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.SubkeyConfig subkeys = 5; + */ + subkeys: SubkeyConfig[] + + /** + * @generated from field: optional capabilities.blockchain.solana.v1alpha.CPIFilterConfig cpi_filter_config = 6; + */ + cpiFilterConfig?: CPIFilterConfig + } + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest + */ +export type FilterLogTriggerRequestJson = { + /** + * @generated from field: string name = 1; + */ + name?: string + + /** + * Solana PublicKey (32 bytes) + * + * @generated from field: bytes address = 2; + */ + address?: string + + /** + * @generated from field: string event_name = 3; + */ + eventName?: string + + /** + * @generated from field: bytes contract_idl_json = 4; + */ + contractIdlJson?: string + + /** + * @generated from field: repeated capabilities.blockchain.solana.v1alpha.SubkeyConfig subkeys = 5; + */ + subkeys?: SubkeyConfigJson[] + + /** + * @generated from field: optional capabilities.blockchain.solana.v1alpha.CPIFilterConfig cpi_filter_config = 6; + */ + cpiFilterConfig?: CPIFilterConfigJson +} + +/** + * Describes the message capabilities.blockchain.solana.v1alpha.FilterLogTriggerRequest. + * Use `create(FilterLogTriggerRequestSchema)` to create a new message. + */ +export const FilterLogTriggerRequestSchema: GenMessage< + FilterLogTriggerRequest, + { jsonType: FilterLogTriggerRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 44) + +/** + * @generated from message capabilities.blockchain.solana.v1alpha.Log + */ +export type Log = Message<'capabilities.blockchain.solana.v1alpha.Log'> & { /** - * max CUs (approx per-tx limit) + * Chain identifier * - * @generated from field: uint32 compute_limit = 1; + * @generated from field: string chain_id = 1; */ - computeLimit: number + chainId: string + + /** + * Index of the log within the block + * + * @generated from field: int64 log_index = 2 [jstype = JS_NORMAL]; + */ + logIndex: bigint + + /** + * 32-byte block hash + * + * @generated from field: bytes block_hash = 3; + */ + blockHash: Uint8Array + + /** + * Block/slot number + * + * @generated from field: int64 block_number = 4 [jstype = JS_NORMAL]; + */ + blockNumber: bigint + + /** + * Unix timestamp of the block + * + * @generated from field: uint64 block_timestamp = 5 [jstype = JS_NORMAL]; + */ + blockTimestamp: bigint + + /** + * 32-byte program PublicKey + * + * @generated from field: bytes address = 6; + */ + address: Uint8Array + + /** + * 8-byte event signature + * + * @generated from field: bytes event_sig = 7; + */ + eventSig: Uint8Array + + /** + * 64-byte transaction signature + * + * @generated from field: bytes tx_hash = 8; + */ + txHash: Uint8Array + + /** + * Decoded event data + * + * @generated from field: bytes data = 9; + */ + data: Uint8Array + + /** + * Sequence number for ordering + * + * @generated from field: int64 sequence_num = 10 [jstype = JS_NORMAL]; + */ + sequenceNum: bigint + + /** + * Error message if log processing failed + * + * @generated from field: optional string error = 11; + */ + error?: string } /** - * Compute budget configuration when submitting txs. - * - * @generated from message capabilities.blockchain.solana.v1alpha.ComputeConfig + * @generated from message capabilities.blockchain.solana.v1alpha.Log */ -export type ComputeConfigJson = { +export type LogJson = { /** - * max CUs (approx per-tx limit) + * Chain identifier * - * @generated from field: uint32 compute_limit = 1; + * @generated from field: string chain_id = 1; */ - computeLimit?: number + chainId?: string + + /** + * Index of the log within the block + * + * @generated from field: int64 log_index = 2 [jstype = JS_NORMAL]; + */ + logIndex?: string + + /** + * 32-byte block hash + * + * @generated from field: bytes block_hash = 3; + */ + blockHash?: string + + /** + * Block/slot number + * + * @generated from field: int64 block_number = 4 [jstype = JS_NORMAL]; + */ + blockNumber?: string + + /** + * Unix timestamp of the block + * + * @generated from field: uint64 block_timestamp = 5 [jstype = JS_NORMAL]; + */ + blockTimestamp?: string + + /** + * 32-byte program PublicKey + * + * @generated from field: bytes address = 6; + */ + address?: string + + /** + * 8-byte event signature + * + * @generated from field: bytes event_sig = 7; + */ + eventSig?: string + + /** + * 64-byte transaction signature + * + * @generated from field: bytes tx_hash = 8; + */ + txHash?: string + + /** + * Decoded event data + * + * @generated from field: bytes data = 9; + */ + data?: string + + /** + * Sequence number for ordering + * + * @generated from field: int64 sequence_num = 10 [jstype = JS_NORMAL]; + */ + sequenceNum?: string + + /** + * Error message if log processing failed + * + * @generated from field: optional string error = 11; + */ + error?: string } /** - * Describes the message capabilities.blockchain.solana.v1alpha.ComputeConfig. - * Use `create(ComputeConfigSchema)` to create a new message. + * Describes the message capabilities.blockchain.solana.v1alpha.Log. + * Use `create(LogSchema)` to create a new message. */ -export const ComputeConfigSchema: GenMessage = +export const LogSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 0) + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 45) /** * All metas are non-signers. @@ -103,7 +2837,7 @@ export type AccountMetaJson = { */ export const AccountMetaSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 1) + messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 46) /** * @generated from message capabilities.blockchain.solana.v1alpha.WriteReportRequest @@ -171,7 +2905,7 @@ export type WriteReportRequestJson = { export const WriteReportRequestSchema: GenMessage< WriteReportRequest, { jsonType: WriteReportRequestJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 2) +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 47) /** * @generated from message capabilities.blockchain.solana.v1alpha.WriteReportReply @@ -241,7 +2975,171 @@ export type WriteReportReplyJson = { export const WriteReportReplySchema: GenMessage< WriteReportReply, { jsonType: WriteReportReplyJson } -> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 3) +> = /*@__PURE__*/ messageDesc(file_capabilities_blockchain_solana_v1alpha_client, 48) + +/** + * Account/tx data encodings. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.EncodingType + */ +export enum EncodingType { + /** + * @generated from enum value: ENCODING_TYPE_NONE = 0; + */ + NONE = 0, + + /** + * for data <129 bytes + * + * @generated from enum value: ENCODING_TYPE_BASE58 = 1; + */ + BASE58 = 1, + + /** + * any size + * + * @generated from enum value: ENCODING_TYPE_BASE64 = 2; + */ + BASE64 = 2, + + /** + * zstd-compressed, base64-wrapped + * + * @generated from enum value: ENCODING_TYPE_BASE64_ZSTD = 3; + */ + BASE64_ZSTD = 3, + + /** + * program parsers; fallback to base64 if unknown + * + * @generated from enum value: ENCODING_TYPE_JSON_PARSED = 4; + */ + JSON_PARSED = 4, + + /** + * raw JSON (rare; prefer JSON_PARSED) + * + * @generated from enum value: ENCODING_TYPE_JSON = 5; + */ + JSON = 5, +} + +/** + * Account/tx data encodings. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.EncodingType + */ +export type EncodingTypeJson = + | 'ENCODING_TYPE_NONE' + | 'ENCODING_TYPE_BASE58' + | 'ENCODING_TYPE_BASE64' + | 'ENCODING_TYPE_BASE64_ZSTD' + | 'ENCODING_TYPE_JSON_PARSED' + | 'ENCODING_TYPE_JSON' + +/** + * Describes the enum capabilities.blockchain.solana.v1alpha.EncodingType. + */ +export const EncodingTypeSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 0) + +/** + * Read consistency of queried state. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.CommitmentType + */ +export enum CommitmentType { + /** + * @generated from enum value: COMMITMENT_TYPE_NONE = 0; + */ + NONE = 0, + + /** + * cluster-finalized + * + * @generated from enum value: COMMITMENT_TYPE_FINALIZED = 1; + */ + FINALIZED = 1, + + /** + * voted by supermajority + * + * @generated from enum value: COMMITMENT_TYPE_CONFIRMED = 2; + */ + CONFIRMED = 2, + + /** + * node’s latest + * + * @generated from enum value: COMMITMENT_TYPE_PROCESSED = 3; + */ + PROCESSED = 3, +} + +/** + * Read consistency of queried state. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.CommitmentType + */ +export type CommitmentTypeJson = + | 'COMMITMENT_TYPE_NONE' + | 'COMMITMENT_TYPE_FINALIZED' + | 'COMMITMENT_TYPE_CONFIRMED' + | 'COMMITMENT_TYPE_PROCESSED' + +/** + * Describes the enum capabilities.blockchain.solana.v1alpha.CommitmentType. + */ +export const CommitmentTypeSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 1) + +/** + * Cluster confirmation status of a tx/signature. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.ConfirmationStatusType + */ +export enum ConfirmationStatusType { + /** + * @generated from enum value: CONFIRMATION_STATUS_TYPE_NONE = 0; + */ + NONE = 0, + + /** + * @generated from enum value: CONFIRMATION_STATUS_TYPE_PROCESSED = 1; + */ + PROCESSED = 1, + + /** + * @generated from enum value: CONFIRMATION_STATUS_TYPE_CONFIRMED = 2; + */ + CONFIRMED = 2, + + /** + * @generated from enum value: CONFIRMATION_STATUS_TYPE_FINALIZED = 3; + */ + FINALIZED = 3, +} + +/** + * Cluster confirmation status of a tx/signature. + * + * @generated from enum capabilities.blockchain.solana.v1alpha.ConfirmationStatusType + */ +export type ConfirmationStatusTypeJson = + | 'CONFIRMATION_STATUS_TYPE_NONE' + | 'CONFIRMATION_STATUS_TYPE_PROCESSED' + | 'CONFIRMATION_STATUS_TYPE_CONFIRMED' + | 'CONFIRMATION_STATUS_TYPE_FINALIZED' + +/** + * Describes the enum capabilities.blockchain.solana.v1alpha.ConfirmationStatusType. + */ +export const ConfirmationStatusTypeSchema: GenEnum< + ConfirmationStatusType, + ConfirmationStatusTypeJson +> = /*@__PURE__*/ enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 2) /** * Transaction execution status returned by submitters/simulations. @@ -283,7 +3181,60 @@ export type TxStatusJson = 'TX_STATUS_FATAL' | 'TX_STATUS_ABORTED' | 'TX_STATUS_ */ export const TxStatusSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 0) + enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 3) + +/** + * @generated from enum capabilities.blockchain.solana.v1alpha.ComparisonOperator + */ +export enum ComparisonOperator { + /** + * @generated from enum value: COMPARISON_OPERATOR_EQ = 0; + */ + EQ = 0, + + /** + * @generated from enum value: COMPARISON_OPERATOR_NEQ = 1; + */ + NEQ = 1, + + /** + * @generated from enum value: COMPARISON_OPERATOR_GT = 2; + */ + GT = 2, + + /** + * @generated from enum value: COMPARISON_OPERATOR_LT = 3; + */ + LT = 3, + + /** + * @generated from enum value: COMPARISON_OPERATOR_GTE = 4; + */ + GTE = 4, + + /** + * @generated from enum value: COMPARISON_OPERATOR_LTE = 5; + */ + LTE = 5, +} + +/** + * @generated from enum capabilities.blockchain.solana.v1alpha.ComparisonOperator + */ +export type ComparisonOperatorJson = + | 'COMPARISON_OPERATOR_EQ' + | 'COMPARISON_OPERATOR_NEQ' + | 'COMPARISON_OPERATOR_GT' + | 'COMPARISON_OPERATOR_LT' + | 'COMPARISON_OPERATOR_GTE' + | 'COMPARISON_OPERATOR_LTE' + +/** + * Describes the enum capabilities.blockchain.solana.v1alpha.ComparisonOperator. + */ +export const ComparisonOperatorSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 4) /** * @generated from enum capabilities.blockchain.solana.v1alpha.ReceiverContractExecutionStatus @@ -313,12 +3264,84 @@ export type ReceiverContractExecutionStatusJson = export const ReceiverContractExecutionStatusSchema: GenEnum< ReceiverContractExecutionStatus, ReceiverContractExecutionStatusJson -> = /*@__PURE__*/ enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 1) +> = /*@__PURE__*/ enumDesc(file_capabilities_blockchain_solana_v1alpha_client, 5) /** * @generated from service capabilities.blockchain.solana.v1alpha.Client */ export const Client: GenService<{ + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetAccountInfoWithOpts + */ + getAccountInfoWithOpts: { + methodKind: 'unary' + input: typeof GetAccountInfoWithOptsRequestSchema + output: typeof GetAccountInfoWithOptsReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetBalance + */ + getBalance: { + methodKind: 'unary' + input: typeof GetBalanceRequestSchema + output: typeof GetBalanceReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetBlock + */ + getBlock: { + methodKind: 'unary' + input: typeof GetBlockRequestSchema + output: typeof GetBlockReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetFeeForMessage + */ + getFeeForMessage: { + methodKind: 'unary' + input: typeof GetFeeForMessageRequestSchema + output: typeof GetFeeForMessageReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetMultipleAccountsWithOpts + */ + getMultipleAccountsWithOpts: { + methodKind: 'unary' + input: typeof GetMultipleAccountsWithOptsRequestSchema + output: typeof GetMultipleAccountsWithOptsReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetSignatureStatuses + */ + getSignatureStatuses: { + methodKind: 'unary' + input: typeof GetSignatureStatusesRequestSchema + output: typeof GetSignatureStatusesReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetSlotHeight + */ + getSlotHeight: { + methodKind: 'unary' + input: typeof GetSlotHeightRequestSchema + output: typeof GetSlotHeightReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.GetTransaction + */ + getTransaction: { + methodKind: 'unary' + input: typeof GetTransactionRequestSchema + output: typeof GetTransactionReplySchema + } + /** + * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.LogTrigger + */ + logTrigger: { + methodKind: 'server_streaming' + input: typeof FilterLogTriggerRequestSchema + output: typeof LogSchema + } /** * @generated from rpc capabilities.blockchain.solana.v1alpha.Client.WriteReport */ diff --git a/packages/cre-sdk/src/generated/capabilities/compute/confidentialworkflow/v1alpha/client_pb.ts b/packages/cre-sdk/src/generated/capabilities/compute/confidentialworkflow/v1alpha/client_pb.ts new file mode 100644 index 00000000..2756378a --- /dev/null +++ b/packages/cre-sdk/src/generated/capabilities/compute/confidentialworkflow/v1alpha/client_pb.ts @@ -0,0 +1,292 @@ +// @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 capabilities/compute/confidentialworkflow/v1alpha/client.proto (package capabilities.compute.confidentialworkflow.v1alpha, syntax proto3) +/* eslint-disable */ + +import type { Message } from '@bufbuild/protobuf' +import type { GenFile, GenMessage, GenService } from '@bufbuild/protobuf/codegenv2' +import { fileDesc, messageDesc, serviceDesc } from '@bufbuild/protobuf/codegenv2' +import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/generator/v1alpha/cre_metadata_pb' + +/** + * Describes the file capabilities/compute/confidentialworkflow/v1alpha/client.proto. + */ +export const file_capabilities_compute_confidentialworkflow_v1alpha_client: GenFile = + /*@__PURE__*/ + fileDesc( + 'Cj5jYXBhYmlsaXRpZXMvY29tcHV0ZS9jb25maWRlbnRpYWx3b3JrZmxvdy92MWF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NWNvbS5jYXBhYmlsaXRpZXMuY29tcHV0ZS5jb25maWRlbnRpYWx3b3JrZmxvdy52MWFscGhhQgtDbGllbnRQcm90b1ABogIDQ0NDqgIxQ2FwYWJpbGl0aWVzLkNvbXB1dGUuQ29uZmlkZW50aWFsd29ya2Zsb3cuVjFhbHBoYcoCMUNhcGFiaWxpdGllc1xDb21wdXRlXENvbmZpZGVudGlhbHdvcmtmbG93XFYxYWxwaGHiAj1DYXBhYmlsaXRpZXNcQ29tcHV0ZVxDb25maWRlbnRpYWx3b3JrZmxvd1xWMWFscGhhXEdQQk1ldGFkYXRh6gI0Q2FwYWJpbGl0aWVzOjpDb21wdXRlOjpDb25maWRlbnRpYWx3b3JrZmxvdzo6VjFhbHBoYWIGcHJvdG8z', + [file_tools_generator_v1alpha_cre_metadata], + ) + +/** + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier + */ +export type SecretIdentifier = + Message<'capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier'> & { + /** + * @generated from field: string key = 1; + */ + key: string + + /** + * namespace defaults to "main" when unset. + * + * @generated from field: optional string namespace = 2; + */ + namespace?: string + } + +/** + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier + */ +export type SecretIdentifierJson = { + /** + * @generated from field: string key = 1; + */ + key?: string + + /** + * namespace defaults to "main" when unset. + * + * @generated from field: optional string namespace = 2; + */ + namespace?: string +} + +/** + * Describes the message capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier. + * Use `create(SecretIdentifierSchema)` to create a new message. + */ +export const SecretIdentifierSchema: GenMessage< + SecretIdentifier, + { jsonType: SecretIdentifierJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_compute_confidentialworkflow_v1alpha_client, 0) + +/** + * WorkflowExecution is the public data sent to the enclave. + * Becomes ComputeRequest.PublicData after proto serialization. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution + */ +export type WorkflowExecution = + Message<'capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution'> & { + /** + * workflow_id identifies the workflow to execute. + * + * @generated from field: string workflow_id = 1; + */ + workflowId: string + + /** + * binary_url is the URL from which the enclave fetches the compiled WASM binary. + * + * @generated from field: string binary_url = 2; + */ + binaryUrl: string + + /** + * binary_hash is the expected SHA-256 hash of the WASM binary, for integrity verification. + * + * @generated from field: bytes binary_hash = 3; + */ + binaryHash: Uint8Array + + /** + * execute_request is a serialized sdk.v1alpha.ExecuteRequest proto. + * Contains either a subscribe request or a trigger execution request. + * + * @generated from field: bytes execute_request = 4; + */ + executeRequest: Uint8Array + + /** + * owner is the on-chain owner address of the workflow (hex, 0x-prefixed). + * Used by the enclave for runtime secret fetching from VaultDON. + * + * @generated from field: string owner = 5; + */ + owner: string + + /** + * execution_id is the unique execution identifier (64 hex chars, 32 bytes). + * Used by the enclave for runtime secret fetching from VaultDON. + * + * @generated from field: string execution_id = 6; + */ + executionId: string + + /** + * org_id is the organization identifier for the workflow owner. + * Used by the enclave when fetching secrets from VaultDON with org-based ownership. + * + * @generated from field: string org_id = 7; + */ + orgId: string + } + +/** + * WorkflowExecution is the public data sent to the enclave. + * Becomes ComputeRequest.PublicData after proto serialization. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution + */ +export type WorkflowExecutionJson = { + /** + * workflow_id identifies the workflow to execute. + * + * @generated from field: string workflow_id = 1; + */ + workflowId?: string + + /** + * binary_url is the URL from which the enclave fetches the compiled WASM binary. + * + * @generated from field: string binary_url = 2; + */ + binaryUrl?: string + + /** + * binary_hash is the expected SHA-256 hash of the WASM binary, for integrity verification. + * + * @generated from field: bytes binary_hash = 3; + */ + binaryHash?: string + + /** + * execute_request is a serialized sdk.v1alpha.ExecuteRequest proto. + * Contains either a subscribe request or a trigger execution request. + * + * @generated from field: bytes execute_request = 4; + */ + executeRequest?: string + + /** + * owner is the on-chain owner address of the workflow (hex, 0x-prefixed). + * Used by the enclave for runtime secret fetching from VaultDON. + * + * @generated from field: string owner = 5; + */ + owner?: string + + /** + * execution_id is the unique execution identifier (64 hex chars, 32 bytes). + * Used by the enclave for runtime secret fetching from VaultDON. + * + * @generated from field: string execution_id = 6; + */ + executionId?: string + + /** + * org_id is the organization identifier for the workflow owner. + * Used by the enclave when fetching secrets from VaultDON with org-based ownership. + * + * @generated from field: string org_id = 7; + */ + orgId?: string +} + +/** + * Describes the message capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution. + * Use `create(WorkflowExecutionSchema)` to create a new message. + */ +export const WorkflowExecutionSchema: GenMessage< + WorkflowExecution, + { jsonType: WorkflowExecutionJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_compute_confidentialworkflow_v1alpha_client, 1) + +/** + * ConfidentialWorkflowRequest is the input provided to the confidential workflows capability. + * It combines a WorkflowExecution with secrets from VaultDON. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowRequest + */ +export type ConfidentialWorkflowRequest = + Message<'capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowRequest'> & { + /** + * @generated from field: repeated capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier vault_don_secrets = 1; + */ + vaultDonSecrets: SecretIdentifier[] + + /** + * @generated from field: capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution execution = 2; + */ + execution?: WorkflowExecution + } + +/** + * ConfidentialWorkflowRequest is the input provided to the confidential workflows capability. + * It combines a WorkflowExecution with secrets from VaultDON. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowRequest + */ +export type ConfidentialWorkflowRequestJson = { + /** + * @generated from field: repeated capabilities.compute.confidentialworkflow.v1alpha.SecretIdentifier vault_don_secrets = 1; + */ + vaultDonSecrets?: SecretIdentifierJson[] + + /** + * @generated from field: capabilities.compute.confidentialworkflow.v1alpha.WorkflowExecution execution = 2; + */ + execution?: WorkflowExecutionJson +} + +/** + * Describes the message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowRequest. + * Use `create(ConfidentialWorkflowRequestSchema)` to create a new message. + */ +export const ConfidentialWorkflowRequestSchema: GenMessage< + ConfidentialWorkflowRequest, + { jsonType: ConfidentialWorkflowRequestJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_compute_confidentialworkflow_v1alpha_client, 2) + +/** + * ConfidentialWorkflowResponse is the output from the confidential workflows capability. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowResponse + */ +export type ConfidentialWorkflowResponse = + Message<'capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowResponse'> & { + /** + * execution_result is a serialized sdk.v1alpha.ExecutionResult proto. + * + * @generated from field: bytes execution_result = 1; + */ + executionResult: Uint8Array + } + +/** + * ConfidentialWorkflowResponse is the output from the confidential workflows capability. + * + * @generated from message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowResponse + */ +export type ConfidentialWorkflowResponseJson = { + /** + * execution_result is a serialized sdk.v1alpha.ExecutionResult proto. + * + * @generated from field: bytes execution_result = 1; + */ + executionResult?: string +} + +/** + * Describes the message capabilities.compute.confidentialworkflow.v1alpha.ConfidentialWorkflowResponse. + * Use `create(ConfidentialWorkflowResponseSchema)` to create a new message. + */ +export const ConfidentialWorkflowResponseSchema: GenMessage< + ConfidentialWorkflowResponse, + { jsonType: ConfidentialWorkflowResponseJson } +> = /*@__PURE__*/ messageDesc(file_capabilities_compute_confidentialworkflow_v1alpha_client, 3) + +/** + * @generated from service capabilities.compute.confidentialworkflow.v1alpha.Client + */ +export const Client: GenService<{ + /** + * @generated from rpc capabilities.compute.confidentialworkflow.v1alpha.Client.Execute + */ + execute: { + methodKind: 'unary' + input: typeof ConfidentialWorkflowRequestSchema + output: typeof ConfidentialWorkflowResponseSchema + } +}> = /*@__PURE__*/ serviceDesc(file_capabilities_compute_confidentialworkflow_v1alpha_client, 0) diff --git a/packages/cre-sdk/src/generated/capabilities/networking/http/v1alpha/client_pb.ts b/packages/cre-sdk/src/generated/capabilities/networking/http/v1alpha/client_pb.ts index aaa1f748..a5433a8c 100644 --- a/packages/cre-sdk/src/generated/capabilities/networking/http/v1alpha/client_pb.ts +++ b/packages/cre-sdk/src/generated/capabilities/networking/http/v1alpha/client_pb.ts @@ -15,7 +15,7 @@ import { file_tools_generator_v1alpha_cre_metadata } from '../../../../tools/gen export const file_capabilities_networking_http_v1alpha_client: GenFile = /*@__PURE__*/ fileDesc( - 'CjFjYXBhYmlsaXRpZXMvbmV0d29ya2luZy9odHRwL3YxYWxwaGEvY2xpZW50LnByb3RvEiRjYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEiSgoNQ2FjaGVTZXR0aW5ncxINCgVzdG9yZRgBIAEoCBIqCgdtYXhfYWdlGAIgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIh4KDEhlYWRlclZhbHVlcxIOCgZ2YWx1ZXMYASADKAki7wMKB1JlcXVlc3QSCwoDdXJsGAEgASgJEg4KBm1ldGhvZBgCIAEoCRJPCgdoZWFkZXJzGAMgAygLMjouY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlJlcXVlc3QuSGVhZGVyc0VudHJ5QgIYARIMCgRib2R5GAQgASgMEioKB3RpbWVvdXQYBSABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SSwoOY2FjaGVfc2V0dGluZ3MYBiABKAsyMy5jYXBhYmlsaXRpZXMubmV0d29ya2luZy5odHRwLnYxYWxwaGEuQ2FjaGVTZXR0aW5ncxJWCg1tdWx0aV9oZWFkZXJzGAcgAygLMj8uY2FwYWJpbGl0aWVzLm5ldHdvcmtpbmcuaHR0cC52MWFscGhhLlJlcXVlc3QuTXVsdGlIZWFkZXJzRW50cnkaLgoMSGVhZGVyc0VudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaZwoRTXVsdGlIZWFkZXJzRW50cnkSCwoDa2V5GAEgASgJEkEKBXZhbHVlGAIgASgLMjIu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waGFiBnByb3RvMw', [file_google_protobuf_duration, file_tools_generator_v1alpha_cre_metadata], ) @@ -101,6 +101,48 @@ export const HeaderValuesSchema: GenMessage & { + /** + * @generated from field: bytes private_key = 1; + */ + privateKey: Uint8Array + + /** + * @generated from field: bytes certificate = 2; + */ + certificate: Uint8Array +} + +/** + * MtlsAuth represents the private-key/cert pair for mtls auth. + * + * @generated from message capabilities.networking.http.v1alpha.MtlsAuth + */ +export type MtlsAuthJson = { + /** + * @generated from field: bytes private_key = 1; + */ + privateKey?: string + + /** + * @generated from field: bytes certificate = 2; + */ + certificate?: string +} + +/** + * Describes the message capabilities.networking.http.v1alpha.MtlsAuth. + * Use `create(MtlsAuthSchema)` to create a new message. + */ +export const MtlsAuthSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_capabilities_networking_http_v1alpha_client, 2) + /** * @generated from message capabilities.networking.http.v1alpha.Request */ @@ -144,6 +186,11 @@ export type Request = Message<'capabilities.networking.http.v1alpha.Request'> & * @generated from field: map multi_headers = 7; */ multiHeaders: { [key: string]: HeaderValues } + + /** + * @generated from field: optional capabilities.networking.http.v1alpha.MtlsAuth mtls = 8; + */ + mtls?: MtlsAuth } /** @@ -189,6 +236,11 @@ export type RequestJson = { * @generated from field: map multi_headers = 7; */ multiHeaders?: { [key: string]: HeaderValuesJson } + + /** + * @generated from field: optional capabilities.networking.http.v1alpha.MtlsAuth mtls = 8; + */ + mtls?: MtlsAuthJson } /** @@ -197,7 +249,7 @@ export type RequestJson = { */ export const RequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_client, 2) + messageDesc(file_capabilities_networking_http_v1alpha_client, 3) /** * @generated from message capabilities.networking.http.v1alpha.Response @@ -261,7 +313,7 @@ export type ResponseJson = { */ export const ResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_capabilities_networking_http_v1alpha_client, 3) + messageDesc(file_capabilities_networking_http_v1alpha_client, 4) /** * @generated from service capabilities.networking.http.v1alpha.Client diff --git a/packages/cre-sdk/src/generated/sdk/v1alpha/sdk_pb.ts b/packages/cre-sdk/src/generated/sdk/v1alpha/sdk_pb.ts index a30feeec..8487b074 100644 --- a/packages/cre-sdk/src/generated/sdk/v1alpha/sdk_pb.ts +++ b/packages/cre-sdk/src/generated/sdk/v1alpha/sdk_pb.ts @@ -16,7 +16,7 @@ import { file_values_v1_values } from '../../values/v1/values_pb' export const file_sdk_v1alpha_sdk: GenFile = /*@__PURE__*/ fileDesc( - 'ChVzZGsvdjFhbHBoYS9zZGsucHJvdG8SC3Nkay52MWFscGhhIrQBChVTaW1wbGVDb25zZW5zdXNJbnB1dHMSIQoFdmFsdWUYASABKAsyEC52YWx1ZXMudjEuVmFsdWVIABIPCgVlcnJvchgCIAEoCUgAEjUKC2Rlc2NyaXB0b3JzGAMgASgLMiAuc2RrLnYxYWxwaGEuQ29uc2Vuc3VzRGVzY3JpcHRvchIhCgdkZWZhdWx0GAQgASgLMhAudmFsdWVzLnYxLlZhbHVlQg0KC29ic2VydmF0aW9uIpABCglGaWVsZHNNYXASMgoGZmllbGRzGAEgAygLMiIuc2RrLnYxYWxwaGEuRmllbGRzTWFwLkZpZWxkc0VudHJ5Gk8KC0ZpZWxkc0VudHJ5EgsKA2tleRgBIAEoCRIvCgV2YWx1ZRgCIAEoCzIgLnNkay52MWFscGhhLkNvbnNlbnN1c0Rlc2NyaXB0b3I6AjgBIoYBChNDb25zZW5zdXNEZXNjcmlwdG9yEjMKC2FnZ3JlZ2F0aW9uGAEgASgOMhwuc2RrLnYxYWxwaGEuQWdncmVnYXRpb25UeXBlSAASLAoKZmllbGRzX21hcBgCIAEoCzIWLnNkay52MWFscGhhLkZpZWxkc01hcEgAQgwKCmRlc2NyaXB0b3IiagoNUmVwb3J0UmVxdWVzdBIXCg9lbmNvZGVkX3BheWxvYWQYASABKAwSFAoMZW5jb2Rlcl9uYW1lGAIgASgJEhQKDHNpZ25pbmdfYWxnbxgDIAEoCRIUCgxoYXNoaW5nX2FsZ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gZTZWNyZXQSCgoCaWQYASABKAkSEQoJbmFtZXNwYWNlGAIgASgJEg0KBW93bmVyGAMgASgJEg0KBXZhbHVlGAQgASgJIkoKC1NlY3JldEVycm9yEgoKAmlkGAEgASgJEhEKCW5hbWVzcGFjZRgCIAEoCRINCgVvd25lchgDIAEoCRINCgVlcnJvchgEIAEoCSJuCg5TZWNyZXRSZXNwb25zZRIlCgZzZWNyZXQYASABKAsyEy5zZGsudjFhbHBoYS5TZWNyZXRIABIpCgVlcnJvchgCIAEoCzIYLnNkay52MWFscGhhLlNlY3JldEVycm9ySABCCgoIcmVzcG9uc2UiQQoPU2VjcmV0UmVzcG9uc2VzEi4KCXJlc3BvbnNlcxgBIAMoCzIbLnNkay52MWFscGhhLlNlY3JldFJlc3BvbnNlKrgBCg9BZ2dyZWdhdGlvblR5cGUSIAocQUdHUkVHQVRJT05fVFlQRV9VTlNQRUNJRklFRBAAEhsKF0FHR1JFR0FUSU9OX1RZUEVfTUVESUFOEAESHgoaQUdHUkVHQVRJT05fVFlQRV9JREVOVElDQUwQAhIiCh5BR0dSRUdBVElPTl9UWVBFX0NPTU1PTl9QUkVGSVgQAxIiCh5BR0dSRUdBVElPTl9UWVBFX0NPTU1PTl9TVUZGSVgQBCo5CgRNb2RlEhQKEE1PREVfVU5TUEVDSUZJRUQQABIMCghNT0RFX0RPThABEg0KCU1PREVfTk9ERRACKjsKB1RlZVR5cGUSGAoUVEVFX1RZUEVfVU5TUEVDSUZJRUQQABIWChJURUVfVFlQRV9BV1NfTklUUk8QAUJoCg9jb20uc2RrLnYxYWxwaGFCCFNka1Byb3RvUAGiAgNTWFiqAgtTZGsuVjFhbHBoYcoCC1Nka1xWMWFscGhh4gIXU2RrXFYxYWxwaGFcR1BCTWV0YWRhdGHqAgxTZGs6OlYxYWxwaGFiBnByb3RvMw', [file_google_protobuf_any, file_google_protobuf_empty, file_values_v1_values], ) @@ -461,6 +461,11 @@ export type TriggerSubscription = Message<'sdk.v1alpha.TriggerSubscription'> & { * @generated from field: string method = 3; */ method: string + + /** + * @generated from field: sdk.v1alpha.Requirements requirements = 4; + */ + requirements?: Requirements } /** @@ -481,6 +486,11 @@ export type TriggerSubscriptionJson = { * @generated from field: string method = 3; */ method?: string + + /** + * @generated from field: sdk.v1alpha.Requirements requirements = 4; + */ + requirements?: RequirementsJson } /** @@ -492,6 +502,45 @@ export const TriggerSubscriptionSchema: GenMessage< { jsonType: TriggerSubscriptionJson } > = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 8) +/** + * @generated from message sdk.v1alpha.TeeTypeAndRegions + */ +export type TeeTypeAndRegions = Message<'sdk.v1alpha.TeeTypeAndRegions'> & { + /** + * @generated from field: sdk.v1alpha.TeeType type = 1; + */ + type: TeeType + + /** + * @generated from field: repeated string regions = 3; + */ + regions: string[] +} + +/** + * @generated from message sdk.v1alpha.TeeTypeAndRegions + */ +export type TeeTypeAndRegionsJson = { + /** + * @generated from field: sdk.v1alpha.TeeType type = 1; + */ + type?: TeeTypeJson + + /** + * @generated from field: repeated string regions = 3; + */ + regions?: string[] +} + +/** + * Describes the message sdk.v1alpha.TeeTypeAndRegions. + * Use `create(TeeTypeAndRegionsSchema)` to create a new message. + */ +export const TeeTypeAndRegionsSchema: GenMessage< + TeeTypeAndRegions, + { jsonType: TeeTypeAndRegionsJson } +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 9) + /** * @generated from message sdk.v1alpha.TriggerSubscriptionRequest */ @@ -519,7 +568,7 @@ export type TriggerSubscriptionRequestJson = { export const TriggerSubscriptionRequestSchema: GenMessage< TriggerSubscriptionRequest, { jsonType: TriggerSubscriptionRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 9) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 10) /** * @generated from message sdk.v1alpha.Trigger @@ -557,7 +606,140 @@ export type TriggerJson = { */ export const TriggerSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 10) + messageDesc(file_sdk_v1alpha_sdk, 11) + +/** + * @generated from message sdk.v1alpha.Regions + */ +export type Regions = Message<'sdk.v1alpha.Regions'> & { + /** + * @generated from field: repeated string regions = 1; + */ + regions: string[] +} + +/** + * @generated from message sdk.v1alpha.Regions + */ +export type RegionsJson = { + /** + * @generated from field: repeated string regions = 1; + */ + regions?: string[] +} + +/** + * Describes the message sdk.v1alpha.Regions. + * Use `create(RegionsSchema)` to create a new message. + */ +export const RegionsSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 12) + +/** + * @generated from message sdk.v1alpha.TeeTypesAndRegions + */ +export type TeeTypesAndRegions = Message<'sdk.v1alpha.TeeTypesAndRegions'> & { + /** + * @generated from field: repeated sdk.v1alpha.TeeTypeAndRegions tee_type_and_regions = 1; + */ + teeTypeAndRegions: TeeTypeAndRegions[] +} + +/** + * @generated from message sdk.v1alpha.TeeTypesAndRegions + */ +export type TeeTypesAndRegionsJson = { + /** + * @generated from field: repeated sdk.v1alpha.TeeTypeAndRegions tee_type_and_regions = 1; + */ + teeTypeAndRegions?: TeeTypeAndRegionsJson[] +} + +/** + * Describes the message sdk.v1alpha.TeeTypesAndRegions. + * Use `create(TeeTypesAndRegionsSchema)` to create a new message. + */ +export const TeeTypesAndRegionsSchema: GenMessage< + TeeTypesAndRegions, + { jsonType: TeeTypesAndRegionsJson } +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 13) + +/** + * @generated from message sdk.v1alpha.Tee + */ +export type Tee = Message<'sdk.v1alpha.Tee'> & { + /** + * @generated from oneof sdk.v1alpha.Tee.item + */ + item: + | { + /** + * @generated from field: sdk.v1alpha.Regions any_regions = 1; + */ + value: Regions + case: 'anyRegions' + } + | { + /** + * @generated from field: sdk.v1alpha.TeeTypesAndRegions tee_types_and_regions = 2; + */ + value: TeeTypesAndRegions + case: 'teeTypesAndRegions' + } + | { case: undefined; value?: undefined } +} + +/** + * @generated from message sdk.v1alpha.Tee + */ +export type TeeJson = { + /** + * @generated from field: sdk.v1alpha.Regions any_regions = 1; + */ + anyRegions?: RegionsJson + + /** + * @generated from field: sdk.v1alpha.TeeTypesAndRegions tee_types_and_regions = 2; + */ + teeTypesAndRegions?: TeeTypesAndRegionsJson +} + +/** + * Describes the message sdk.v1alpha.Tee. + * Use `create(TeeSchema)` to create a new message. + */ +export const TeeSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 14) + +/** + * @generated from message sdk.v1alpha.Requirements + */ +export type Requirements = Message<'sdk.v1alpha.Requirements'> & { + /** + * @generated from field: sdk.v1alpha.Tee tee = 1; + */ + tee?: Tee +} + +/** + * @generated from message sdk.v1alpha.Requirements + */ +export type RequirementsJson = { + /** + * @generated from field: sdk.v1alpha.Tee tee = 1; + */ + tee?: TeeJson +} + +/** + * Describes the message sdk.v1alpha.Requirements. + * Use `create(RequirementsSchema)` to create a new message. + */ +export const RequirementsSchema: GenMessage = + /*@__PURE__*/ + messageDesc(file_sdk_v1alpha_sdk, 15) /** * @generated from message sdk.v1alpha.AwaitCapabilitiesRequest @@ -586,7 +768,7 @@ export type AwaitCapabilitiesRequestJson = { export const AwaitCapabilitiesRequestSchema: GenMessage< AwaitCapabilitiesRequest, { jsonType: AwaitCapabilitiesRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 11) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 16) /** * @generated from message sdk.v1alpha.AwaitCapabilitiesResponse @@ -615,7 +797,7 @@ export type AwaitCapabilitiesResponseJson = { export const AwaitCapabilitiesResponseSchema: GenMessage< AwaitCapabilitiesResponse, { jsonType: AwaitCapabilitiesResponseJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 12) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 17) /** * @generated from message sdk.v1alpha.ExecuteRequest @@ -683,7 +865,7 @@ export type ExecuteRequestJson = { */ export const ExecuteRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 13) + messageDesc(file_sdk_v1alpha_sdk, 18) /** * @generated from message sdk.v1alpha.ExecutionResult @@ -743,7 +925,7 @@ export type ExecutionResultJson = { */ export const ExecutionResultSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 14) + messageDesc(file_sdk_v1alpha_sdk, 19) /** * @generated from message sdk.v1alpha.GetSecretsRequest @@ -782,7 +964,7 @@ export type GetSecretsRequestJson = { export const GetSecretsRequestSchema: GenMessage< GetSecretsRequest, { jsonType: GetSecretsRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 15) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 20) /** * @generated from message sdk.v1alpha.AwaitSecretsRequest @@ -811,7 +993,7 @@ export type AwaitSecretsRequestJson = { export const AwaitSecretsRequestSchema: GenMessage< AwaitSecretsRequest, { jsonType: AwaitSecretsRequestJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 16) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 21) /** * @generated from message sdk.v1alpha.AwaitSecretsResponse @@ -840,7 +1022,7 @@ export type AwaitSecretsResponseJson = { export const AwaitSecretsResponseSchema: GenMessage< AwaitSecretsResponse, { jsonType: AwaitSecretsResponseJson } -> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 17) +> = /*@__PURE__*/ messageDesc(file_sdk_v1alpha_sdk, 22) /** * @generated from message sdk.v1alpha.SecretRequest @@ -878,7 +1060,7 @@ export type SecretRequestJson = { */ export const SecretRequestSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 18) + messageDesc(file_sdk_v1alpha_sdk, 23) /** * @generated from message sdk.v1alpha.Secret @@ -936,7 +1118,7 @@ export type SecretJson = { */ export const SecretSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 19) + messageDesc(file_sdk_v1alpha_sdk, 24) /** * @generated from message sdk.v1alpha.SecretError @@ -994,7 +1176,7 @@ export type SecretErrorJson = { */ export const SecretErrorSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 20) + messageDesc(file_sdk_v1alpha_sdk, 25) /** * @generated from message sdk.v1alpha.SecretResponse @@ -1042,7 +1224,7 @@ export type SecretResponseJson = { */ export const SecretResponseSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 21) + messageDesc(file_sdk_v1alpha_sdk, 26) /** * @generated from message sdk.v1alpha.SecretResponses @@ -1070,7 +1252,7 @@ export type SecretResponsesJson = { */ export const SecretResponsesSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_sdk_v1alpha_sdk, 22) + messageDesc(file_sdk_v1alpha_sdk, 27) /** * @generated from enum sdk.v1alpha.AggregationType @@ -1148,3 +1330,30 @@ export type ModeJson = 'MODE_UNSPECIFIED' | 'MODE_DON' | 'MODE_NODE' * Describes the enum sdk.v1alpha.Mode. */ export const ModeSchema: GenEnum = /*@__PURE__*/ enumDesc(file_sdk_v1alpha_sdk, 1) + +/** + * @generated from enum sdk.v1alpha.TeeType + */ +export enum TeeType { + /** + * @generated from enum value: TEE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: TEE_TYPE_AWS_NITRO = 1; + */ + AWS_NITRO = 1, +} + +/** + * @generated from enum sdk.v1alpha.TeeType + */ +export type TeeTypeJson = 'TEE_TYPE_UNSPECIFIED' | 'TEE_TYPE_AWS_NITRO' + +/** + * Describes the enum sdk.v1alpha.TeeType. + */ +export const TeeTypeSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_sdk_v1alpha_sdk, 2) diff --git a/packages/cre-sdk/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts b/packages/cre-sdk/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts index dfafc07f..dfad21cf 100644 --- a/packages/cre-sdk/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts +++ b/packages/cre-sdk/src/generated/tools/generator/v1alpha/cre_metadata_pb.ts @@ -3,8 +3,8 @@ /* eslint-disable */ import type { Message } from '@bufbuild/protobuf' -import type { GenExtension, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' -import { extDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' +import type { GenEnum, GenExtension, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' +import { enumDesc, extDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' import type { MethodOptions, ServiceOptions } from '@bufbuild/protobuf/wkt' import { file_google_protobuf_descriptor } from '@bufbuild/protobuf/wkt' import type { Mode, ModeJson } from '../../../sdk/v1alpha/sdk_pb' @@ -16,7 +16,7 @@ import { file_sdk_v1alpha_sdk } from '../../../sdk/v1alpha/sdk_pb' export const file_tools_generator_v1alpha_cre_metadata: GenFile = /*@__PURE__*/ fileDesc( - 'Cip0b29scy9nZW5lcmF0b3IvdjFhbHBoYS9jcmVfbWV0YWRhdGEucHJvdG8SF3Rvb2xzLmdlbmVyYXRvci52MWFscGhhIoQBCgtTdHJpbmdMYWJlbBJECghkZWZhdWx0cxgBIAMoCzIyLnRvb2xzLmdlbmVyYXRvci52MWFscGhhLlN0cmluZ0xhYmVsLkRlZmF1bHRzRW50cnkaLwoNRGVmYXVsdHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBIogBCgtVaW50NjRMYWJlbBJECghkZWZhdWx0cxgBIAMoCzIyLnRvb2xzLmdlbmVyYXRvci52MWFscGhhLlVpbnQ2NExhYmVsLkRlZmF1bHRzRW50cnkaMwoNRGVmYXVsdHNFbnRyeRILCgNrZXkYASABKAkSEQoFdmFsdWUYAiABKARCAjAAOgI4ASKEAQoLVWludDMyTGFiZWwSRAoIZGVmYXVsdHMYASADKAsyMi50b29scy5nZW5lcmF0b3IudjFhbHBoYS5VaW50MzJMYWJlb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Rvcl9cVjFhbHBoYeICJFRvb2xzXEdlbmVyYXRvcl9cVjFhbHBoYVxHUEJNZXRhZGF0YeoCGVRvb2xzOjpHZW5lcmF0b3I6OlYxYWxwaGFiBnByb3RvMw', [file_google_protobuf_descriptor, file_sdk_v1alpha_sdk], ) @@ -262,6 +262,11 @@ export type CapabilityMetadata = Message<'tools.generator.v1alpha.CapabilityMeta * @generated from field: map labels = 3; */ labels: { [key: string]: Label } + + /** + * @generated from field: repeated tools.generator.v1alpha.AdditionalEnvironments additional_environments = 4; + */ + additionalEnvironments: AdditionalEnvironments[] } /** @@ -282,6 +287,11 @@ export type CapabilityMetadataJson = { * @generated from field: map labels = 3; */ labels?: { [key: string]: LabelJson } + + /** + * @generated from field: repeated tools.generator.v1alpha.AdditionalEnvironments additional_environments = 4; + */ + additionalEnvironments?: AdditionalEnvironmentsJson[] } /** @@ -323,6 +333,36 @@ export const CapabilityMethodMetadataSchema: GenMessage< { jsonType: CapabilityMethodMetadataJson } > = /*@__PURE__*/ messageDesc(file_tools_generator_v1alpha_cre_metadata, 7) +/** + * @generated from enum tools.generator.v1alpha.AdditionalEnvironments + */ +export enum AdditionalEnvironments { + /** + * @generated from enum value: ADDITIONAL_ENVIRONMENTS_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: ADDITIONAL_ENVIRONMENTS_TEE = 1; + */ + TEE = 1, +} + +/** + * @generated from enum tools.generator.v1alpha.AdditionalEnvironments + */ +export type AdditionalEnvironmentsJson = + | 'ADDITIONAL_ENVIRONMENTS_UNSPECIFIED' + | 'ADDITIONAL_ENVIRONMENTS_TEE' + +/** + * Describes the enum tools.generator.v1alpha.AdditionalEnvironments. + */ +export const AdditionalEnvironmentsSchema: GenEnum< + AdditionalEnvironments, + AdditionalEnvironmentsJson +> = /*@__PURE__*/ enumDesc(file_tools_generator_v1alpha_cre_metadata, 0) + /** * 50000-99999 is the range for custom options. * diff --git a/packages/cre-sdk/src/generated/workflows/v2/cre_info_pb.ts b/packages/cre-sdk/src/generated/workflows/v2/cre_info_pb.ts new file mode 100644 index 00000000..7e4424dc --- /dev/null +++ b/packages/cre-sdk/src/generated/workflows/v2/cre_info_pb.ts @@ -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 = + /*@__PURE__*/ + messageDesc(file_workflows_v2_cre_info, 0) diff --git a/packages/cre-sdk/src/generated/workflows/v2/workflow_key_pb.ts b/packages/cre-sdk/src/generated/workflows/v2/workflow_key_pb.ts new file mode 100644 index 00000000..1d53a513 --- /dev/null +++ b/packages/cre-sdk/src/generated/workflows/v2/workflow_key_pb.ts @@ -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 = + /*@__PURE__*/ + messageDesc(file_workflows_v2_workflow_key, 0) diff --git a/packages/cre-sdk/src/generated/workflows/v2/workflow_user_metric_pb.ts b/packages/cre-sdk/src/generated/workflows/v2/workflow_user_metric_pb.ts new file mode 100644 index 00000000..ad22aa12 --- /dev/null +++ b/packages/cre-sdk/src/generated/workflows/v2/workflow_user_metric_pb.ts @@ -0,0 +1,155 @@ +// @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_user_metric.proto (package workflows.v2, syntax proto3) +/* eslint-disable */ + +import type { Message } from '@bufbuild/protobuf' +import type { GenEnum, GenFile, GenMessage } from '@bufbuild/protobuf/codegenv2' +import { enumDesc, fileDesc, messageDesc } from '@bufbuild/protobuf/codegenv2' +import type { CreInfo, CreInfoJson } from './cre_info_pb' +import { file_workflows_v2_cre_info } from './cre_info_pb' +import type { WorkflowKey, WorkflowKeyJson } from './workflow_key_pb' +import { file_workflows_v2_workflow_key } from './workflow_key_pb' + +/** + * Describes the file workflows/v2/workflow_user_metric.proto. + */ +export const file_workflows_v2_workflow_user_metric: GenFile = + /*@__PURE__*/ + fileDesc( + 'Cid3b3JrZmxvd3MvdjIvd29ya2Zsb3dfdXNlcl9tZXRyaWMucHJvdG8SDHdvcmtmbG93cy52MiLPAgoSV29ya2Zsb3dVc2VyTWV0cmljEiYKB2NyZUluZm8YASABKAsyFS53b3JrZmxvd3MudjIuQ3JlSW5mbxIrCgh3b3JrZmxvdxgCIAEoCzIZLndvcmtmbG93cy52Mi5Xb3JrZmxvd0tleRIbChN3b3JrZmxvd0V4ZWN1dGlvbklEGAMgASgJEhEKCXRpbWVzdGFtcBgEIAEoCRIMCgRuYW1lGAUgASgJEg0KBXZhbHVlGAYgASgBEioKBHR5cGUYByABKA4yHC53b3JrZmxvd3MudjIuVXNlck1ldHJpY1R5cGUSPAoGbGFiZWxzGAggAygLMiwud29ya2Zsb3dzLnYyLldvcmtmbG93VXNlck1ldHJpYy5MYWJlbHNFbnRyeRotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBKmwKDlVzZXJNZXRyaWNUeXBlEiAKHFVTRVJfTUVUUklDX1RZUEVfVU5TUEVDSUZJRUQQABIcChhVU0VSX01FVFJJQ19UWVBFX0NPVU5URVIQARIaChZVU0VSX01FVFJJQ19UWVBFX0dBVUdFEAJCugEKEGNvbS53b3JrZmxvd3MudjJCF1dvcmtmbG93VXNlck1ldHJpY1Byb3RvUAFaPGdpdGh1Yi5jb20vc21hcnRjb250cmFjdGtpdC9jaGFpbmxpbmstcHJvdG9zL3dvcmtmbG93cy9nby92MqICA1dYWKoCDFdvcmtmbG93cy5WMsoCDFdvcmtmbG93c1xWMuICGFdvcmtmbG93c1xWMlxHUEJNZXRhZGF0YeoCDVdvcmtmbG93czo6VjJiBnByb3RvMw', + [file_workflows_v2_cre_info, file_workflows_v2_workflow_key], + ) + +/** + * @generated from message workflows.v2.WorkflowUserMetric + */ +export type WorkflowUserMetric = Message<'workflows.v2.WorkflowUserMetric'> & { + /** + * @generated from field: workflows.v2.CreInfo creInfo = 1; + */ + creInfo?: CreInfo + + /** + * @generated from field: workflows.v2.WorkflowKey workflow = 2; + */ + workflow?: WorkflowKey + + /** + * @generated from field: string workflowExecutionID = 3; + */ + workflowExecutionID: string + + /** + * @generated from field: string timestamp = 4; + */ + timestamp: string + + /** + * @generated from field: string name = 5; + */ + name: string + + /** + * @generated from field: double value = 6; + */ + value: number + + /** + * @generated from field: workflows.v2.UserMetricType type = 7; + */ + type: UserMetricType + + /** + * @generated from field: map labels = 8; + */ + labels: { [key: string]: string } +} + +/** + * @generated from message workflows.v2.WorkflowUserMetric + */ +export type WorkflowUserMetricJson = { + /** + * @generated from field: workflows.v2.CreInfo creInfo = 1; + */ + creInfo?: CreInfoJson + + /** + * @generated from field: workflows.v2.WorkflowKey workflow = 2; + */ + workflow?: WorkflowKeyJson + + /** + * @generated from field: string workflowExecutionID = 3; + */ + workflowExecutionID?: string + + /** + * @generated from field: string timestamp = 4; + */ + timestamp?: string + + /** + * @generated from field: string name = 5; + */ + name?: string + + /** + * @generated from field: double value = 6; + */ + value?: number | 'NaN' | 'Infinity' | '-Infinity' + + /** + * @generated from field: workflows.v2.UserMetricType type = 7; + */ + type?: UserMetricTypeJson + + /** + * @generated from field: map labels = 8; + */ + labels?: { [key: string]: string } +} + +/** + * Describes the message workflows.v2.WorkflowUserMetric. + * Use `create(WorkflowUserMetricSchema)` to create a new message. + */ +export const WorkflowUserMetricSchema: GenMessage< + WorkflowUserMetric, + { jsonType: WorkflowUserMetricJson } +> = /*@__PURE__*/ messageDesc(file_workflows_v2_workflow_user_metric, 0) + +/** + * @generated from enum workflows.v2.UserMetricType + */ +export enum UserMetricType { + /** + * @generated from enum value: USER_METRIC_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: USER_METRIC_TYPE_COUNTER = 1; + */ + COUNTER = 1, + + /** + * @generated from enum value: USER_METRIC_TYPE_GAUGE = 2; + */ + GAUGE = 2, +} + +/** + * @generated from enum workflows.v2.UserMetricType + */ +export type UserMetricTypeJson = + | 'USER_METRIC_TYPE_UNSPECIFIED' + | 'USER_METRIC_TYPE_COUNTER' + | 'USER_METRIC_TYPE_GAUGE' + +/** + * Describes the enum workflows.v2.UserMetricType. + */ +export const UserMetricTypeSchema: GenEnum = + /*@__PURE__*/ + enumDesc(file_workflows_v2_workflow_user_metric, 0) diff --git a/packages/cre-sdk/src/generator/generate-action.ts b/packages/cre-sdk/src/generator/generate-action.ts index a9635b03..8d3f6a37 100644 --- a/packages/cre-sdk/src/generator/generate-action.ts +++ b/packages/cre-sdk/src/generator/generate-action.ts @@ -17,6 +17,7 @@ export function generateActionMethod( capabilityClassName: string, labels: ProcessedLabel[], modePrefix: string, + teeEnabled: boolean, ): string { const capabilityIdLogic = generateCapabilityIdLogic(labels, capabilityClassName) @@ -47,9 +48,25 @@ export function generateActionMethod( // - JSON shape -> wrapped in NoExcess so unknown keys (e.g. plain // `body` instead of `bodyString`) fail at the call boundary even // when the user lifts the request object into a variable. - const callSig = `(runtime: ${modePrefix}Runtime, input: CapabilityInput): {result: () => ${outputType}}` - // Internal impl signature - widest, accepts either form. - const implSig = `(runtime: ${modePrefix}Runtime, input: ${nativeInputType} | ${jsonInputType}): {result: () => ${outputType}}` + const basicSig = `(runtime: ${modePrefix}Runtime, input: CapabilityInput): {result: () => ${outputType}}` + + const callSig = teeEnabled + ? basicSig.replace( + `${modePrefix}Runtime`, + `${modePrefix}Runtime | TeeRuntime`, + ) + : basicSig + + const teeSig = basicSig.replace(`${modePrefix}Runtime`, `TeeRuntime`) + + var nameAndPublicSigs = teeEnabled + ? `${methodName}${teeSig}\n${methodName}${basicSig};\n${methodName}${callSig};` + : `${methodName}${callSig};` + + // Internal impl signature - widest, accepts either form (and either runtime when TEE is enabled). + const implSig = `(runtime: ${modePrefix}Runtime${ + teeEnabled ? ' | TeeRuntime' : '' + }, input: ${nativeInputType} | ${jsonInputType}): {result: () => ${outputType}}` const callSigAndBody = `${implSig} { // Handle input conversion - unwrap if it's a wrapped type, convert from JSON if needed let payload: ${method.input.name} @@ -113,7 +130,7 @@ export function generateActionMethod( : UnwrapOptions, ): (...args: TArgs) => { result: () => TOutput }` return ` - ${methodName}${callSig} + ${nameAndPublicSigs} ${methodName}${sugarSig} ${methodName}(...args: unknown[]): unknown { // Check if this is the sugar syntax overload (has function parameter) @@ -122,7 +139,7 @@ export function generateActionMethod( return this.${methodName}SugarHelper(runtime, fn, consensusAggregation, unwrapOptions) } // Otherwise, this is the basic call overload - const [runtime, input] = args as [${modePrefix}Runtime, ${inputTypes.join(' | ')}] + const [runtime, input] = args as [${teeEnabled ? `${modePrefix}Runtime | TeeRuntime` : `${modePrefix}Runtime`}, ${inputTypes.join(' | ')}] return this.${methodName}CallHelper(runtime, input) } private ${methodName}CallHelper${callSigAndBody} @@ -134,7 +151,13 @@ export function generateActionMethod( return runtime.runInNodeMode(wrappedFn, consensusAggregation, unwrapOptions) }` } + + // For DON mode: emit tee + basic overload declarations, then the implementation with its name. + // nameAndPublicSigs is designed for Node mode's dispatcher pattern and must not be reused here. + const donOverloads = teeEnabled + ? `${methodName}${teeSig}\n ${methodName}${basicSig}\n ` + : `${methodName}${callSig}\n ` + return ` - ${methodName}${callSig} - ${methodName}${callSigAndBody}` + ${donOverloads}${methodName}${callSigAndBody}` } diff --git a/packages/cre-sdk/src/generator/generate-sdk.ts b/packages/cre-sdk/src/generator/generate-sdk.ts index 3a0c5bda..65e6425f 100644 --- a/packages/cre-sdk/src/generator/generate-sdk.ts +++ b/packages/cre-sdk/src/generator/generate-sdk.ts @@ -5,6 +5,7 @@ import type { GenFile } from '@bufbuild/protobuf/codegenv2' import { Mode } from '@cre/generated/sdk/v1alpha/sdk_pb' import type { CapabilityMetadata } from '@cre/generated/tools/generator/v1alpha/cre_metadata_pb' import { + AdditionalEnvironments, capability, method as methodOption, } from '@cre/generated/tools/generator/v1alpha/cre_metadata_pb' @@ -12,12 +13,7 @@ import { generateActionMethod } from './generate-action' import { generateReportWrapper } from './generate-report-wrapper' import { generateActionSugarClass } from './generate-sugar' import { generateTriggerClass, generateTriggerMethod } from './generate-trigger' -import { - generateCapabilityIdLogic, - generateConstructorParams, - generateLabelSupport, - processLabels, -} from './label-utils' +import { generateConstructorParams, generateLabelSupport, processLabels } from './label-utils' import { getImportPathForFile, lowerCaseFirstLetter } from './utils' const getCapabilityServiceOptions = (service: DescService): CapabilityMetadata | false => { @@ -96,6 +92,7 @@ export function generateSdk(file: GenFile, outputDir: string) { }) const modePrefix = capOption.mode === Mode.NODE ? 'Node' : '' + const teeEnabled = capOption.additionalEnvironments.includes(AdditionalEnvironments.TEE) // Build import statements // Note: protobuf imports are deferred until after report wrappers are processed, @@ -122,10 +119,12 @@ export function generateSdk(file: GenFile, outputDir: string) { if (hasActions) { if (modePrefix !== '') { - imports.add(`import type { Runtime, ${modePrefix}Runtime } from "@cre/sdk"`) + imports.add( + `import type { Runtime, ${modePrefix}Runtime${teeEnabled ? ', TeeRuntime' : ''} } from "@cre/sdk"`, + ) imports.add(`import { Report } from "@cre/sdk/report"`) } else { - imports.add(`import type { Runtime } from "@cre/sdk"`) + imports.add(`import type { Runtime ${teeEnabled ? ', TeeRuntime' : ''} } from "@cre/sdk"`) imports.add(`import { Report } from "@cre/sdk/report"`) imports.add(`import { hexToBytes } from "@cre/sdk/utils/hex-utils";`) } @@ -234,7 +233,14 @@ export function generateSdk(file: GenFile, outputDir: string) { } // Generate action method - return generateActionMethod(method, methodName, capabilityClassName, labels, modePrefix) + return generateActionMethod( + method, + methodName, + capabilityClassName, + labels, + modePrefix, + teeEnabled, + ) }) .join('\n') diff --git a/packages/cre-sdk/src/sdk/cre/index.ts b/packages/cre-sdk/src/sdk/cre/index.ts index b1479a7d..2e98c040 100644 --- a/packages/cre-sdk/src/sdk/cre/index.ts +++ b/packages/cre-sdk/src/sdk/cre/index.ts @@ -2,6 +2,7 @@ * Public API for the CRE SDK. */ +import { ClientCapability as AptosClient } from '@cre/generated-sdk/capabilities/blockchain/aptos/v1alpha/client_sdk_gen' import { ClientCapability as EVMClient } from '@cre/generated-sdk/capabilities/blockchain/evm/v1alpha/client_sdk_gen' import { ClientCapability as SolanaClient } from '@cre/generated-sdk/capabilities/blockchain/solana/v1alpha/client_sdk_gen' import { ClientCapability as ConfidentialHTTPClient } from '@cre/generated-sdk/capabilities/networking/confidentialhttp/v1alpha/client_sdk_gen' @@ -9,7 +10,7 @@ import { ClientCapability as HTTPClient } from '@cre/generated-sdk/capabilities/ import { HTTPCapability } from '@cre/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen' import { CronCapability } from '@cre/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen' import { prepareRuntime } from '@cre/sdk/utils/prepare-runtime' -import { handler } from '@cre/sdk/workflow' +import { handler, handlerInTee } from '@cre/sdk/workflow' /** * Public exports for the CRE SDK. @@ -25,6 +26,14 @@ export { } from '@cre/generated/capabilities/blockchain/solana/v1alpha/client_pb' export type { Payload as HTTPPayload } from '@cre/generated/capabilities/networking/http/v1alpha/trigger_pb' export type { Payload as CronPayload } from '@cre/generated/capabilities/scheduler/cron/v1/trigger_pb' +export { TeeType } from '@cre/generated/sdk/v1alpha/sdk_pb' +// Aptos Capability +export { + ClientCapability as AptosClient, + type WriteCreReportRequest as AptosWriteCreReportRequest, + type WriteCreReportRequestJson as AptosWriteCreReportRequestJson, +} from '@cre/generated-sdk/capabilities/blockchain/aptos/v1alpha/client_sdk_gen' + // EVM Capability export { ClientCapability as EVMClient, @@ -45,13 +54,20 @@ export { type SendRequester as HTTPSendRequester, } from '@cre/generated-sdk/capabilities/networking/http/v1alpha/client_sdk_gen' export { HTTPCapability } from '@cre/generated-sdk/capabilities/networking/http/v1alpha/http_sdk_gen' - // CRON Capability export { CronCapability } from '@cre/generated-sdk/capabilities/scheduler/cron/v1/cron_sdk_gen' - // Runtime -export type { NodeRuntime, Runtime } from '@cre/sdk/runtime' -export { handler } from '@cre/sdk/workflow' +export type { NodeRuntime, Runtime, TeeRuntime } from '@cre/sdk/runtime' +export type { + AnyTeeConstraint, + NitroBinding, + NitroRegion, + OneOfTees, + Region, + TeeBinding, + TeeConstraint, +} from '@cre/sdk/workflow' +export { handler, handlerInTee, NITRO_REGIONS, REGIONS } from '@cre/sdk/workflow' prepareRuntime() @@ -62,7 +78,9 @@ export const cre = { ConfidentialHTTPClient, HTTPClient, EVMClient, + AptosClient, SolanaClient, }, handler, + handlerInTee, } diff --git a/packages/cre-sdk/src/sdk/impl/runtime-impl.test.ts b/packages/cre-sdk/src/sdk/impl/runtime-impl.test.ts index 52fac1eb..d1d24a74 100644 --- a/packages/cre-sdk/src/sdk/impl/runtime-impl.test.ts +++ b/packages/cre-sdk/src/sdk/impl/runtime-impl.test.ts @@ -83,6 +83,7 @@ function createRuntimeHelpersMock(overrides: Partial = {}): Runt throw new Error('Method not implemented: sleep') }), log: mock(() => {}), + emitMetric: mock(() => true), } // Return a merged object with overrides taking precedence diff --git a/packages/cre-sdk/src/sdk/impl/runtime-impl.ts b/packages/cre-sdk/src/sdk/impl/runtime-impl.ts index 8198e416..32908f3a 100644 --- a/packages/cre-sdk/src/sdk/impl/runtime-impl.ts +++ b/packages/cre-sdk/src/sdk/impl/runtime-impl.ts @@ -1,4 +1,4 @@ -import { create, type Message } from '@bufbuild/protobuf' +import { create, type Message, toBinary } from '@bufbuild/protobuf' import type { GenMessage } from '@bufbuild/protobuf/codegenv2' import { type Any, anyPack, anyUnpack } from '@bufbuild/protobuf/wkt' import { deserializeErrorFromString } from '@cre/capabilities/errors' @@ -22,6 +22,10 @@ import { SimpleConsensusInputsSchema, } from '@cre/generated/sdk/v1alpha/sdk_pb' import type { Value as ProtoValue } from '@cre/generated/values/v1/values_pb' +import { + UserMetricType, + WorkflowUserMetricSchema, +} from '@cre/generated/workflows/v2/workflow_user_metric_pb' import { ConsensusCapability } from '@cre/generated-sdk/capabilities/internal/consensus/v1alpha/consensus_sdk_gen' import type { BaseRuntime, @@ -30,6 +34,7 @@ import type { ReportRequest, ReportRequestJson, Runtime, + TeeRuntime, } from '@cre/sdk' import type { Report } from '@cre/sdk/report' import { @@ -207,6 +212,29 @@ export class BaseRuntimeImpl implements BaseRuntime { log(message: string): void { this.helpers.log(message) } + + emitMetric( + name: string, + value: number, + type: MetricType, + labels?: Record, + ): boolean { + const metric = create(WorkflowUserMetricSchema, { + name, + value, + type: METRIC_TYPE_TO_PROTO[type], + labels: labels ?? {}, + }) + return this.helpers.emitMetric(toBinary(WorkflowUserMetricSchema, metric)) + } +} + +/** Ergonomic union for {@link BaseRuntimeImpl.emitMetric}. */ +export type MetricType = 'counter' | 'gauge' + +const METRIC_TYPE_TO_PROTO: Record = { + counter: UserMetricType.COUNTER, + gauge: UserMetricType.GAUGE, } /** @@ -435,6 +463,63 @@ export class RuntimeImpl extends BaseRuntimeImpl implements Runtime { } } +export class TeeRuntimeImpl implements TeeRuntime { + private readonly runtime: RuntimeImpl + constructor( + public config: C, + public nextCallId: number, + helpers: RuntimeHelpers, + maxResponseSize: bigint, + ) { + this.runtime = new RuntimeImpl(config, nextCallId, helpers, maxResponseSize) + } + getSecret(request: SecretRequest | SecretRequestJson): { result: () => Secret } { + return this.runtime.getSecret(request) + } + now(): Date { + return this.runtime.now() + } + + log(message: string): void { + this.runtime.log(message) + } + + emitMetric( + name: string, + value: number, + type: MetricType, + labels?: Record, + ): boolean { + return this.runtime.emitMetric(name, value, type, labels) + } + + callCapability({ + capabilityId, + method, + payload, + inputSchema, + outputSchema, + }: CallCapabilityParams): { result: () => O } { + return this.runtime.callCapability({ + capabilityId, + method, + payload, + inputSchema, + outputSchema, + }) + } + + reportFromDon(input: ReportRequest | ReportRequestJson): { + result: () => Report + } { + return this.runtime.report(input) + } + + usingTheDons(): Runtime { + return this.runtime + } +} + /** * Interface to the WASM host environment. * Provides low-level access to capabilities, secrets, and utilities. @@ -463,6 +548,12 @@ export interface RuntimeHelpers { /** Logs a message to the host environment. */ log(message: string): void + + /** + * Emits a user metric to the host. Payload is a protobuf-encoded + * `workflows.v2.WorkflowUserMetric`. Returns false if the host rejected it. + */ + emitMetric(payload: Uint8Array): boolean } function clearIgnoredFields(value: ProtoValue, descriptor: ConsensusDescriptor): void { diff --git a/packages/cre-sdk/src/sdk/runtime.ts b/packages/cre-sdk/src/sdk/runtime.ts index fd1c3be5..0ed965bb 100644 --- a/packages/cre-sdk/src/sdk/runtime.ts +++ b/packages/cre-sdk/src/sdk/runtime.ts @@ -1,11 +1,12 @@ import type { Message } from '@bufbuild/protobuf' import type { GenMessage } from '@bufbuild/protobuf/codegenv2' import type { ReportRequest, ReportRequestJson } from '@cre/generated/sdk/v1alpha/sdk_pb' +import type { MetricType } from '@cre/sdk/impl/runtime-impl' import type { Report } from '@cre/sdk/report' import type { ConsensusAggregation, PrimitiveTypes, UnwrapOptions } from '@cre/sdk/utils' import type { SecretsProvider } from '.' -export type { ReportRequest, ReportRequestJson } +export type { ReportRequest, ReportRequestJson, MetricType } export type CallCapabilityParams = { capabilityId: string @@ -30,6 +31,13 @@ export interface BaseRuntime { now(): Date log(message: string): void + + emitMetric( + name: string, + value: number, + type: MetricType, + labels?: Record, + ): boolean } /** @@ -39,6 +47,28 @@ export interface NodeRuntime extends BaseRuntime { readonly _isNodeRuntime: true } +/** + * Runtime for Tee mode execution. + */ +export interface TeeRuntime extends BaseRuntime, SecretsProvider { + /** + * Generates a report from the DON. + * Data requestsed throught this method will be routed outside of the TEE. + * + * @param input - Report request to generate a report from the DON + * @returns Report generated from the DON + */ + reportFromDon(input: ReportRequest | ReportRequestJson): { + result: () => Report + } + + /** + * Returns the runtime that makes requests to the CRE DONs. + * Requests made through this runtime will therefore be routed outside of the TEE + */ + usingTheDons(): Runtime +} + /** * Runtime for DON mode execution. */ diff --git a/packages/cre-sdk/src/sdk/tee-constraints.test.ts b/packages/cre-sdk/src/sdk/tee-constraints.test.ts new file mode 100644 index 00000000..7e04ea41 --- /dev/null +++ b/packages/cre-sdk/src/sdk/tee-constraints.test.ts @@ -0,0 +1,138 @@ +import { describe, expect, test } from 'bun:test' +import { create, toBinary } from '@bufbuild/protobuf' +import { + RegionsSchema, + RequirementsSchema, + TeeSchema, + TeeType, + TeeTypesAndRegionsSchema, +} from '@cre/generated/sdk/v1alpha/sdk_pb' +import { ZodError } from 'zod' +import type { TeeConstraint } from './tee-constraints' +import { buildTeeRequirements, teeConstraintSchema } from './tee-constraints' + +describe('teeConstraintSchema', () => { + test('accepts empty object (any tee)', () => { + expect(teeConstraintSchema.parse({})).toEqual({}) + }) + + test('accepts object with valid regions (any tee in regions)', () => { + expect(teeConstraintSchema.parse({ regions: ['us-west-2'] })).toEqual({ + regions: ['us-west-2'], + }) + }) + + test('accepts nitro binding with regions', () => { + expect(teeConstraintSchema.parse([{ tee: 'nitro', regions: ['us-west-2'] }])).toEqual([ + { tee: 'nitro', regions: ['us-west-2'] }, + ]) + }) + + test('accepts nitro binding without regions', () => { + expect(teeConstraintSchema.parse([{ tee: 'nitro' }])).toEqual([{ tee: 'nitro' }]) + }) + + test('rejects unknown region in anyTee form', () => { + expect(() => teeConstraintSchema.parse({ regions: ['mars-central-1'] })).toThrow(ZodError) + }) + + test('rejects unknown region in nitro binding', () => { + expect(() => teeConstraintSchema.parse([{ tee: 'nitro', regions: ['eu-central-1'] }])).toThrow( + ZodError, + ) + }) + + test('rejects unknown tee type', () => { + expect(() => teeConstraintSchema.parse([{ tee: 'sgx' }])).toThrow(ZodError) + }) + + test('rejects empty array', () => { + expect(() => teeConstraintSchema.parse([])).toThrow(ZodError) + }) + + test('rejects empty regions array in anyTee', () => { + expect(() => teeConstraintSchema.parse({ regions: [] })).toThrow(ZodError) + }) + + test('rejects empty regions array in nitro binding', () => { + expect(() => teeConstraintSchema.parse([{ tee: 'nitro', regions: [] }])).toThrow(ZodError) + }) + + test('rejects unknown fields in anyTee', () => { + expect(() => teeConstraintSchema.parse({ foo: 1 })).toThrow(ZodError) + }) + + test('rejects unknown fields in nitro binding', () => { + expect(() => teeConstraintSchema.parse([{ tee: 'nitro', extra: 1 }])).toThrow(ZodError) + }) + + test('rejects null', () => { + expect(() => teeConstraintSchema.parse(null)).toThrow(ZodError) + }) + + test('rejects bare string', () => { + expect(() => teeConstraintSchema.parse('any')).toThrow(ZodError) + }) +}) + +describe('buildTeeRequirements', () => { + test('anyTee produces anyRegions with empty regions', () => { + const result = buildTeeRequirements({}) + const expected = create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'anyRegions', + value: create(RegionsSchema, { regions: [] }), + }, + }), + }) + expect(toBinary(RequirementsSchema, result)).toEqual(toBinary(RequirementsSchema, expected)) + }) + + test('anyTeeInRegions produces anyRegions with specified regions', () => { + const result = buildTeeRequirements({ regions: ['us-west-2'] }) + const expected = create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'anyRegions', + value: create(RegionsSchema, { regions: ['us-west-2'] }), + }, + }), + }) + expect(toBinary(RequirementsSchema, result)).toEqual(toBinary(RequirementsSchema, expected)) + }) + + test('oneOfTees nitro with regions produces teeTypesAndRegions', () => { + const result = buildTeeRequirements([{ tee: 'nitro', regions: ['us-west-2'] }]) + const expected = create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'teeTypesAndRegions', + value: create(TeeTypesAndRegionsSchema, { + teeTypeAndRegions: [{ type: TeeType.AWS_NITRO, regions: ['us-west-2'] }], + }), + }, + }), + }) + expect(toBinary(RequirementsSchema, result)).toEqual(toBinary(RequirementsSchema, expected)) + }) + + test('oneOfTees nitro without regions produces teeTypesAndRegions with empty regions', () => { + const result = buildTeeRequirements([{ tee: 'nitro' }]) + const expected = create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'teeTypesAndRegions', + value: create(TeeTypesAndRegionsSchema, { + teeTypeAndRegions: [{ type: TeeType.AWS_NITRO, regions: [] }], + }), + }, + }), + }) + expect(toBinary(RequirementsSchema, result)).toEqual(toBinary(RequirementsSchema, expected)) + }) + + test('throws on invalid input', () => { + expect(() => buildTeeRequirements('bad' as unknown as TeeConstraint)).toThrow(ZodError) + }) +}) diff --git a/packages/cre-sdk/src/sdk/tee-constraints.ts b/packages/cre-sdk/src/sdk/tee-constraints.ts new file mode 100644 index 00000000..6d64fc5c --- /dev/null +++ b/packages/cre-sdk/src/sdk/tee-constraints.ts @@ -0,0 +1,91 @@ +import { create } from '@bufbuild/protobuf' +import type { Requirements } from '@cre/generated/sdk/v1alpha/sdk_pb' +import { + RegionsSchema, + RequirementsSchema, + TeeSchema, + TeeType, + TeeTypesAndRegionsSchema, +} from '@cre/generated/sdk/v1alpha/sdk_pb' +import { z } from 'zod' + +// --- Region schemas (source of truth) --- + +export const REGIONS = ['us-west-2'] as const +export const NITRO_REGIONS = ['us-west-2'] as const + +const regionSchema = z.enum(REGIONS, { + message: `unknown region; expected one of: ${REGIONS.join(', ')}`, +}) + +const nitroRegionSchema = z.enum(NITRO_REGIONS, { + message: `aws nitro does not support this region; expected one of: ${NITRO_REGIONS.join(', ')}`, +}) + +// --- TeeConstraint schemas (types inferred from these) --- + +const nitroBindingSchema = z + .object({ + tee: z.literal('nitro'), + regions: z.array(nitroRegionSchema).nonempty().optional(), + }) + .strict() + +const teeBindingSchema = z.discriminatedUnion('tee', [nitroBindingSchema]) + +const oneOfTeesSchema = z.array(teeBindingSchema).nonempty() + +const anyTeeConstraintSchema = z + .object({ + regions: z.array(regionSchema).nonempty().optional(), + }) + .strict() + +export const teeConstraintSchema = z.union([oneOfTeesSchema, anyTeeConstraintSchema]) + +// --- Inferred types --- + +export type Region = z.infer +export type NitroRegion = z.infer +export type NitroBinding = z.infer +export type TeeBinding = z.infer +export type OneOfTees = z.infer +export type AnyTeeConstraint = z.infer +export type TeeConstraint = z.infer + +// --- Conversion to protobuf Requirements --- + +export function buildTeeRequirements(input: TeeConstraint): Requirements { + const parsed = teeConstraintSchema.parse(input) + + if (Array.isArray(parsed)) { + const teeTypes = parsed.map((binding) => ({ + type: teeTypeFromBinding(binding), + regions: binding.regions ?? [], + })) + return create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'teeTypesAndRegions', + value: create(TeeTypesAndRegionsSchema, { teeTypeAndRegions: teeTypes }), + }, + }), + }) + } + + return create(RequirementsSchema, { + tee: create(TeeSchema, { + item: { + case: 'anyRegions', + value: create(RegionsSchema, { regions: parsed.regions ?? [] }), + }, + }), + }) +} + +function teeTypeFromBinding(binding: TeeBinding): TeeType { + switch (binding.tee) { + case 'nitro': + return TeeType.AWS_NITRO + } +} diff --git a/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/aptos/v1alpha/aptos_mock_gen.ts b/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/aptos/v1alpha/aptos_mock_gen.ts new file mode 100644 index 00000000..c5ef4fa3 --- /dev/null +++ b/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/aptos/v1alpha/aptos_mock_gen.ts @@ -0,0 +1,180 @@ +import { fromJson } from '@bufbuild/protobuf' +import { anyPack, anyUnpack } from '@bufbuild/protobuf/wkt' +import { + type AccountAPTBalanceReply, + type AccountAPTBalanceReplyJson, + AccountAPTBalanceReplySchema, + type AccountAPTBalanceRequest, + AccountAPTBalanceRequestSchema, + type AccountTransactionsReply, + type AccountTransactionsReplyJson, + AccountTransactionsReplySchema, + type AccountTransactionsRequest, + AccountTransactionsRequestSchema, + type TransactionByHashReply, + type TransactionByHashReplyJson, + TransactionByHashReplySchema, + type TransactionByHashRequest, + TransactionByHashRequestSchema, + type ViewReply, + type ViewReplyJson, + ViewReplySchema, + type ViewRequest, + ViewRequestSchema, + type WriteReportReply, + type WriteReportReplyJson, + WriteReportReplySchema, + type WriteReportRequest, + WriteReportRequestSchema, +} from '@cre/generated/capabilities/blockchain/aptos/v1alpha/client_pb' +import { + __getTestMockInstance, + __setTestMockInstance, + registerTestCapability, +} from '@cre/sdk/testutils/test-runtime' + +/** + * Mock for ClientCapability. Use testInstance() to obtain an instance; do not construct directly. + * Set per-method properties (e.g. performAction) to define return values. If a method is invoked without a handler set, an error is thrown. + */ +export class AptosMock { + static readonly CAPABILITY_ID = 'aptos@1.0.0' + + /** Set to define the return value for AccountAPTBalance. May return a plain object (AccountAPTBalanceReplyJson) or the message type. */ + accountAPTBalance?: ( + input: AccountAPTBalanceRequest, + ) => AccountAPTBalanceReply | AccountAPTBalanceReplyJson + + /** Set to define the return value for View. May return a plain object (ViewReplyJson) or the message type. */ + view?: (input: ViewRequest) => ViewReply | ViewReplyJson + + /** Set to define the return value for TransactionByHash. May return a plain object (TransactionByHashReplyJson) or the message type. */ + transactionByHash?: ( + input: TransactionByHashRequest, + ) => TransactionByHashReply | TransactionByHashReplyJson + + /** Set to define the return value for AccountTransactions. May return a plain object (AccountTransactionsReplyJson) or the message type. */ + accountTransactions?: ( + input: AccountTransactionsRequest, + ) => AccountTransactionsReply | AccountTransactionsReplyJson + + /** Set to define the return value for WriteReport. May return a plain object (WriteReportReplyJson) or the message type. */ + writeReport?: (input: WriteReportRequest) => WriteReportReply | WriteReportReplyJson + + private constructor(chainSelector: bigint) { + const self = this + const qualifiedId = `aptos:ChainSelector:${chainSelector}@1.0.0` + try { + registerTestCapability(qualifiedId, (req) => { + switch (req.method) { + case 'AccountAPTBalance': { + const input = anyUnpack( + req.payload, + AccountAPTBalanceRequestSchema, + ) as AccountAPTBalanceRequest + const handler = self.accountAPTBalance + if (typeof handler !== 'function') + throw new Error( + "AccountAPTBalance: no implementation provided; set the mock's accountAPTBalance property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as AccountAPTBalanceReply) + : fromJson(AccountAPTBalanceReplySchema, raw as AccountAPTBalanceReplyJson) + return { + response: { case: 'payload', value: anyPack(AccountAPTBalanceReplySchema, output) }, + } + } + case 'View': { + const input = anyUnpack(req.payload, ViewRequestSchema) as ViewRequest + const handler = self.view + if (typeof handler !== 'function') + throw new Error( + "View: no implementation provided; set the mock's view property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as ViewReply) + : fromJson(ViewReplySchema, raw as ViewReplyJson) + return { response: { case: 'payload', value: anyPack(ViewReplySchema, output) } } + } + case 'TransactionByHash': { + const input = anyUnpack( + req.payload, + TransactionByHashRequestSchema, + ) as TransactionByHashRequest + const handler = self.transactionByHash + if (typeof handler !== 'function') + throw new Error( + "TransactionByHash: no implementation provided; set the mock's transactionByHash property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as TransactionByHashReply) + : fromJson(TransactionByHashReplySchema, raw as TransactionByHashReplyJson) + return { + response: { case: 'payload', value: anyPack(TransactionByHashReplySchema, output) }, + } + } + case 'AccountTransactions': { + const input = anyUnpack( + req.payload, + AccountTransactionsRequestSchema, + ) as AccountTransactionsRequest + const handler = self.accountTransactions + if (typeof handler !== 'function') + throw new Error( + "AccountTransactions: no implementation provided; set the mock's accountTransactions property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as AccountTransactionsReply) + : fromJson(AccountTransactionsReplySchema, raw as AccountTransactionsReplyJson) + return { + response: { case: 'payload', value: anyPack(AccountTransactionsReplySchema, output) }, + } + } + case 'WriteReport': { + const input = anyUnpack(req.payload, WriteReportRequestSchema) as WriteReportRequest + const handler = self.writeReport + if (typeof handler !== 'function') + throw new Error( + "WriteReport: no implementation provided; set the mock's writeReport property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as WriteReportReply) + : fromJson(WriteReportReplySchema, raw as WriteReportReplyJson) + return { response: { case: 'payload', value: anyPack(WriteReportReplySchema, output) } } + } + default: + return { response: { case: 'error', value: `unknown method ${req.method}` } } + } + }) + } catch { + throw new Error( + "Capability mocks must be used within the CRE test framework's test() method.", + ) + } + } + + /** + * Returns the mock instance for this capability and the specified tags. + * Multiple calls with the same tag values return the same instance. + * Must be called within the test framework's test() method. + */ + static testInstance(chainSelector: bigint): AptosMock { + const qualifiedId = `aptos:ChainSelector:${chainSelector}@1.0.0` + let instance = __getTestMockInstance(qualifiedId) + if (!instance) { + instance = new AptosMock(chainSelector) + __setTestMockInstance(qualifiedId, instance) + } + return instance + } +} diff --git a/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/solana/v1alpha/solana_mock_gen.ts b/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/solana/v1alpha/solana_mock_gen.ts index ffaac3a2..0b8ba4bd 100644 --- a/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/solana/v1alpha/solana_mock_gen.ts +++ b/packages/cre-sdk/src/sdk/test/generated/capabilities/blockchain/solana/v1alpha/solana_mock_gen.ts @@ -1,6 +1,46 @@ import { fromJson } from '@bufbuild/protobuf' import { anyPack, anyUnpack } from '@bufbuild/protobuf/wkt' import { + type GetAccountInfoWithOptsReply, + type GetAccountInfoWithOptsReplyJson, + GetAccountInfoWithOptsReplySchema, + type GetAccountInfoWithOptsRequest, + GetAccountInfoWithOptsRequestSchema, + type GetBalanceReply, + type GetBalanceReplyJson, + GetBalanceReplySchema, + type GetBalanceRequest, + GetBalanceRequestSchema, + type GetBlockReply, + type GetBlockReplyJson, + GetBlockReplySchema, + type GetBlockRequest, + GetBlockRequestSchema, + type GetFeeForMessageReply, + type GetFeeForMessageReplyJson, + GetFeeForMessageReplySchema, + type GetFeeForMessageRequest, + GetFeeForMessageRequestSchema, + type GetMultipleAccountsWithOptsReply, + type GetMultipleAccountsWithOptsReplyJson, + GetMultipleAccountsWithOptsReplySchema, + type GetMultipleAccountsWithOptsRequest, + GetMultipleAccountsWithOptsRequestSchema, + type GetSignatureStatusesReply, + type GetSignatureStatusesReplyJson, + GetSignatureStatusesReplySchema, + type GetSignatureStatusesRequest, + GetSignatureStatusesRequestSchema, + type GetSlotHeightReply, + type GetSlotHeightReplyJson, + GetSlotHeightReplySchema, + type GetSlotHeightRequest, + GetSlotHeightRequestSchema, + type GetTransactionReply, + type GetTransactionReplyJson, + GetTransactionReplySchema, + type GetTransactionRequest, + GetTransactionRequestSchema, type WriteReportReply, type WriteReportReplyJson, WriteReportReplySchema, @@ -20,6 +60,38 @@ import { export class SolanaMock { static readonly CAPABILITY_ID = 'solana@1.0.0' + /** Set to define the return value for GetAccountInfoWithOpts. May return a plain object (GetAccountInfoWithOptsReplyJson) or the message type. */ + getAccountInfoWithOpts?: ( + input: GetAccountInfoWithOptsRequest, + ) => GetAccountInfoWithOptsReply | GetAccountInfoWithOptsReplyJson + + /** Set to define the return value for GetBalance. May return a plain object (GetBalanceReplyJson) or the message type. */ + getBalance?: (input: GetBalanceRequest) => GetBalanceReply | GetBalanceReplyJson + + /** Set to define the return value for GetBlock. May return a plain object (GetBlockReplyJson) or the message type. */ + getBlock?: (input: GetBlockRequest) => GetBlockReply | GetBlockReplyJson + + /** Set to define the return value for GetFeeForMessage. May return a plain object (GetFeeForMessageReplyJson) or the message type. */ + getFeeForMessage?: ( + input: GetFeeForMessageRequest, + ) => GetFeeForMessageReply | GetFeeForMessageReplyJson + + /** Set to define the return value for GetMultipleAccountsWithOpts. May return a plain object (GetMultipleAccountsWithOptsReplyJson) or the message type. */ + getMultipleAccountsWithOpts?: ( + input: GetMultipleAccountsWithOptsRequest, + ) => GetMultipleAccountsWithOptsReply | GetMultipleAccountsWithOptsReplyJson + + /** Set to define the return value for GetSignatureStatuses. May return a plain object (GetSignatureStatusesReplyJson) or the message type. */ + getSignatureStatuses?: ( + input: GetSignatureStatusesRequest, + ) => GetSignatureStatusesReply | GetSignatureStatusesReplyJson + + /** Set to define the return value for GetSlotHeight. May return a plain object (GetSlotHeightReplyJson) or the message type. */ + getSlotHeight?: (input: GetSlotHeightRequest) => GetSlotHeightReply | GetSlotHeightReplyJson + + /** Set to define the return value for GetTransaction. May return a plain object (GetTransactionReplyJson) or the message type. */ + getTransaction?: (input: GetTransactionRequest) => GetTransactionReply | GetTransactionReplyJson + /** Set to define the return value for WriteReport. May return a plain object (WriteReportReplyJson) or the message type. */ writeReport?: (input: WriteReportRequest) => WriteReportReply | WriteReportReplyJson @@ -29,6 +101,160 @@ export class SolanaMock { try { registerTestCapability(qualifiedId, (req) => { switch (req.method) { + case 'GetAccountInfoWithOpts': { + const input = anyUnpack( + req.payload, + GetAccountInfoWithOptsRequestSchema, + ) as GetAccountInfoWithOptsRequest + const handler = self.getAccountInfoWithOpts + if (typeof handler !== 'function') + throw new Error( + "GetAccountInfoWithOpts: no implementation provided; set the mock's getAccountInfoWithOpts property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetAccountInfoWithOptsReply) + : fromJson( + GetAccountInfoWithOptsReplySchema, + raw as GetAccountInfoWithOptsReplyJson, + ) + return { + response: { + case: 'payload', + value: anyPack(GetAccountInfoWithOptsReplySchema, output), + }, + } + } + case 'GetBalance': { + const input = anyUnpack(req.payload, GetBalanceRequestSchema) as GetBalanceRequest + const handler = self.getBalance + if (typeof handler !== 'function') + throw new Error( + "GetBalance: no implementation provided; set the mock's getBalance property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetBalanceReply) + : fromJson(GetBalanceReplySchema, raw as GetBalanceReplyJson) + return { response: { case: 'payload', value: anyPack(GetBalanceReplySchema, output) } } + } + case 'GetBlock': { + const input = anyUnpack(req.payload, GetBlockRequestSchema) as GetBlockRequest + const handler = self.getBlock + if (typeof handler !== 'function') + throw new Error( + "GetBlock: no implementation provided; set the mock's getBlock property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetBlockReply) + : fromJson(GetBlockReplySchema, raw as GetBlockReplyJson) + return { response: { case: 'payload', value: anyPack(GetBlockReplySchema, output) } } + } + case 'GetFeeForMessage': { + const input = anyUnpack( + req.payload, + GetFeeForMessageRequestSchema, + ) as GetFeeForMessageRequest + const handler = self.getFeeForMessage + if (typeof handler !== 'function') + throw new Error( + "GetFeeForMessage: no implementation provided; set the mock's getFeeForMessage property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetFeeForMessageReply) + : fromJson(GetFeeForMessageReplySchema, raw as GetFeeForMessageReplyJson) + return { + response: { case: 'payload', value: anyPack(GetFeeForMessageReplySchema, output) }, + } + } + case 'GetMultipleAccountsWithOpts': { + const input = anyUnpack( + req.payload, + GetMultipleAccountsWithOptsRequestSchema, + ) as GetMultipleAccountsWithOptsRequest + const handler = self.getMultipleAccountsWithOpts + if (typeof handler !== 'function') + throw new Error( + "GetMultipleAccountsWithOpts: no implementation provided; set the mock's getMultipleAccountsWithOpts property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetMultipleAccountsWithOptsReply) + : fromJson( + GetMultipleAccountsWithOptsReplySchema, + raw as GetMultipleAccountsWithOptsReplyJson, + ) + return { + response: { + case: 'payload', + value: anyPack(GetMultipleAccountsWithOptsReplySchema, output), + }, + } + } + case 'GetSignatureStatuses': { + const input = anyUnpack( + req.payload, + GetSignatureStatusesRequestSchema, + ) as GetSignatureStatusesRequest + const handler = self.getSignatureStatuses + if (typeof handler !== 'function') + throw new Error( + "GetSignatureStatuses: no implementation provided; set the mock's getSignatureStatuses property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetSignatureStatusesReply) + : fromJson(GetSignatureStatusesReplySchema, raw as GetSignatureStatusesReplyJson) + return { + response: { + case: 'payload', + value: anyPack(GetSignatureStatusesReplySchema, output), + }, + } + } + case 'GetSlotHeight': { + const input = anyUnpack(req.payload, GetSlotHeightRequestSchema) as GetSlotHeightRequest + const handler = self.getSlotHeight + if (typeof handler !== 'function') + throw new Error( + "GetSlotHeight: no implementation provided; set the mock's getSlotHeight property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetSlotHeightReply) + : fromJson(GetSlotHeightReplySchema, raw as GetSlotHeightReplyJson) + return { + response: { case: 'payload', value: anyPack(GetSlotHeightReplySchema, output) }, + } + } + case 'GetTransaction': { + const input = anyUnpack( + req.payload, + GetTransactionRequestSchema, + ) as GetTransactionRequest + const handler = self.getTransaction + if (typeof handler !== 'function') + throw new Error( + "GetTransaction: no implementation provided; set the mock's getTransaction property to define the return value.", + ) + const raw = handler(input) + const output = + raw && typeof (raw as unknown as { $typeName?: string }).$typeName === 'string' + ? (raw as GetTransactionReply) + : fromJson(GetTransactionReplySchema, raw as GetTransactionReplyJson) + return { + response: { case: 'payload', value: anyPack(GetTransactionReplySchema, output) }, + } + } case 'WriteReport': { const input = anyUnpack(req.payload, WriteReportRequestSchema) as WriteReportRequest const handler = self.writeReport diff --git a/packages/cre-sdk/src/sdk/test/generated/index.ts b/packages/cre-sdk/src/sdk/test/generated/index.ts index ebc62553..d95117fa 100644 --- a/packages/cre-sdk/src/sdk/test/generated/index.ts +++ b/packages/cre-sdk/src/sdk/test/generated/index.ts @@ -1,5 +1,6 @@ /** Auto-generated barrel of capability mocks. Do not edit. */ +export { AptosMock } from './capabilities/blockchain/aptos/v1alpha/aptos_mock_gen' export { EvmMock } from './capabilities/blockchain/evm/v1alpha/evm_mock_gen' export { SolanaMock } from './capabilities/blockchain/solana/v1alpha/solana_mock_gen' export { BasicTestActionTriggerMock } from './capabilities/internal/actionandtrigger/v1/basic_test_action_trigger_mock_gen' diff --git a/packages/cre-sdk/src/sdk/testutils/index.ts b/packages/cre-sdk/src/sdk/testutils/index.ts index 9d2d280f..22287c97 100644 --- a/packages/cre-sdk/src/sdk/testutils/index.ts +++ b/packages/cre-sdk/src/sdk/testutils/index.ts @@ -15,6 +15,7 @@ export { type Secrets, TestRuntime, type TestRuntimeState, + TestTeeRuntime, test, } from './test-runtime' export { TestWriter } from './test-writer' diff --git a/packages/cre-sdk/src/sdk/testutils/test-runtime.ts b/packages/cre-sdk/src/sdk/testutils/test-runtime.ts index bec7544a..260909eb 100644 --- a/packages/cre-sdk/src/sdk/testutils/test-runtime.ts +++ b/packages/cre-sdk/src/sdk/testutils/test-runtime.ts @@ -36,8 +36,9 @@ import { } from '@cre/generated/sdk/v1alpha/sdk_pb' import type { Value as ProtoValue } from '@cre/generated/values/v1/values_pb' import { ValueSchema } from '@cre/generated/values/v1/values_pb' +import type { WorkflowUserMetric } from '@cre/generated/workflows/v2/workflow_user_metric_pb' import type { RuntimeHelpers } from '../impl/runtime-impl' -import { RuntimeImpl } from '../impl/runtime-impl' +import { RuntimeImpl, TeeRuntimeImpl } from '../impl/runtime-impl' import { TestWriter } from './test-writer' /** Error message when response exceeds max size. Used by the harness when its await implements the size check. */ @@ -329,6 +330,11 @@ function createTestRuntimeHelpers( log(message: string): void { testWriter.log(message) }, + + emitMetric(payload: Uint8Array): boolean { + testWriter.emitMetric(payload) + return true + }, } } @@ -354,10 +360,11 @@ export function test(title: string, fn: () => void | Promise): void { /** * Creates a test runtime. This must be called from within a test in this package. */ -export function newTestRuntime( +export function newTestRuntime( secrets?: Secrets | null, options: NewTestRuntimeOptions = {}, -): TestRuntime { + config: T | undefined = undefined, +): TestRuntime { const secretsMap = secrets ?? new Map>() const testWriter = new TestWriter() const registry = registryStorage.getStore() ?? new Registry() @@ -399,21 +406,22 @@ export function newTestRuntime( const maxResponseSize = BigInt(configuredMaxResponseSize) const helpers = createTestRuntimeHelpers(registry, secretsMap, testWriter, state, maxResponseSize) - return new TestRuntime(helpers, maxResponseSize, testWriter, state) + return new TestRuntime(helpers, maxResponseSize, testWriter, state, config) } /** * TestRuntime is a Runtime implementation for unit tests. Extends RuntimeImpl; construct via newTestRuntime. * Adds getLogs() and setTimeProvider(). Registry is accessed via getTestCapabilityHandler when inside testWithRuntime. */ -export class TestRuntime extends RuntimeImpl { +export class TestRuntime extends RuntimeImpl { constructor( helpers: RuntimeHelpers, maxResponseSize: bigint, private readonly testWriter: TestWriter, private readonly state: TestRuntimeState, + config: T | undefined = undefined, ) { - super({}, 0, helpers, maxResponseSize) + super(config ?? ({} as T), 0, helpers, maxResponseSize) } getLogs(): string[] { @@ -424,3 +432,31 @@ export class TestRuntime extends RuntimeImpl { this.state.timeProvider = timeProvider } } + +/** + * TestTeeRuntime is a TeeRuntime implementation for unit tests. Extends TeeRuntimeImpl; construct via newTestTEERuntime. + * Adds getLogs() and setTimeProvider(). Registry is accessed via getTestCapabilityHandler when inside testWithRuntime. + */ +export class TestTeeRuntime extends TeeRuntimeImpl { + constructor( + helpers: RuntimeHelpers, + maxResponseSize: bigint, + private readonly testWriter: TestWriter, + private readonly state: TestRuntimeState, + config: T, + ) { + super(config, 0, helpers, maxResponseSize) + } + + getLogs(): string[] { + return this.testWriter.getLogs() + } + + getMetrics(): WorkflowUserMetric[] { + return this.testWriter.getMetrics() + } + + setTimeProvider(timeProvider: () => number): void { + this.state.timeProvider = timeProvider + } +} diff --git a/packages/cre-sdk/src/sdk/testutils/test-writer.ts b/packages/cre-sdk/src/sdk/testutils/test-writer.ts index 7c620b3c..2cc8068b 100644 --- a/packages/cre-sdk/src/sdk/testutils/test-writer.ts +++ b/packages/cre-sdk/src/sdk/testutils/test-writer.ts @@ -1,9 +1,16 @@ +import { fromBinary } from '@bufbuild/protobuf' +import { + type WorkflowUserMetric, + WorkflowUserMetricSchema, +} from '@cre/generated/workflows/v2/workflow_user_metric_pb' + /** * In-memory log sink for tests. Captures messages so tests can assert on log output. * Equivalent to Go's cre/testutils/test_writer.go. */ export class TestWriter { private logs: string[] = [] + private metrics: Uint8Array[] = [] /** Appends a message to the captured log buffer. */ log(message: string): void { @@ -15,8 +22,19 @@ export class TestWriter { return [...this.logs] } - /** Clears the captured log buffer. */ + /** Captures a serialized WorkflowUserMetric payload. */ + emitMetric(payload: Uint8Array): void { + this.metrics.push(payload) + } + + /** Returns captured metric payloads decoded as `WorkflowUserMetric` protos. */ + getMetrics(): WorkflowUserMetric[] { + return this.metrics.map((bytes) => fromBinary(WorkflowUserMetricSchema, bytes)) + } + + /** Clears captured logs and metrics. */ clear(): void { this.logs = [] + this.metrics = [] } } diff --git a/packages/cre-sdk/src/sdk/types/global.d.ts b/packages/cre-sdk/src/sdk/types/global.d.ts index 526a979d..24af3c08 100644 --- a/packages/cre-sdk/src/sdk/types/global.d.ts +++ b/packages/cre-sdk/src/sdk/types/global.d.ts @@ -45,6 +45,14 @@ declare global { */ function log(message: string): void + /** + * Emits a user metric to the host. The payload is a protobuf-encoded + * `workflows.v2.WorkflowUserMetric` message. + * @param payload - protobuf-encoded WorkflowUserMetric bytes + * @returns 0 on success, negative on error (rate-limited, oversized, invalid name, etc.) + */ + function emitMetric(payload: Uint8Array): number + /** * Sends a response back to the host * @param response - bytes response diff --git a/packages/cre-sdk/src/sdk/wasm/__snapshots__/host-bindings-contract.test.ts.snap b/packages/cre-sdk/src/sdk/wasm/__snapshots__/host-bindings-contract.test.ts.snap index 612d41f0..feb0a865 100644 --- a/packages/cre-sdk/src/sdk/wasm/__snapshots__/host-bindings-contract.test.ts.snap +++ b/packages/cre-sdk/src/sdk/wasm/__snapshots__/host-bindings-contract.test.ts.snap @@ -5,6 +5,7 @@ exports[`JS host bindings contract 1`] = ` "awaitCapabilities", "awaitSecrets", "callCapability", + "emitMetric", "getSecrets", "getWasiArgs", "log", diff --git a/packages/cre-sdk/src/sdk/wasm/host-bindings.ts b/packages/cre-sdk/src/sdk/wasm/host-bindings.ts index 70fc5e75..969d1726 100644 --- a/packages/cre-sdk/src/sdk/wasm/host-bindings.ts +++ b/packages/cre-sdk/src/sdk/wasm/host-bindings.ts @@ -28,6 +28,10 @@ export const globalHostBindingsSchema = z.object({ .returns(z.union([z.instanceof(Uint8Array), z.custom>()])), getWasiArgs: z.function().args().returns(z.string()), now: z.function().args().returns(z.number()), + emitMetric: z + .function() + .args(z.union([z.instanceof(Uint8Array), z.custom>()])) + .returns(z.number()), sleep: z.function().args(z.number()).returns(z.void()), }) diff --git a/packages/cre-sdk/src/sdk/wasm/runner.test.ts b/packages/cre-sdk/src/sdk/wasm/runner.test.ts index 4ff3edd7..a398de5b 100644 --- a/packages/cre-sdk/src/sdk/wasm/runner.test.ts +++ b/packages/cre-sdk/src/sdk/wasm/runner.test.ts @@ -13,9 +13,11 @@ import { type ExecutionResult, ExecutionResultSchema, GetSecretsRequestSchema, + RequirementsSchema, SecretResponseSchema, SecretResponsesSchema, SecretSchema, + TeeType, type Trigger, TriggerSchema, type TriggerSubscriptionRequest, @@ -23,6 +25,7 @@ import { import type { Value as ProtoValue } from '@cre/generated/values/v1/values_pb' import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' import { cre } from '@cre/sdk/cre' +import { handlerInTee } from '@cre/sdk/workflow' import { Value } from '../utils' import type { SecretsProvider } from '../workflow' import { Runner } from './runner' @@ -104,6 +107,9 @@ const proxyHostBindings = { now: () => { throw new Error('now called unexpectedly in test') }, + emitMetric: (_payload: Uint8Array) => { + throw new Error('emitMetric called unexpectedly in test') + }, sleep: () => { throw new Error('sleep called unexpectedly in test') }, @@ -309,13 +315,128 @@ describe('runner', () => { }) }) -function getTestRunner(request: ExecuteRequest): Promise> { +describe('handlerInTee', () => { + test('specified list sets requirements on subscription', async () => { + var sentResponse: ExecutionResult | null = null + mockHostBindings.sendResponse = mock((input) => { + sentResponse = fromBinary(ExecutionResultSchema, input) + return 0 + }) + const runner = await getTestRunner(subscribeRequest) + await runner.run(async (_: string, secretsProvider: SecretsProvider) => { + return [ + handlerInTee(basicTrigger.trigger({ name: 'foo', number: 10 }), (runtime, trigger) => 0, [ + { tee: 'nitro', regions: ['us-west-2'] }, + ]), + ] + }) + expect(sentResponse).toBeDefined() + expect(sentResponse!.result.case).toBe('triggerSubscriptions') + const subs = (sentResponse!.result.value as TriggerSubscriptionRequest).subscriptions + expect(subs.length).toBe(1) + const expected = create(RequirementsSchema, { + tee: { + item: { + case: 'teeTypesAndRegions', + value: { + teeTypeAndRegions: [{ type: TeeType.AWS_NITRO, regions: ['us-west-2'] }], + }, + }, + }, + }) + expect(toBinary(RequirementsSchema, subs[0].requirements!)).toEqual( + toBinary(RequirementsSchema, expected), + ) + }) + + test('any tee with regions sets requirements on subscription', async () => { + var sentResponse: ExecutionResult | null = null + mockHostBindings.sendResponse = mock((input) => { + sentResponse = fromBinary(ExecutionResultSchema, input) + return 0 + }) + const runner = await getTestRunner(subscribeRequest) + await runner.run(async (_: string, secretsProvider: SecretsProvider) => { + return [ + handlerInTee(basicTrigger.trigger({ name: 'foo', number: 10 }), (runtime, trigger) => 0, { + regions: ['us-west-2'], + }), + ] + }) + expect(sentResponse).toBeDefined() + expect(sentResponse!.result.case).toBe('triggerSubscriptions') + const subs = (sentResponse!.result.value as TriggerSubscriptionRequest).subscriptions + expect(subs.length).toBe(1) + const expected = create(RequirementsSchema, { + tee: { + item: { + case: 'anyRegions', + value: { regions: ['us-west-2'] }, + }, + }, + }) + expect(toBinary(RequirementsSchema, subs[0].requirements!)).toEqual( + toBinary(RequirementsSchema, expected), + ) + }) + + test('regular handler has no requirements on subscription', async () => { + var sentResponse: ExecutionResult | null = null + mockHostBindings.sendResponse = mock((input) => { + sentResponse = fromBinary(ExecutionResultSchema, input) + return 0 + }) + const runner = await getTestRunner(subscribeRequest) + await runner.run(async (_: string, secretsProvider: SecretsProvider) => { + return [cre.handler(basicTrigger.trigger({ name: 'foo', number: 10 }), () => 0)] + }) + expect(sentResponse).toBeDefined() + expect(sentResponse!.result.case).toBe('triggerSubscriptions') + const subs = (sentResponse!.result.value as TriggerSubscriptionRequest).subscriptions + expect(subs.length).toBe(1) + expect(subs[0].requirements).toBeUndefined() + }) + + test('tee handler callback receives TeeRuntime', async () => { + var sentResponse: ExecutionResult | null = null + mockHostBindings.sendResponse = mock((input) => { + sentResponse = fromBinary(ExecutionResultSchema, input) + return 0 + }) + const runner = await getTestRunner(anyExecuteRequest) + let callbackInvoked = false + await runner.run(async (_: string, secretsProvider: SecretsProvider) => { + return [ + handlerInTee( + basicTrigger.trigger({ name: 'foo', number: 10 }), + (runtime, trigger) => { + callbackInvoked = true + expect(runtime).toBeDefined() + // TeeRuntime has reportFromDon and usingTheDons; Runtime does not + expect(typeof (runtime as any).reportFromDon).toBe('function') + return 0 + }, + [{ tee: 'nitro', regions: ['us-west-2'] }], + ), + ] + }) + expect(callbackInvoked).toBe(true) + }) +}) + +function setupArgs(request: ExecuteRequest, preCheck?: () => void) { const serialized = toBinary(ExecuteRequestSchema, request) const encoded = Buffer.from(serialized).toString('base64') // Update the mock to return the specific request - mockHostBindings.getWasiArgs = mock(() => JSON.stringify(['program', encoded])) + mockHostBindings.getWasiArgs = mock(() => { + preCheck?.() + return JSON.stringify(['program', encoded]) + }) +} +function getTestRunner(request: ExecuteRequest): Promise> { + setupArgs(request) return Runner.newRunner({ configParser: (b) => { const stringConfig = Buffer.from(b).toString() diff --git a/packages/cre-sdk/src/sdk/wasm/runner.ts b/packages/cre-sdk/src/sdk/wasm/runner.ts index 35bec786..51c352ae 100644 --- a/packages/cre-sdk/src/sdk/wasm/runner.ts +++ b/packages/cre-sdk/src/sdk/wasm/runner.ts @@ -4,27 +4,30 @@ import { ExecuteRequestSchema, type ExecutionResult, ExecutionResultSchema, + type SecretRequest, + type SecretRequestJson, TriggerSubscriptionRequestSchema, } from '@cre/generated/sdk/v1alpha/sdk_pb' import { type ConfigHandlerParams, configHandler } from '@cre/sdk/utils/config' import type { SecretsProvider, Workflow } from '@cre/sdk/workflow' import { Value } from '../utils' import { hostBindings } from './host-bindings' -import { Runtime } from './runtime' +import { Runtime, TeeRuntime } from './runtime' -export class Runner { - private constructor( +class RunnerBase { + protected constructor( private readonly config: TConfig, private readonly request: ExecuteRequest, ) {} - static async newRunner( + protected static async newRunnerHelper( + newRunner: (config: TConfig, request: ExecuteRequest) => TRunner, configHandlerParams?: ConfigHandlerParams, - ): Promise> { + ): Promise { hostBindings.versionV2() - const request = Runner.getRequest() + const request = RunnerBase.getRequest() const config = await configHandler(request, configHandlerParams) - return new Runner(config, request) + return newRunner(config, request) } private static getRequest(): ExecuteRequest { @@ -61,11 +64,16 @@ export class Runner { ) { const runtime = new Runtime(this.config, 0, this.request.maxResponseSize) + // wrap runtime's getSecret so other methods cannot be used + const sp = { + getSecret: (request: SecretRequest | SecretRequestJson) => { + return runtime.getSecret(request) + }, + } + let result: Promise | ExecutionResult try { - const workflow = await initFn(this.config, { - getSecret: runtime.getSecret.bind(runtime), - }) + const workflow = await initFn(this.config, sp) switch (this.request.request.case) { case 'subscribe': @@ -90,7 +98,7 @@ export class Runner { hostBindings.sendResponse(toBinary(ExecutionResultSchema, awaitedResult)) } - async handleExecutionPhase( + async handleExecutionPhase( req: ExecuteRequest, workflow: Workflow, runtime: Runtime, @@ -137,8 +145,12 @@ export class Runner { const decoded = fromBinary(schema, payloadAny.value) const adapted = entry.trigger.adapt(decoded) + // If the handler has requirements (e.g. TEE), use TeeRuntime; otherwise use the default runtime. + const handlerRuntime = + entry.requirements != null ? new TeeRuntime(this.config, 0, req.maxResponseSize) : runtime + try { - const result = await entry.fn(runtime, adapted) + const result = await entry.fn(handlerRuntime as any, adapted) const wrapped = Value.wrap(result) return create(ExecutionResultSchema, { result: { case: 'value', value: wrapped.proto() }, @@ -169,11 +181,12 @@ export class Runner { }) } - // Build TriggerSubscriptionRequest from the workflow entries + // Build TriggerSubscriptionRequest from the workflow entries, including any per-handler requirements. const subscriptions = workflow.map((entry) => ({ id: entry.trigger.capabilityId(), method: entry.trigger.method(), payload: entry.trigger.configAsAny(), + requirements: entry.requirements, })) const subscriptionRequest = create(TriggerSubscriptionRequestSchema, { @@ -185,3 +198,18 @@ export class Runner { }) } } + +export class Runner extends RunnerBase { + private constructor(config: TConfig, request: ExecuteRequest) { + super(config, request) + } + + static async newRunner( + configHandlerParams?: ConfigHandlerParams, + ): Promise> { + return RunnerBase.newRunnerHelper( + (config, request) => new Runner(config, request), + configHandlerParams, + ) + } +} diff --git a/packages/cre-sdk/src/sdk/wasm/runtime.ts b/packages/cre-sdk/src/sdk/wasm/runtime.ts index eaeb927a..0ccc6516 100644 --- a/packages/cre-sdk/src/sdk/wasm/runtime.ts +++ b/packages/cre-sdk/src/sdk/wasm/runtime.ts @@ -14,7 +14,12 @@ import { GetSecretsRequestSchema, type Mode, } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { NodeRuntimeImpl, type RuntimeHelpers, RuntimeImpl } from '../impl/runtime-impl' +import { + NodeRuntimeImpl, + type RuntimeHelpers, + RuntimeImpl, + TeeRuntimeImpl, +} from '../impl/runtime-impl' import { hostBindings } from './host-bindings' export class Runtime extends RuntimeImpl { @@ -29,6 +34,12 @@ export class NodeRuntime extends NodeRuntimeImpl { } } +export class TeeRuntime extends TeeRuntimeImpl { + constructor(config: C, nextCallId: number, maxResponseSize: bigint) { + super(config, nextCallId, WasmRuntimeHelpers.getInstance(), maxResponseSize) + } +} + /** Convert bigint maxResponseSize to i32 for WASM host binding, with range validation. */ function toI32ResponseSize(maxResponseSize: bigint): number { if (maxResponseSize > 2147483647n || maxResponseSize < -2147483648n) { @@ -95,4 +106,8 @@ class WasmRuntimeHelpers implements RuntimeHelpers { log(message: string): void { hostBindings.log(message) } + + emitMetric(payload: Uint8Array): boolean { + return hostBindings.emitMetric(payload) >= 0 + } } diff --git a/packages/cre-sdk/src/sdk/workflow.ts b/packages/cre-sdk/src/sdk/workflow.ts index f033a784..f93cf74e 100644 --- a/packages/cre-sdk/src/sdk/workflow.ts +++ b/packages/cre-sdk/src/sdk/workflow.ts @@ -1,17 +1,35 @@ import type { Message } from '@bufbuild/protobuf' import type { - CapabilityResponse, + Requirements, Secret, SecretRequest, SecretRequestJson, } from '@cre/generated/sdk/v1alpha/sdk_pb' -import { type Runtime } from '@cre/sdk/runtime' +import type { Runtime, TeeRuntime } from '@cre/sdk/runtime' import type { Trigger } from '@cre/sdk/utils/triggers/trigger-interface' -import type { SecretsError } from './errors' import type { CreSerializable } from './utils' -export type HandlerFn = ( - runtime: Runtime, +export type { + AnyTeeConstraint, + NitroBinding, + NitroRegion, + OneOfTees, + Region, + TeeBinding, + TeeConstraint, +} from './tee-constraints' +export { + buildTeeRequirements, + NITRO_REGIONS, + REGIONS, + teeConstraintSchema, +} from './tee-constraints' + +import type { TeeConstraint } from './tee-constraints' +import { buildTeeRequirements } from './tee-constraints' + +export type HandlerFn> = ( + runtime: TRuntime, triggerOutput: TTriggerOutput, ) => Promise> | CreSerializable @@ -20,24 +38,42 @@ export interface HandlerEntry< TRawTriggerOutput extends Message, TTriggerOutput, TResult, + TRuntime = Runtime, > { trigger: Trigger - fn: HandlerFn + fn: HandlerFn + requirements?: Requirements } -export type Workflow = ReadonlyArray> +export type Workflow = ReadonlyArray> export const handler = < TRawTriggerOutput extends Message, TTriggerOutput, TConfig, TResult, + TRuntime = Runtime, +>( + trigger: Trigger, + fn: HandlerFn, +): HandlerEntry => ({ + trigger, + fn, +}) + +export const handlerInTee = < + TRawTriggerOutput extends Message, + TTriggerOutput, + TConfig, + TResult, >( trigger: Trigger, - fn: HandlerFn, -): HandlerEntry => ({ + fn: HandlerFn>, + tees: TeeConstraint, +): HandlerEntry> => ({ trigger, fn, + requirements: buildTeeRequirements(tees), }) export type SecretsProvider = { diff --git a/packages/cre-sdk/src/standard_tests/tee_runtime/test.ts b/packages/cre-sdk/src/standard_tests/tee_runtime/test.ts new file mode 100644 index 00000000..630b97e8 --- /dev/null +++ b/packages/cre-sdk/src/standard_tests/tee_runtime/test.ts @@ -0,0 +1,29 @@ +import type { Outputs } from '@cre/generated/capabilities/internal/basictrigger/v1/basic_trigger_pb' +import { BasicCapability as BasicTriggerCapability } from '@cre/generated-sdk/capabilities/internal/basictrigger/v1/basic_sdk_gen' +import { cre, type Runtime, type TeeRuntime } from '@cre/sdk/cre' +import { Runner } from '@cre/sdk/wasm' +import { handlerInTee } from '@cre/sdk/workflow' + +const teeTrigger = (_: TeeRuntime, __: Outputs) => 0 +const regularTrigger = (_: Runtime, __: Outputs) => 0 + +const initWorkflow = () => { + const basicTrigger = new BasicTriggerCapability() + return [ + handlerInTee(basicTrigger.trigger({ name: 'first-trigger', number: 100 }), teeTrigger, [ + { tee: 'nitro', regions: ['us-west-2'] }, + ]), + cre.handler(basicTrigger.trigger({ name: 'second-trigger', number: 200 }), regularTrigger), + ] +} + +export async function main() { + console.log(`TS workflow: standard test: config [${new Date().toISOString()}]`) + + const runner = await Runner.newRunner({ + configParser: (c: Uint8Array) => c, + }) + await runner.run(initWorkflow) +} + +await main() diff --git a/submodules/chainlink-protos b/submodules/chainlink-protos index 5f00275c..5168ac1b 160000 --- a/submodules/chainlink-protos +++ b/submodules/chainlink-protos @@ -1 +1 @@ -Subproject commit 5f00275cf10d7d590cad6caa74988d90630d7ca6 +Subproject commit 5168ac1ba014e5165f9ebe28cfcaef1365455d3b