@avaprotocol/sdk-js 2.7.5-dev.0 → 2.7.5-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +3 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +77 -57
- package/dist/index.mjs +77 -57
- package/dist/models/workflow.d.ts.map +1 -1
- package/dist/models/workflow.js +18 -11
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +0 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import Step from "./models/step";
|
|
|
7
7
|
import NodeFactory from "./models/node/factory";
|
|
8
8
|
import TriggerFactory from "./models/trigger/factory";
|
|
9
9
|
import Secret from "./models/secret";
|
|
10
|
-
import { ErrorCode, type WorkflowProps, type GetKeyResponse, type RequestOptions, type ClientOption, type SmartWallet, type GetWalletRequest, type GetExecutionsOptions, type GetWorkflowsOptions, type GetSignatureFormatResponse, type RunNodeWithInputsRequest, type RunNodeWithInputsResponse, type RunTriggerRequest, type RunTriggerResponse, type SecretProps, type PageInfo, type GetSecretsOptions, type SecretOptions, type TriggerDataProps, type SimulateWorkflowRequest, type ExecutionProps, type GetTokenMetadataRequest, type GetTokenMetadataResponse, type TimeoutConfig, type CreateSecretResponse, type UpdateSecretResponse, type DeleteSecretResponse, type CancelTaskResponse, type DeleteTaskResponse, type GetExecutionStatsResponse, type GetExecutionStatsOptions, ExecutionStatus, type TriggerWorkflowResponse, type WithdrawFundsRequest, type WithdrawFundsResponse
|
|
10
|
+
import { ErrorCode, type WorkflowProps, type GetKeyResponse, type RequestOptions, type ClientOption, type SmartWallet, type GetWalletRequest, type GetExecutionsOptions, type GetWorkflowsOptions, type GetSignatureFormatResponse, type RunNodeWithInputsRequest, type RunNodeWithInputsResponse, type RunTriggerRequest, type RunTriggerResponse, type SecretProps, type PageInfo, type GetSecretsOptions, type SecretOptions, type TriggerDataProps, type SimulateWorkflowRequest, type ExecutionProps, type GetTokenMetadataRequest, type GetTokenMetadataResponse, type TimeoutConfig, type CreateSecretResponse, type UpdateSecretResponse, type DeleteSecretResponse, type CancelTaskResponse, type DeleteTaskResponse, type GetExecutionStatsResponse, type GetExecutionStatsOptions, ExecutionStatus, type TriggerWorkflowResponse, type WithdrawFundsRequest, type WithdrawFundsResponse } from "@avaprotocol/types";
|
|
11
11
|
import { cleanGrpcErrorMessage } from "./utils";
|
|
12
12
|
declare class BaseClient {
|
|
13
13
|
readonly endpoint: string;
|
|
@@ -353,21 +353,8 @@ declare class Client extends BaseClient {
|
|
|
353
353
|
getTokenMetadata({ address }: GetTokenMetadataRequest, options?: RequestOptions): Promise<GetTokenMetadataResponse>;
|
|
354
354
|
/**
|
|
355
355
|
* Get comprehensive fee estimation for workflow deployment
|
|
356
|
-
*
|
|
357
|
-
*
|
|
358
|
-
* @param {TriggerProps} params.trigger - Trigger configuration for the workflow
|
|
359
|
-
* @param {NodeProps[]} params.nodes - Array of workflow nodes
|
|
360
|
-
* @param {string} [params.runner] - Runner address (smart wallet) - optional if in inputVariables
|
|
361
|
-
* @param {Record<string, any>} [params.inputVariables] - Input variables including workflowContext
|
|
362
|
-
* @param {number} params.createdAt - Workflow creation timestamp (milliseconds)
|
|
363
|
-
* @param {number} params.expireAt - Workflow expiration timestamp (milliseconds)
|
|
364
|
-
* @param {RequestOptions} options - Request options
|
|
365
|
-
* @returns {Promise<EstimateFeesResponse>} - Comprehensive fee breakdown with gas, automation, and creation costs
|
|
366
|
-
*/
|
|
367
|
-
estimateFees({ trigger, nodes, runner, inputVariables, createdAt, expireAt, }: EstimateFeesRequest, options?: RequestOptions): Promise<EstimateFeesResponse>;
|
|
368
|
-
/**
|
|
369
|
-
* Convert protobuf EstimateFeesResp to TypeScript EstimateFeesResponse
|
|
370
|
-
* @private
|
|
356
|
+
* TEMPORARILY DISABLED: Fee estimation types are not synchronized between branches
|
|
357
|
+
* TODO: Re-enable when types package includes fee estimation types
|
|
371
358
|
*/
|
|
372
359
|
private convertEstimateFeesResponse;
|
|
373
360
|
/**
|
|
@@ -390,6 +377,5 @@ export * from "./models/node/factory";
|
|
|
390
377
|
export * from "./models/trigger/factory";
|
|
391
378
|
export { Client, Workflow, Edge, Execution, Step, NodeFactory, TriggerFactory, Secret, ErrorCode, cleanGrpcErrorMessage, };
|
|
392
379
|
export type { TokenMetadata, GetTokenMetadataRequest, GetTokenMetadataResponse, TokenSource, WithdrawFundsRequest, WithdrawFundsResponse, } from "@avaprotocol/types";
|
|
393
|
-
export type { EstimateFeesRequest, EstimateFeesResponse, FeeAmount, GasFeeBreakdown, NodeGasFee, AutomationFee, AutomationFeeComponent, SmartWalletCreationFee, Discount, } from "@avaprotocol/types";
|
|
394
380
|
export { TimeoutPresets, type TimeoutConfig, type TimeoutError, } from "@avaprotocol/types";
|
|
395
381
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,QAAQ,EAAU,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,QAAQ,MAAM,mBAAmB,CAAC;AACzC,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAC3C,OAAO,IAAI,MAAM,eAAe,CAAC;AACjC,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,cAAc,MAAM,0BAA0B,CAAC;AACtD,OAAO,MAAM,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAOL,SAAS,EACT,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC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H,OAAO,CAAC,gBAAgB;CAQzB;AAED,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AAEzC,OAAO,EACL,MAAM,EACN,QAAQ,EACR,IAAI,EACJ,SAAS,EACT,IAAI,EACJ,WAAW,EACX,cAAc,EACd,MAAM,EACN,SAAS,EACT,qBAAqB,GACtB,CAAC;AAGF,YAAY,EACV,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,WAAW,EACX,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,oBAAoB,CAAC;AAM5B,OAAO,EACL,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18435,7 +18435,6 @@ function convertProtobufValueToJs(value) {
|
|
|
18435
18435
|
}
|
|
18436
18436
|
}
|
|
18437
18437
|
function convertJSValueToProtobuf(value) {
|
|
18438
|
-
console.log("\u{1F50D} [DEBUG] convertJSValueToProtobuf called with:", { value, type: typeof value });
|
|
18439
18438
|
const protobufValue = new import_struct_pb.Value();
|
|
18440
18439
|
if (value === null || value === void 0) {
|
|
18441
18440
|
protobufValue.setNullValue(0);
|
|
@@ -19917,6 +19916,13 @@ var Workflow = class _Workflow {
|
|
|
19917
19916
|
(node) => factory_default2.fromResponse(node)
|
|
19918
19917
|
);
|
|
19919
19918
|
const edges = import_lodash3.default.map(obj.getEdgesList(), (edge) => edge_default.fromResponse(edge));
|
|
19919
|
+
const inputVariables = {};
|
|
19920
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
19921
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
19922
|
+
inputVarsMap.forEach((value, key) => {
|
|
19923
|
+
inputVariables[key] = value.toJavaScript();
|
|
19924
|
+
});
|
|
19925
|
+
}
|
|
19920
19926
|
const workflow = new _Workflow({
|
|
19921
19927
|
id: obj.getId(),
|
|
19922
19928
|
owner: obj.getOwner(),
|
|
@@ -19931,7 +19937,8 @@ var Workflow = class _Workflow {
|
|
|
19931
19937
|
name: obj.getName(),
|
|
19932
19938
|
status: convertStatusToString(obj.getStatus()),
|
|
19933
19939
|
completedAt: obj.getCompletedAt(),
|
|
19934
|
-
lastRanAt: obj.getLastRanAt()
|
|
19940
|
+
lastRanAt: obj.getLastRanAt(),
|
|
19941
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : void 0
|
|
19935
19942
|
});
|
|
19936
19943
|
return workflow;
|
|
19937
19944
|
}
|
|
@@ -19944,6 +19951,13 @@ var Workflow = class _Workflow {
|
|
|
19944
19951
|
if (!trigger) {
|
|
19945
19952
|
throw new Error("Trigger is undefined in fromListResponse()");
|
|
19946
19953
|
}
|
|
19954
|
+
const inputVariables = {};
|
|
19955
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
19956
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
19957
|
+
inputVarsMap.forEach((value, key) => {
|
|
19958
|
+
inputVariables[key] = value.toJavaScript();
|
|
19959
|
+
});
|
|
19960
|
+
}
|
|
19947
19961
|
return new _Workflow({
|
|
19948
19962
|
id: obj.getId(),
|
|
19949
19963
|
owner: obj.getOwner(),
|
|
@@ -19958,7 +19972,8 @@ var Workflow = class _Workflow {
|
|
|
19958
19972
|
completedAt: obj.getCompletedAt(),
|
|
19959
19973
|
status: convertStatusToString(obj.getStatus()),
|
|
19960
19974
|
name: obj.getName(),
|
|
19961
|
-
lastRanAt: obj.getLastRanAt()
|
|
19975
|
+
lastRanAt: obj.getLastRanAt(),
|
|
19976
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : void 0
|
|
19962
19977
|
});
|
|
19963
19978
|
}
|
|
19964
19979
|
toRequest() {
|
|
@@ -20001,21 +20016,11 @@ var Workflow = class _Workflow {
|
|
|
20001
20016
|
if (this.name) {
|
|
20002
20017
|
request.setName(this.name);
|
|
20003
20018
|
}
|
|
20004
|
-
console.log("\u{1F50D} [DEBUG] Workflow.toRequest() inputVariables check:", {
|
|
20005
|
-
hasInputVariables: !!this.inputVariables,
|
|
20006
|
-
inputVariables: this.inputVariables,
|
|
20007
|
-
inputVariablesType: typeof this.inputVariables,
|
|
20008
|
-
inputVariablesKeys: this.inputVariables ? Object.keys(this.inputVariables) : []
|
|
20009
|
-
});
|
|
20010
20019
|
if (this.inputVariables) {
|
|
20011
20020
|
const inputVarsMap = request.getInputVariablesMap();
|
|
20012
20021
|
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
20013
|
-
console.log("\u{1F50D} [DEBUG] Converting inputVariable:", { key, value, valueType: typeof value });
|
|
20014
20022
|
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
20015
20023
|
}
|
|
20016
|
-
console.log("\u{1F50D} [DEBUG] Final inputVarsMap size:", inputVarsMap.getLength());
|
|
20017
|
-
} else {
|
|
20018
|
-
console.log("\u{1F50D} [DEBUG] No inputVariables to add to request");
|
|
20019
20024
|
}
|
|
20020
20025
|
return request;
|
|
20021
20026
|
}
|
|
@@ -21381,51 +21386,66 @@ var Client = class extends BaseClient {
|
|
|
21381
21386
|
}
|
|
21382
21387
|
/**
|
|
21383
21388
|
* Get comprehensive fee estimation for workflow deployment
|
|
21384
|
-
*
|
|
21385
|
-
*
|
|
21386
|
-
* @param {TriggerProps} params.trigger - Trigger configuration for the workflow
|
|
21387
|
-
* @param {NodeProps[]} params.nodes - Array of workflow nodes
|
|
21388
|
-
* @param {string} [params.runner] - Runner address (smart wallet) - optional if in inputVariables
|
|
21389
|
-
* @param {Record<string, any>} [params.inputVariables] - Input variables including workflowContext
|
|
21390
|
-
* @param {number} params.createdAt - Workflow creation timestamp (milliseconds)
|
|
21391
|
-
* @param {number} params.expireAt - Workflow expiration timestamp (milliseconds)
|
|
21392
|
-
* @param {RequestOptions} options - Request options
|
|
21393
|
-
* @returns {Promise<EstimateFeesResponse>} - Comprehensive fee breakdown with gas, automation, and creation costs
|
|
21394
|
-
*/
|
|
21395
|
-
async estimateFees({
|
|
21396
|
-
trigger,
|
|
21397
|
-
nodes,
|
|
21398
|
-
runner,
|
|
21399
|
-
inputVariables = {},
|
|
21400
|
-
createdAt,
|
|
21401
|
-
expireAt
|
|
21402
|
-
}, options) {
|
|
21403
|
-
const request = new avs_pb23.EstimateFeesReq();
|
|
21404
|
-
const triggerSdk = factory_default.create(trigger);
|
|
21405
|
-
request.setTrigger(triggerSdk.toRequest());
|
|
21406
|
-
const nodeMessages = nodes.map((node) => {
|
|
21407
|
-
const nodeSdk = factory_default2.create(node);
|
|
21408
|
-
return nodeSdk.toRequest();
|
|
21409
|
-
});
|
|
21410
|
-
request.setNodesList(nodeMessages);
|
|
21411
|
-
if (runner) {
|
|
21412
|
-
request.setRunner(runner);
|
|
21413
|
-
}
|
|
21414
|
-
if (inputVariables && Object.keys(inputVariables).length > 0) {
|
|
21415
|
-
const inputVarsMap = request.getInputVariablesMap();
|
|
21416
|
-
for (const [key, value] of Object.entries(inputVariables)) {
|
|
21417
|
-
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
21418
|
-
}
|
|
21419
|
-
}
|
|
21420
|
-
request.setCreatedAt(createdAt);
|
|
21421
|
-
request.setExpireAt(expireAt);
|
|
21422
|
-
const result = await this.sendGrpcRequest("estimateFees", request, options);
|
|
21423
|
-
return this.convertEstimateFeesResponse(result);
|
|
21424
|
-
}
|
|
21425
|
-
/**
|
|
21426
|
-
* Convert protobuf EstimateFeesResp to TypeScript EstimateFeesResponse
|
|
21427
|
-
* @private
|
|
21389
|
+
* TEMPORARILY DISABLED: Fee estimation types are not synchronized between branches
|
|
21390
|
+
* TODO: Re-enable when types package includes fee estimation types
|
|
21428
21391
|
*/
|
|
21392
|
+
/*
|
|
21393
|
+
async estimateFees(
|
|
21394
|
+
{
|
|
21395
|
+
trigger,
|
|
21396
|
+
nodes,
|
|
21397
|
+
runner,
|
|
21398
|
+
inputVariables = {},
|
|
21399
|
+
createdAt,
|
|
21400
|
+
expireAt,
|
|
21401
|
+
}: EstimateFeesRequest,
|
|
21402
|
+
options?: RequestOptions
|
|
21403
|
+
): Promise<EstimateFeesResponse> {
|
|
21404
|
+
// Create the protobuf request
|
|
21405
|
+
const request = new avs_pb.EstimateFeesReq();
|
|
21406
|
+
|
|
21407
|
+
// Convert trigger to protobuf
|
|
21408
|
+
const triggerSdk = TriggerFactory.create(trigger as any);
|
|
21409
|
+
request.setTrigger(triggerSdk.toRequest());
|
|
21410
|
+
|
|
21411
|
+
// Convert nodes to protobuf
|
|
21412
|
+
const nodeMessages = nodes.map((node: any) => {
|
|
21413
|
+
const nodeSdk = NodeFactory.create(node as any);
|
|
21414
|
+
return nodeSdk.toRequest();
|
|
21415
|
+
});
|
|
21416
|
+
request.setNodesList(nodeMessages);
|
|
21417
|
+
|
|
21418
|
+
// Set runner if provided
|
|
21419
|
+
if (runner) {
|
|
21420
|
+
request.setRunner(runner);
|
|
21421
|
+
}
|
|
21422
|
+
|
|
21423
|
+
// Set input variables
|
|
21424
|
+
if (inputVariables && Object.keys(inputVariables).length > 0) {
|
|
21425
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
21426
|
+
for (const [key, value] of Object.entries(inputVariables)) {
|
|
21427
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
21428
|
+
}
|
|
21429
|
+
}
|
|
21430
|
+
|
|
21431
|
+
// Set timestamps
|
|
21432
|
+
request.setCreatedAt(createdAt);
|
|
21433
|
+
request.setExpireAt(expireAt);
|
|
21434
|
+
|
|
21435
|
+
// Send the request
|
|
21436
|
+
const result = await this.sendGrpcRequest<
|
|
21437
|
+
avs_pb.EstimateFeesResp,
|
|
21438
|
+
avs_pb.EstimateFeesReq
|
|
21439
|
+
>("estimateFees", request, options);
|
|
21440
|
+
|
|
21441
|
+
// Convert protobuf response to TypeScript interface
|
|
21442
|
+
return this.convertEstimateFeesResponse(result);
|
|
21443
|
+
}
|
|
21444
|
+
|
|
21445
|
+
/**
|
|
21446
|
+
* Convert protobuf EstimateFeesResp to TypeScript EstimateFeesResponse
|
|
21447
|
+
* @private
|
|
21448
|
+
*/
|
|
21429
21449
|
convertEstimateFeesResponse(result) {
|
|
21430
21450
|
const response = {
|
|
21431
21451
|
success: result.getSuccess(),
|
package/dist/index.mjs
CHANGED
|
@@ -18414,7 +18414,6 @@ function convertProtobufValueToJs(value) {
|
|
|
18414
18414
|
}
|
|
18415
18415
|
}
|
|
18416
18416
|
function convertJSValueToProtobuf(value) {
|
|
18417
|
-
console.log("\u{1F50D} [DEBUG] convertJSValueToProtobuf called with:", { value, type: typeof value });
|
|
18418
18417
|
const protobufValue = new ProtobufValue();
|
|
18419
18418
|
if (value === null || value === void 0) {
|
|
18420
18419
|
protobufValue.setNullValue(0);
|
|
@@ -19923,6 +19922,13 @@ var Workflow = class _Workflow {
|
|
|
19923
19922
|
(node) => factory_default2.fromResponse(node)
|
|
19924
19923
|
);
|
|
19925
19924
|
const edges = _3.map(obj.getEdgesList(), (edge) => edge_default.fromResponse(edge));
|
|
19925
|
+
const inputVariables = {};
|
|
19926
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
19927
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
19928
|
+
inputVarsMap.forEach((value, key) => {
|
|
19929
|
+
inputVariables[key] = value.toJavaScript();
|
|
19930
|
+
});
|
|
19931
|
+
}
|
|
19926
19932
|
const workflow = new _Workflow({
|
|
19927
19933
|
id: obj.getId(),
|
|
19928
19934
|
owner: obj.getOwner(),
|
|
@@ -19937,7 +19943,8 @@ var Workflow = class _Workflow {
|
|
|
19937
19943
|
name: obj.getName(),
|
|
19938
19944
|
status: convertStatusToString(obj.getStatus()),
|
|
19939
19945
|
completedAt: obj.getCompletedAt(),
|
|
19940
|
-
lastRanAt: obj.getLastRanAt()
|
|
19946
|
+
lastRanAt: obj.getLastRanAt(),
|
|
19947
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : void 0
|
|
19941
19948
|
});
|
|
19942
19949
|
return workflow;
|
|
19943
19950
|
}
|
|
@@ -19950,6 +19957,13 @@ var Workflow = class _Workflow {
|
|
|
19950
19957
|
if (!trigger) {
|
|
19951
19958
|
throw new Error("Trigger is undefined in fromListResponse()");
|
|
19952
19959
|
}
|
|
19960
|
+
const inputVariables = {};
|
|
19961
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
19962
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
19963
|
+
inputVarsMap.forEach((value, key) => {
|
|
19964
|
+
inputVariables[key] = value.toJavaScript();
|
|
19965
|
+
});
|
|
19966
|
+
}
|
|
19953
19967
|
return new _Workflow({
|
|
19954
19968
|
id: obj.getId(),
|
|
19955
19969
|
owner: obj.getOwner(),
|
|
@@ -19964,7 +19978,8 @@ var Workflow = class _Workflow {
|
|
|
19964
19978
|
completedAt: obj.getCompletedAt(),
|
|
19965
19979
|
status: convertStatusToString(obj.getStatus()),
|
|
19966
19980
|
name: obj.getName(),
|
|
19967
|
-
lastRanAt: obj.getLastRanAt()
|
|
19981
|
+
lastRanAt: obj.getLastRanAt(),
|
|
19982
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : void 0
|
|
19968
19983
|
});
|
|
19969
19984
|
}
|
|
19970
19985
|
toRequest() {
|
|
@@ -20007,21 +20022,11 @@ var Workflow = class _Workflow {
|
|
|
20007
20022
|
if (this.name) {
|
|
20008
20023
|
request.setName(this.name);
|
|
20009
20024
|
}
|
|
20010
|
-
console.log("\u{1F50D} [DEBUG] Workflow.toRequest() inputVariables check:", {
|
|
20011
|
-
hasInputVariables: !!this.inputVariables,
|
|
20012
|
-
inputVariables: this.inputVariables,
|
|
20013
|
-
inputVariablesType: typeof this.inputVariables,
|
|
20014
|
-
inputVariablesKeys: this.inputVariables ? Object.keys(this.inputVariables) : []
|
|
20015
|
-
});
|
|
20016
20025
|
if (this.inputVariables) {
|
|
20017
20026
|
const inputVarsMap = request.getInputVariablesMap();
|
|
20018
20027
|
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
20019
|
-
console.log("\u{1F50D} [DEBUG] Converting inputVariable:", { key, value, valueType: typeof value });
|
|
20020
20028
|
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
20021
20029
|
}
|
|
20022
|
-
console.log("\u{1F50D} [DEBUG] Final inputVarsMap size:", inputVarsMap.getLength());
|
|
20023
|
-
} else {
|
|
20024
|
-
console.log("\u{1F50D} [DEBUG] No inputVariables to add to request");
|
|
20025
20030
|
}
|
|
20026
20031
|
return request;
|
|
20027
20032
|
}
|
|
@@ -21399,51 +21404,66 @@ var Client = class extends BaseClient {
|
|
|
21399
21404
|
}
|
|
21400
21405
|
/**
|
|
21401
21406
|
* Get comprehensive fee estimation for workflow deployment
|
|
21402
|
-
*
|
|
21403
|
-
*
|
|
21404
|
-
* @param {TriggerProps} params.trigger - Trigger configuration for the workflow
|
|
21405
|
-
* @param {NodeProps[]} params.nodes - Array of workflow nodes
|
|
21406
|
-
* @param {string} [params.runner] - Runner address (smart wallet) - optional if in inputVariables
|
|
21407
|
-
* @param {Record<string, any>} [params.inputVariables] - Input variables including workflowContext
|
|
21408
|
-
* @param {number} params.createdAt - Workflow creation timestamp (milliseconds)
|
|
21409
|
-
* @param {number} params.expireAt - Workflow expiration timestamp (milliseconds)
|
|
21410
|
-
* @param {RequestOptions} options - Request options
|
|
21411
|
-
* @returns {Promise<EstimateFeesResponse>} - Comprehensive fee breakdown with gas, automation, and creation costs
|
|
21412
|
-
*/
|
|
21413
|
-
async estimateFees({
|
|
21414
|
-
trigger,
|
|
21415
|
-
nodes,
|
|
21416
|
-
runner,
|
|
21417
|
-
inputVariables = {},
|
|
21418
|
-
createdAt,
|
|
21419
|
-
expireAt
|
|
21420
|
-
}, options) {
|
|
21421
|
-
const request = new avs_pb23.EstimateFeesReq();
|
|
21422
|
-
const triggerSdk = factory_default.create(trigger);
|
|
21423
|
-
request.setTrigger(triggerSdk.toRequest());
|
|
21424
|
-
const nodeMessages = nodes.map((node) => {
|
|
21425
|
-
const nodeSdk = factory_default2.create(node);
|
|
21426
|
-
return nodeSdk.toRequest();
|
|
21427
|
-
});
|
|
21428
|
-
request.setNodesList(nodeMessages);
|
|
21429
|
-
if (runner) {
|
|
21430
|
-
request.setRunner(runner);
|
|
21431
|
-
}
|
|
21432
|
-
if (inputVariables && Object.keys(inputVariables).length > 0) {
|
|
21433
|
-
const inputVarsMap = request.getInputVariablesMap();
|
|
21434
|
-
for (const [key, value] of Object.entries(inputVariables)) {
|
|
21435
|
-
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
21436
|
-
}
|
|
21437
|
-
}
|
|
21438
|
-
request.setCreatedAt(createdAt);
|
|
21439
|
-
request.setExpireAt(expireAt);
|
|
21440
|
-
const result = await this.sendGrpcRequest("estimateFees", request, options);
|
|
21441
|
-
return this.convertEstimateFeesResponse(result);
|
|
21442
|
-
}
|
|
21443
|
-
/**
|
|
21444
|
-
* Convert protobuf EstimateFeesResp to TypeScript EstimateFeesResponse
|
|
21445
|
-
* @private
|
|
21407
|
+
* TEMPORARILY DISABLED: Fee estimation types are not synchronized between branches
|
|
21408
|
+
* TODO: Re-enable when types package includes fee estimation types
|
|
21446
21409
|
*/
|
|
21410
|
+
/*
|
|
21411
|
+
async estimateFees(
|
|
21412
|
+
{
|
|
21413
|
+
trigger,
|
|
21414
|
+
nodes,
|
|
21415
|
+
runner,
|
|
21416
|
+
inputVariables = {},
|
|
21417
|
+
createdAt,
|
|
21418
|
+
expireAt,
|
|
21419
|
+
}: EstimateFeesRequest,
|
|
21420
|
+
options?: RequestOptions
|
|
21421
|
+
): Promise<EstimateFeesResponse> {
|
|
21422
|
+
// Create the protobuf request
|
|
21423
|
+
const request = new avs_pb.EstimateFeesReq();
|
|
21424
|
+
|
|
21425
|
+
// Convert trigger to protobuf
|
|
21426
|
+
const triggerSdk = TriggerFactory.create(trigger as any);
|
|
21427
|
+
request.setTrigger(triggerSdk.toRequest());
|
|
21428
|
+
|
|
21429
|
+
// Convert nodes to protobuf
|
|
21430
|
+
const nodeMessages = nodes.map((node: any) => {
|
|
21431
|
+
const nodeSdk = NodeFactory.create(node as any);
|
|
21432
|
+
return nodeSdk.toRequest();
|
|
21433
|
+
});
|
|
21434
|
+
request.setNodesList(nodeMessages);
|
|
21435
|
+
|
|
21436
|
+
// Set runner if provided
|
|
21437
|
+
if (runner) {
|
|
21438
|
+
request.setRunner(runner);
|
|
21439
|
+
}
|
|
21440
|
+
|
|
21441
|
+
// Set input variables
|
|
21442
|
+
if (inputVariables && Object.keys(inputVariables).length > 0) {
|
|
21443
|
+
const inputVarsMap = request.getInputVariablesMap();
|
|
21444
|
+
for (const [key, value] of Object.entries(inputVariables)) {
|
|
21445
|
+
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
21446
|
+
}
|
|
21447
|
+
}
|
|
21448
|
+
|
|
21449
|
+
// Set timestamps
|
|
21450
|
+
request.setCreatedAt(createdAt);
|
|
21451
|
+
request.setExpireAt(expireAt);
|
|
21452
|
+
|
|
21453
|
+
// Send the request
|
|
21454
|
+
const result = await this.sendGrpcRequest<
|
|
21455
|
+
avs_pb.EstimateFeesResp,
|
|
21456
|
+
avs_pb.EstimateFeesReq
|
|
21457
|
+
>("estimateFees", request, options);
|
|
21458
|
+
|
|
21459
|
+
// Convert protobuf response to TypeScript interface
|
|
21460
|
+
return this.convertEstimateFeesResponse(result);
|
|
21461
|
+
}
|
|
21462
|
+
|
|
21463
|
+
/**
|
|
21464
|
+
* Convert protobuf EstimateFeesResp to TypeScript EstimateFeesResponse
|
|
21465
|
+
* @private
|
|
21466
|
+
*/
|
|
21447
21467
|
convertEstimateFeesResponse(result) {
|
|
21448
21468
|
const response = {
|
|
21449
21469
|
success: result.getSuccess(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow.d.ts","sourceRoot":"","sources":["../../src/models/workflow.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,uBAAuB,CAAC;AAChD,OAAO,IAAI,MAAM,kBAAkB,CAAC;AACpC,O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AAc,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAInF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,CAAC,UAAU,GACxB,cAAc,CAUhB;AAED,cAAM,QAAS,YAAW,aAAa;IACrC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,KAAK,EAAE,IAAI,EAAE,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IAGrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;;OAGG;gBACS,KAAK,EAAE,aAAa;IAwBhC;;;;OAIG;IACH,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IA4C/C;;;OAGG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,GAAG,QAAQ;IAmCnD,SAAS,IAAI,MAAM,CAAC,aAAa;IA8DjC;;;OAGG;IACH,MAAM,IAAI,aAAa;CAmBxB;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/models/workflow.js
CHANGED
|
@@ -55,6 +55,14 @@ class Workflow {
|
|
|
55
55
|
}
|
|
56
56
|
const nodes = _.map(obj.getNodesList(), (node) => NodeFactory.fromResponse(node));
|
|
57
57
|
const edges = _.map(obj.getEdgesList(), (edge) => Edge.fromResponse(edge));
|
|
58
|
+
// Convert inputVariables from protobuf map back to JavaScript object
|
|
59
|
+
const inputVariables = {};
|
|
60
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
61
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
62
|
+
inputVarsMap.forEach((value, key) => {
|
|
63
|
+
inputVariables[key] = value.toJavaScript();
|
|
64
|
+
});
|
|
65
|
+
}
|
|
58
66
|
const workflow = new Workflow({
|
|
59
67
|
id: obj.getId(),
|
|
60
68
|
owner: obj.getOwner(),
|
|
@@ -70,6 +78,7 @@ class Workflow {
|
|
|
70
78
|
status: convertStatusToString(obj.getStatus()),
|
|
71
79
|
completedAt: obj.getCompletedAt(),
|
|
72
80
|
lastRanAt: obj.getLastRanAt(),
|
|
81
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : undefined,
|
|
73
82
|
});
|
|
74
83
|
return workflow;
|
|
75
84
|
}
|
|
@@ -82,6 +91,14 @@ class Workflow {
|
|
|
82
91
|
if (!trigger) {
|
|
83
92
|
throw new Error("Trigger is undefined in fromListResponse()");
|
|
84
93
|
}
|
|
94
|
+
// Convert inputVariables from protobuf map back to JavaScript object
|
|
95
|
+
const inputVariables = {};
|
|
96
|
+
const inputVarsMap = obj.getInputVariablesMap();
|
|
97
|
+
if (inputVarsMap && inputVarsMap.getLength() > 0) {
|
|
98
|
+
inputVarsMap.forEach((value, key) => {
|
|
99
|
+
inputVariables[key] = value.toJavaScript();
|
|
100
|
+
});
|
|
101
|
+
}
|
|
85
102
|
return new Workflow({
|
|
86
103
|
id: obj.getId(),
|
|
87
104
|
owner: obj.getOwner(),
|
|
@@ -97,6 +114,7 @@ class Workflow {
|
|
|
97
114
|
status: convertStatusToString(obj.getStatus()),
|
|
98
115
|
name: obj.getName(),
|
|
99
116
|
lastRanAt: obj.getLastRanAt(),
|
|
117
|
+
inputVariables: Object.keys(inputVariables).length > 0 ? inputVariables : undefined,
|
|
100
118
|
});
|
|
101
119
|
}
|
|
102
120
|
toRequest() {
|
|
@@ -148,22 +166,11 @@ class Workflow {
|
|
|
148
166
|
request.setName(this.name);
|
|
149
167
|
}
|
|
150
168
|
// Add input variables if provided
|
|
151
|
-
console.log('🔍 [DEBUG] Workflow.toRequest() inputVariables check:', {
|
|
152
|
-
hasInputVariables: !!this.inputVariables,
|
|
153
|
-
inputVariables: this.inputVariables,
|
|
154
|
-
inputVariablesType: typeof this.inputVariables,
|
|
155
|
-
inputVariablesKeys: this.inputVariables ? Object.keys(this.inputVariables) : [],
|
|
156
|
-
});
|
|
157
169
|
if (this.inputVariables) {
|
|
158
170
|
const inputVarsMap = request.getInputVariablesMap();
|
|
159
171
|
for (const [key, value] of Object.entries(this.inputVariables)) {
|
|
160
|
-
console.log('🔍 [DEBUG] Converting inputVariable:', { key, value, valueType: typeof value });
|
|
161
172
|
inputVarsMap.set(key, convertJSValueToProtobuf(value));
|
|
162
173
|
}
|
|
163
|
-
console.log('🔍 [DEBUG] Final inputVarsMap size:', inputVarsMap.getLength());
|
|
164
|
-
}
|
|
165
|
-
else {
|
|
166
|
-
console.log('🔍 [DEBUG] No inputVariables to add to request');
|
|
167
174
|
}
|
|
168
175
|
return request;
|
|
169
176
|
}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,aAAa,EAGvB,MAAM,2CAA2C,CAAC;AAGnD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,GAAG,CAiCnE;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,aAAa,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,IAAI,aAAa,EAGvB,MAAM,2CAA2C,CAAC;AAGnD;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,GAAG,CAiCnE;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,GAAG,GAAG,aAAa,CA6BlE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,CAAC,GAAG,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,CAatD;AAED;;;;;GAKG;AACH,wBAAgB,+BAA+B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAkB5E;AAED;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CA0BzE;AAED;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CASzE;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC1B,aAAa,GAAG,SAAS,CAK3B;AAED;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,CAAC,EAAE,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAiCjC;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAsB7D"}
|
package/dist/utils.js
CHANGED
|
@@ -55,7 +55,6 @@ export function convertProtobufValueToJs(value) {
|
|
|
55
55
|
* @returns The protobuf Value object
|
|
56
56
|
*/
|
|
57
57
|
export function convertJSValueToProtobuf(value) {
|
|
58
|
-
console.log('🔍 [DEBUG] convertJSValueToProtobuf called with:', { value, type: typeof value });
|
|
59
58
|
const protobufValue = new ProtobufValue();
|
|
60
59
|
if (value === null || value === undefined) {
|
|
61
60
|
protobufValue.setNullValue(0); // NULL_VALUE = 0
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@avaprotocol/sdk-js",
|
|
3
|
-
"version": "2.7.5-dev.
|
|
3
|
+
"version": "2.7.5-dev.10",
|
|
4
4
|
"description": "A JavaScript/TypeScript SDK designed to simplify integration with Ava Protocol's AVS",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"prepare": "node ../../scripts/prepare-package.js"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@avaprotocol/types": "
|
|
34
|
+
"@avaprotocol/types": "2.5.5-dev.9",
|
|
35
35
|
"@grpc/grpc-js": "^1.11.3",
|
|
36
36
|
"@grpc/proto-loader": "^0.7.13",
|
|
37
37
|
"dotenv": "^16.4.5",
|