@avaprotocol/sdk-js 1.2.1-dev.8 → 1.3.1-dev.0

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.mts CHANGED
@@ -2,6 +2,7 @@ import * as grpc from '@grpc/grpc-js';
2
2
  import { Metadata } from '@grpc/grpc-js';
3
3
  import * as jspb from 'google-protobuf';
4
4
  import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
5
+ import { NodeType } from '@avaprotocol/types';
5
6
 
6
7
  declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
7
8
 
@@ -1407,11 +1408,9 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
1407
1408
  public triggerTask(request: UserTriggerTaskReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: UserTriggerTaskResp) => void): grpc.ClientUnaryCall;
1408
1409
  }
1409
1410
 
1410
- declare const NodeTypes: typeof TaskNode.TaskTypeCase;
1411
- type NodeType = TaskNode.TaskTypeCase;
1412
1411
  type NodeData = ETHTransferNode$1.AsObject | ContractWriteNode$1.AsObject | ContractReadNode$1.AsObject | GraphQLQueryNode$1.AsObject | RestAPINode$1.AsObject | BranchNode$1.AsObject | FilterNode.AsObject | LoopNode.AsObject | CustomCodeNode$1.AsObject;
1413
1412
  type NodeProps = Omit<TaskNode.AsObject, "ethTransfer" | "contractWrite" | "contractRead" | "graphqlDataQuery" | "restApi" | "branch" | "filter" | "loop" | "customCode"> & {
1414
- type: TaskNode.TaskTypeCase;
1413
+ type: NodeType;
1415
1414
  data: NodeData;
1416
1415
  };
1417
1416
  declare class Node implements NodeProps {
@@ -1886,4 +1885,4 @@ declare class Client extends BaseClient {
1886
1885
  deleteWorkflow(id: string, options?: RequestOptions): Promise<boolean>;
1887
1886
  }
1888
1887
 
1889
- export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type NodeType, NodeTypes, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
1888
+ export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import * as grpc from '@grpc/grpc-js';
2
2
  import { Metadata } from '@grpc/grpc-js';
3
3
  import * as jspb from 'google-protobuf';
4
4
  import * as google_protobuf_wrappers_pb from 'google-protobuf/google/protobuf/wrappers_pb';
5
+ import { NodeType } from '@avaprotocol/types';
5
6
 
6
7
  declare const getKeyRequestMessage: (address: string, expiredAt: number) => string;
7
8
 
@@ -1407,11 +1408,9 @@ declare class AggregatorClient extends grpc.Client implements IAggregatorClient
1407
1408
  public triggerTask(request: UserTriggerTaskReq, metadata: grpc.Metadata, options: Partial<grpc.CallOptions>, callback: (error: grpc.ServiceError | null, response: UserTriggerTaskResp) => void): grpc.ClientUnaryCall;
1408
1409
  }
1409
1410
 
1410
- declare const NodeTypes: typeof TaskNode.TaskTypeCase;
1411
- type NodeType = TaskNode.TaskTypeCase;
1412
1411
  type NodeData = ETHTransferNode$1.AsObject | ContractWriteNode$1.AsObject | ContractReadNode$1.AsObject | GraphQLQueryNode$1.AsObject | RestAPINode$1.AsObject | BranchNode$1.AsObject | FilterNode.AsObject | LoopNode.AsObject | CustomCodeNode$1.AsObject;
1413
1412
  type NodeProps = Omit<TaskNode.AsObject, "ethTransfer" | "contractWrite" | "contractRead" | "graphqlDataQuery" | "restApi" | "branch" | "filter" | "loop" | "customCode"> & {
1414
- type: TaskNode.TaskTypeCase;
1413
+ type: NodeType;
1415
1414
  data: NodeData;
1416
1415
  };
1417
1416
  declare class Node implements NodeProps {
@@ -1886,4 +1885,4 @@ declare class Client extends BaseClient {
1886
1885
  deleteWorkflow(id: string, options?: RequestOptions): Promise<boolean>;
1887
1886
  }
1888
1887
 
1889
- export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type NodeType, NodeTypes, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
1888
+ export { AUTH_KEY_HEADER, BlockTrigger, type BlockTriggerProps, BranchNode, type BranchNodeData, type BranchNodeProps, type ClientOption, ContractReadNode, type ContractReadNodeProps, ContractWriteNode, type ContractWriteNodeProps, CronTrigger, type CronTriggerProps, CustomCodeLangs, CustomCodeNode, type CustomCodeNodeProps, DEFAULT_LIMIT, ETHTransferNode, type ETHTransferNodeProps, Edge, type EdgeProps, type Environment, EventTrigger, type EventTriggerProps, Execution, FixedTimeTrigger, type FixedTimeTriggerProps, type GetExecutionsRequest, type GetKeyResponse, type GetWalletRequest, type GetWorkflowsRequest, GraphQLQueryNode, type GraphQLQueryNodeProps, Node, NodeFactory, type NodeProps, type RequestOptions, RestAPINode, type RestAPINodeProps, type SmartWallet, Trigger, TriggerFactory, type TriggerProps, TriggerType, Workflow, type WorkflowProps, WorkflowStatus, Client as default, getKeyRequestMessage };
package/dist/index.js CHANGED
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  ));
31
31
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
32
32
 
33
- // grpc_codegen/avs_pb.js
33
+ // ../../grpc_codegen/avs_pb.js
34
34
  var require_avs_pb = __commonJS({
35
- "grpc_codegen/avs_pb.js"(exports2) {
35
+ "../../grpc_codegen/avs_pb.js"(exports2) {
36
36
  "use strict";
37
37
  var jspb = require("google-protobuf");
38
38
  var goog = jspb;
@@ -5911,9 +5911,9 @@ var require_avs_pb = __commonJS({
5911
5911
  }
5912
5912
  });
5913
5913
 
5914
- // grpc_codegen/avs_grpc_pb.js
5914
+ // ../../grpc_codegen/avs_grpc_pb.js
5915
5915
  var require_avs_grpc_pb = __commonJS({
5916
- "grpc_codegen/avs_grpc_pb.js"(exports2) {
5916
+ "../../grpc_codegen/avs_grpc_pb.js"(exports2) {
5917
5917
  "use strict";
5918
5918
  var grpc2 = require("@grpc/grpc-js");
5919
5919
  var avs_pb19 = require_avs_pb();
@@ -6249,8 +6249,8 @@ var require_avs_grpc_pb = __commonJS({
6249
6249
  });
6250
6250
 
6251
6251
  // src/index.ts
6252
- var src_exports = {};
6253
- __export(src_exports, {
6252
+ var index_exports = {};
6253
+ __export(index_exports, {
6254
6254
  AUTH_KEY_HEADER: () => AUTH_KEY_HEADER,
6255
6255
  BlockTrigger: () => block_default,
6256
6256
  BranchNode: () => branch_default,
@@ -6268,7 +6268,6 @@ __export(src_exports, {
6268
6268
  GraphQLQueryNode: () => graphqlQuery_default,
6269
6269
  Node: () => interface_default2,
6270
6270
  NodeFactory: () => factory_default2,
6271
- NodeTypes: () => NodeTypes,
6272
6271
  RestAPINode: () => restApi_default,
6273
6272
  Trigger: () => interface_default,
6274
6273
  TriggerFactory: () => factory_default,
@@ -6278,7 +6277,7 @@ __export(src_exports, {
6278
6277
  default: () => Client,
6279
6278
  getKeyRequestMessage: () => getKeyRequestMessage
6280
6279
  });
6281
- module.exports = __toCommonJS(src_exports);
6280
+ module.exports = __toCommonJS(index_exports);
6282
6281
  var import_lodash4 = __toESM(require("lodash"));
6283
6282
  var grpc = __toESM(require("@grpc/grpc-js"));
6284
6283
  var import_grpc_js = require("@grpc/grpc-js");
@@ -6537,8 +6536,8 @@ var import_lodash2 = __toESM(require("lodash"));
6537
6536
 
6538
6537
  // src/models/node/interface.ts
6539
6538
  var avs_pb6 = __toESM(require_avs_pb());
6539
+ var import_types6 = require("@avaprotocol/types");
6540
6540
  var import_lodash = __toESM(require("lodash"));
6541
- var NodeTypes = avs_pb6.TaskNode.TaskTypeCase;
6542
6541
  var Node = class {
6543
6542
  constructor(props) {
6544
6543
  this.id = props.id;
@@ -6548,7 +6547,6 @@ var Node = class {
6548
6547
  }
6549
6548
  toRequest() {
6550
6549
  const request = new avs_pb6.TaskNode();
6551
- console.log("Node.toRequest.request:", request);
6552
6550
  const raw = request.serializeBinary();
6553
6551
  const parsed = avs_pb6.TaskNode.deserializeBinary(raw);
6554
6552
  if (!import_lodash.default.isEqual(request, parsed)) {
@@ -6561,15 +6559,16 @@ var interface_default2 = Node;
6561
6559
 
6562
6560
  // src/models/node/contractWrite.ts
6563
6561
  var avs_pb7 = __toESM(require_avs_pb());
6562
+ var import_types7 = require("@avaprotocol/types");
6564
6563
  var ContractWriteNode2 = class _ContractWriteNode extends interface_default2 {
6565
6564
  constructor(props) {
6566
- super({ ...props, type: NodeTypes.CONTRACT_WRITE, data: props.data });
6565
+ super({ ...props, type: import_types7.NodeType.ContractWrite, data: props.data });
6567
6566
  }
6568
6567
  static fromResponse(raw) {
6569
6568
  const obj = raw.toObject();
6570
6569
  return new _ContractWriteNode({
6571
6570
  ...obj,
6572
- type: NodeTypes.CONTRACT_WRITE,
6571
+ type: import_types7.NodeType.ContractWrite,
6573
6572
  data: raw.getContractWrite().toObject()
6574
6573
  });
6575
6574
  }
@@ -6591,16 +6590,17 @@ var contractWrite_default = ContractWriteNode2;
6591
6590
 
6592
6591
  // src/models/node/customCode.ts
6593
6592
  var avs_pb8 = __toESM(require_avs_pb());
6593
+ var import_types8 = require("@avaprotocol/types");
6594
6594
  var CustomCodeLangs = avs_pb8.CustomCodeLang;
6595
6595
  var CustomCodeNode2 = class _CustomCodeNode extends interface_default2 {
6596
6596
  constructor(props) {
6597
- super({ ...props, type: NodeTypes.CUSTOM_CODE, data: props.data });
6597
+ super({ ...props, type: import_types8.NodeType.CustomCode, data: props.data });
6598
6598
  }
6599
6599
  static fromResponse(raw) {
6600
6600
  const obj = raw.toObject();
6601
6601
  return new _CustomCodeNode({
6602
6602
  ...obj,
6603
- type: NodeTypes.CUSTOM_CODE,
6603
+ type: import_types8.NodeType.CustomCode,
6604
6604
  data: raw.getCustomCode().toObject()
6605
6605
  });
6606
6606
  }
@@ -6619,11 +6619,12 @@ var customCode_default = CustomCodeNode2;
6619
6619
 
6620
6620
  // src/models/node/graphqlQuery.ts
6621
6621
  var avs_pb9 = __toESM(require_avs_pb());
6622
+ var import_types9 = require("@avaprotocol/types");
6622
6623
  var GraphQLQueryNode2 = class _GraphQLQueryNode extends interface_default2 {
6623
6624
  constructor(props) {
6624
6625
  super({
6625
6626
  ...props,
6626
- type: NodeTypes.GRAPHQL_QUERY,
6627
+ type: import_types9.NodeType.GraphQLQuery,
6627
6628
  data: props.data
6628
6629
  });
6629
6630
  }
@@ -6631,7 +6632,7 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends interface_default2 {
6631
6632
  const obj = raw.toObject();
6632
6633
  return new _GraphQLQueryNode({
6633
6634
  ...obj,
6634
- type: NodeTypes.GRAPHQL_QUERY,
6635
+ type: import_types9.NodeType.GraphQLQuery,
6635
6636
  data: raw.getGraphqlQuery().toObject()
6636
6637
  });
6637
6638
  }
@@ -6655,15 +6656,16 @@ var graphqlQuery_default = GraphQLQueryNode2;
6655
6656
 
6656
6657
  // src/models/node/restApi.ts
6657
6658
  var avs_pb10 = __toESM(require_avs_pb());
6659
+ var import_types10 = require("@avaprotocol/types");
6658
6660
  var RestAPINode2 = class _RestAPINode extends interface_default2 {
6659
6661
  constructor(props) {
6660
- super({ ...props, type: NodeTypes.REST_API, data: props.data });
6662
+ super({ ...props, type: import_types10.NodeType.RestAPI, data: props.data });
6661
6663
  }
6662
6664
  static fromResponse(raw) {
6663
6665
  const obj = raw.toObject();
6664
6666
  return new _RestAPINode({
6665
6667
  ...obj,
6666
- type: NodeTypes.REST_API,
6668
+ type: import_types10.NodeType.RestAPI,
6667
6669
  data: raw.getRestApi().toObject()
6668
6670
  });
6669
6671
  }
@@ -6688,15 +6690,16 @@ var restApi_default = RestAPINode2;
6688
6690
 
6689
6691
  // src/models/node/contractRead.ts
6690
6692
  var avs_pb11 = __toESM(require_avs_pb());
6693
+ var import_types11 = require("@avaprotocol/types");
6691
6694
  var ContractReadNode2 = class _ContractReadNode extends interface_default2 {
6692
6695
  constructor(props) {
6693
- super({ ...props, type: NodeTypes.CONTRACT_READ, data: props.data });
6696
+ super({ ...props, type: import_types11.NodeType.ContractRead, data: props.data });
6694
6697
  }
6695
6698
  static fromResponse(raw) {
6696
6699
  const obj = raw.toObject();
6697
6700
  return new _ContractReadNode({
6698
6701
  ...obj,
6699
- type: NodeTypes.CONTRACT_READ,
6702
+ type: import_types11.NodeType.ContractRead,
6700
6703
  data: raw.getContractRead().toObject()
6701
6704
  });
6702
6705
  }
@@ -6719,15 +6722,16 @@ var contractRead_default = ContractReadNode2;
6719
6722
 
6720
6723
  // src/models/node/ethTransfer.ts
6721
6724
  var avs_pb12 = __toESM(require_avs_pb());
6725
+ var import_types12 = require("@avaprotocol/types");
6722
6726
  var ETHTransferNode2 = class _ETHTransferNode extends interface_default2 {
6723
6727
  constructor(props) {
6724
- super({ ...props, type: NodeTypes.ETH_TRANSFER, data: props.data });
6728
+ super({ ...props, type: import_types12.NodeType.ETHTransfer, data: props.data });
6725
6729
  }
6726
6730
  static fromResponse(raw) {
6727
6731
  const obj = raw.toObject();
6728
6732
  return new _ETHTransferNode({
6729
6733
  ...obj,
6730
- type: NodeTypes.ETH_TRANSFER,
6734
+ type: import_types12.NodeType.ETHTransfer,
6731
6735
  data: raw.getEthTransfer().toObject()
6732
6736
  });
6733
6737
  }
@@ -6745,16 +6749,17 @@ var ETHTransferNode2 = class _ETHTransferNode extends interface_default2 {
6745
6749
  var ethTransfer_default = ETHTransferNode2;
6746
6750
 
6747
6751
  // src/models/node/branch.ts
6752
+ var import_types13 = require("@avaprotocol/types");
6748
6753
  var avs_pb13 = __toESM(require_avs_pb());
6749
6754
  var BranchNode2 = class _BranchNode extends interface_default2 {
6750
6755
  constructor(props) {
6751
- super({ ...props, type: NodeTypes.BRANCH, data: props.data });
6756
+ super({ ...props, type: import_types13.NodeType.Branch, data: props.data });
6752
6757
  }
6753
6758
  static fromResponse(raw) {
6754
6759
  const obj = raw.toObject();
6755
6760
  return new _BranchNode({
6756
6761
  ...obj,
6757
- type: NodeTypes.BRANCH,
6762
+ type: import_types13.NodeType.Branch,
6758
6763
  data: raw.getBranch().toObject()
6759
6764
  });
6760
6765
  }
@@ -6779,22 +6784,23 @@ var BranchNode2 = class _BranchNode extends interface_default2 {
6779
6784
  var branch_default = BranchNode2;
6780
6785
 
6781
6786
  // src/models/node/factory.ts
6787
+ var import_types14 = require("@avaprotocol/types");
6782
6788
  var NodeFactory = class {
6783
6789
  static create(props) {
6784
6790
  switch (props.type) {
6785
- case NodeTypes.CONTRACT_WRITE:
6791
+ case import_types14.NodeType.ContractWrite:
6786
6792
  return new contractWrite_default(props);
6787
- case NodeTypes.REST_API:
6793
+ case import_types14.NodeType.RestAPI:
6788
6794
  return new restApi_default(props);
6789
- case NodeTypes.CUSTOM_CODE:
6795
+ case import_types14.NodeType.CustomCode:
6790
6796
  return new customCode_default(props);
6791
- case NodeTypes.CONTRACT_READ:
6797
+ case import_types14.NodeType.ContractRead:
6792
6798
  return new contractRead_default(props);
6793
- case NodeTypes.ETH_TRANSFER:
6799
+ case import_types14.NodeType.ETHTransfer:
6794
6800
  return new ethTransfer_default(props);
6795
- case NodeTypes.GRAPHQL_QUERY:
6801
+ case import_types14.NodeType.GraphQLQuery:
6796
6802
  return new graphqlQuery_default(props);
6797
- case NodeTypes.BRANCH:
6803
+ case import_types14.NodeType.Branch:
6798
6804
  return new branch_default(props);
6799
6805
  default:
6800
6806
  throw new Error(`Unsupported node type: ${props.type}`);
@@ -7426,7 +7432,6 @@ var Client = class extends BaseClient {
7426
7432
  GraphQLQueryNode,
7427
7433
  Node,
7428
7434
  NodeFactory,
7429
- NodeTypes,
7430
7435
  RestAPINode,
7431
7436
  Trigger,
7432
7437
  TriggerFactory,
package/dist/index.mjs CHANGED
@@ -30,9 +30,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
30
30
  mod
31
31
  ));
32
32
 
33
- // grpc_codegen/avs_pb.js
33
+ // ../../grpc_codegen/avs_pb.js
34
34
  var require_avs_pb = __commonJS({
35
- "grpc_codegen/avs_pb.js"(exports) {
35
+ "../../grpc_codegen/avs_pb.js"(exports) {
36
36
  "use strict";
37
37
  var jspb = __require("google-protobuf");
38
38
  var goog = jspb;
@@ -5911,9 +5911,9 @@ var require_avs_pb = __commonJS({
5911
5911
  }
5912
5912
  });
5913
5913
 
5914
- // grpc_codegen/avs_grpc_pb.js
5914
+ // ../../grpc_codegen/avs_grpc_pb.js
5915
5915
  var require_avs_grpc_pb = __commonJS({
5916
- "grpc_codegen/avs_grpc_pb.js"(exports) {
5916
+ "../../grpc_codegen/avs_grpc_pb.js"(exports) {
5917
5917
  "use strict";
5918
5918
  var grpc2 = __require("@grpc/grpc-js");
5919
5919
  var avs_pb19 = require_avs_pb();
@@ -6507,8 +6507,8 @@ import _2 from "lodash";
6507
6507
 
6508
6508
  // src/models/node/interface.ts
6509
6509
  var avs_pb6 = __toESM(require_avs_pb());
6510
+ import { NodeType } from "@avaprotocol/types";
6510
6511
  import _ from "lodash";
6511
- var NodeTypes = avs_pb6.TaskNode.TaskTypeCase;
6512
6512
  var Node = class {
6513
6513
  constructor(props) {
6514
6514
  this.id = props.id;
@@ -6518,7 +6518,6 @@ var Node = class {
6518
6518
  }
6519
6519
  toRequest() {
6520
6520
  const request = new avs_pb6.TaskNode();
6521
- console.log("Node.toRequest.request:", request);
6522
6521
  const raw = request.serializeBinary();
6523
6522
  const parsed = avs_pb6.TaskNode.deserializeBinary(raw);
6524
6523
  if (!_.isEqual(request, parsed)) {
@@ -6531,15 +6530,16 @@ var interface_default2 = Node;
6531
6530
 
6532
6531
  // src/models/node/contractWrite.ts
6533
6532
  var avs_pb7 = __toESM(require_avs_pb());
6533
+ import { NodeType as NodeType2 } from "@avaprotocol/types";
6534
6534
  var ContractWriteNode2 = class _ContractWriteNode extends interface_default2 {
6535
6535
  constructor(props) {
6536
- super({ ...props, type: NodeTypes.CONTRACT_WRITE, data: props.data });
6536
+ super({ ...props, type: NodeType2.ContractWrite, data: props.data });
6537
6537
  }
6538
6538
  static fromResponse(raw) {
6539
6539
  const obj = raw.toObject();
6540
6540
  return new _ContractWriteNode({
6541
6541
  ...obj,
6542
- type: NodeTypes.CONTRACT_WRITE,
6542
+ type: NodeType2.ContractWrite,
6543
6543
  data: raw.getContractWrite().toObject()
6544
6544
  });
6545
6545
  }
@@ -6561,16 +6561,17 @@ var contractWrite_default = ContractWriteNode2;
6561
6561
 
6562
6562
  // src/models/node/customCode.ts
6563
6563
  var avs_pb8 = __toESM(require_avs_pb());
6564
+ import { NodeType as NodeType3 } from "@avaprotocol/types";
6564
6565
  var CustomCodeLangs = avs_pb8.CustomCodeLang;
6565
6566
  var CustomCodeNode2 = class _CustomCodeNode extends interface_default2 {
6566
6567
  constructor(props) {
6567
- super({ ...props, type: NodeTypes.CUSTOM_CODE, data: props.data });
6568
+ super({ ...props, type: NodeType3.CustomCode, data: props.data });
6568
6569
  }
6569
6570
  static fromResponse(raw) {
6570
6571
  const obj = raw.toObject();
6571
6572
  return new _CustomCodeNode({
6572
6573
  ...obj,
6573
- type: NodeTypes.CUSTOM_CODE,
6574
+ type: NodeType3.CustomCode,
6574
6575
  data: raw.getCustomCode().toObject()
6575
6576
  });
6576
6577
  }
@@ -6589,11 +6590,12 @@ var customCode_default = CustomCodeNode2;
6589
6590
 
6590
6591
  // src/models/node/graphqlQuery.ts
6591
6592
  var avs_pb9 = __toESM(require_avs_pb());
6593
+ import { NodeType as NodeType4 } from "@avaprotocol/types";
6592
6594
  var GraphQLQueryNode2 = class _GraphQLQueryNode extends interface_default2 {
6593
6595
  constructor(props) {
6594
6596
  super({
6595
6597
  ...props,
6596
- type: NodeTypes.GRAPHQL_QUERY,
6598
+ type: NodeType4.GraphQLQuery,
6597
6599
  data: props.data
6598
6600
  });
6599
6601
  }
@@ -6601,7 +6603,7 @@ var GraphQLQueryNode2 = class _GraphQLQueryNode extends interface_default2 {
6601
6603
  const obj = raw.toObject();
6602
6604
  return new _GraphQLQueryNode({
6603
6605
  ...obj,
6604
- type: NodeTypes.GRAPHQL_QUERY,
6606
+ type: NodeType4.GraphQLQuery,
6605
6607
  data: raw.getGraphqlQuery().toObject()
6606
6608
  });
6607
6609
  }
@@ -6625,15 +6627,16 @@ var graphqlQuery_default = GraphQLQueryNode2;
6625
6627
 
6626
6628
  // src/models/node/restApi.ts
6627
6629
  var avs_pb10 = __toESM(require_avs_pb());
6630
+ import { NodeType as NodeType5 } from "@avaprotocol/types";
6628
6631
  var RestAPINode2 = class _RestAPINode extends interface_default2 {
6629
6632
  constructor(props) {
6630
- super({ ...props, type: NodeTypes.REST_API, data: props.data });
6633
+ super({ ...props, type: NodeType5.RestAPI, data: props.data });
6631
6634
  }
6632
6635
  static fromResponse(raw) {
6633
6636
  const obj = raw.toObject();
6634
6637
  return new _RestAPINode({
6635
6638
  ...obj,
6636
- type: NodeTypes.REST_API,
6639
+ type: NodeType5.RestAPI,
6637
6640
  data: raw.getRestApi().toObject()
6638
6641
  });
6639
6642
  }
@@ -6658,15 +6661,16 @@ var restApi_default = RestAPINode2;
6658
6661
 
6659
6662
  // src/models/node/contractRead.ts
6660
6663
  var avs_pb11 = __toESM(require_avs_pb());
6664
+ import { NodeType as NodeType6 } from "@avaprotocol/types";
6661
6665
  var ContractReadNode2 = class _ContractReadNode extends interface_default2 {
6662
6666
  constructor(props) {
6663
- super({ ...props, type: NodeTypes.CONTRACT_READ, data: props.data });
6667
+ super({ ...props, type: NodeType6.ContractRead, data: props.data });
6664
6668
  }
6665
6669
  static fromResponse(raw) {
6666
6670
  const obj = raw.toObject();
6667
6671
  return new _ContractReadNode({
6668
6672
  ...obj,
6669
- type: NodeTypes.CONTRACT_READ,
6673
+ type: NodeType6.ContractRead,
6670
6674
  data: raw.getContractRead().toObject()
6671
6675
  });
6672
6676
  }
@@ -6689,15 +6693,16 @@ var contractRead_default = ContractReadNode2;
6689
6693
 
6690
6694
  // src/models/node/ethTransfer.ts
6691
6695
  var avs_pb12 = __toESM(require_avs_pb());
6696
+ import { NodeType as NodeType7 } from "@avaprotocol/types";
6692
6697
  var ETHTransferNode2 = class _ETHTransferNode extends interface_default2 {
6693
6698
  constructor(props) {
6694
- super({ ...props, type: NodeTypes.ETH_TRANSFER, data: props.data });
6699
+ super({ ...props, type: NodeType7.ETHTransfer, data: props.data });
6695
6700
  }
6696
6701
  static fromResponse(raw) {
6697
6702
  const obj = raw.toObject();
6698
6703
  return new _ETHTransferNode({
6699
6704
  ...obj,
6700
- type: NodeTypes.ETH_TRANSFER,
6705
+ type: NodeType7.ETHTransfer,
6701
6706
  data: raw.getEthTransfer().toObject()
6702
6707
  });
6703
6708
  }
@@ -6715,16 +6720,17 @@ var ETHTransferNode2 = class _ETHTransferNode extends interface_default2 {
6715
6720
  var ethTransfer_default = ETHTransferNode2;
6716
6721
 
6717
6722
  // src/models/node/branch.ts
6723
+ import { NodeType as NodeType8 } from "@avaprotocol/types";
6718
6724
  var avs_pb13 = __toESM(require_avs_pb());
6719
6725
  var BranchNode2 = class _BranchNode extends interface_default2 {
6720
6726
  constructor(props) {
6721
- super({ ...props, type: NodeTypes.BRANCH, data: props.data });
6727
+ super({ ...props, type: NodeType8.Branch, data: props.data });
6722
6728
  }
6723
6729
  static fromResponse(raw) {
6724
6730
  const obj = raw.toObject();
6725
6731
  return new _BranchNode({
6726
6732
  ...obj,
6727
- type: NodeTypes.BRANCH,
6733
+ type: NodeType8.Branch,
6728
6734
  data: raw.getBranch().toObject()
6729
6735
  });
6730
6736
  }
@@ -6749,22 +6755,23 @@ var BranchNode2 = class _BranchNode extends interface_default2 {
6749
6755
  var branch_default = BranchNode2;
6750
6756
 
6751
6757
  // src/models/node/factory.ts
6758
+ import { NodeType as NodeType9 } from "@avaprotocol/types";
6752
6759
  var NodeFactory = class {
6753
6760
  static create(props) {
6754
6761
  switch (props.type) {
6755
- case NodeTypes.CONTRACT_WRITE:
6762
+ case NodeType9.ContractWrite:
6756
6763
  return new contractWrite_default(props);
6757
- case NodeTypes.REST_API:
6764
+ case NodeType9.RestAPI:
6758
6765
  return new restApi_default(props);
6759
- case NodeTypes.CUSTOM_CODE:
6766
+ case NodeType9.CustomCode:
6760
6767
  return new customCode_default(props);
6761
- case NodeTypes.CONTRACT_READ:
6768
+ case NodeType9.ContractRead:
6762
6769
  return new contractRead_default(props);
6763
- case NodeTypes.ETH_TRANSFER:
6770
+ case NodeType9.ETHTransfer:
6764
6771
  return new ethTransfer_default(props);
6765
- case NodeTypes.GRAPHQL_QUERY:
6772
+ case NodeType9.GraphQLQuery:
6766
6773
  return new graphqlQuery_default(props);
6767
- case NodeTypes.BRANCH:
6774
+ case NodeType9.Branch:
6768
6775
  return new branch_default(props);
6769
6776
  default:
6770
6777
  throw new Error(`Unsupported node type: ${props.type}`);
@@ -7395,7 +7402,6 @@ export {
7395
7402
  graphqlQuery_default as GraphQLQueryNode,
7396
7403
  interface_default2 as Node,
7397
7404
  factory_default2 as NodeFactory,
7398
- NodeTypes,
7399
7405
  restApi_default as RestAPINode,
7400
7406
  interface_default as Trigger,
7401
7407
  factory_default as TriggerFactory,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@avaprotocol/sdk-js",
3
- "version": "1.2.1-dev.8",
3
+ "version": "1.3.1-dev.0",
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",
@@ -19,19 +19,15 @@
19
19
  "author": "Vinh Nguyen (https://github.com/v9n), Chris Li (https://github.com/chrisli30)",
20
20
  "license": "Apache-2.0",
21
21
  "engines": {
22
- "node": ">=20.18.0"
22
+ "node": ">=20.18.0",
23
+ "yarn": ">=1.22.19"
23
24
  },
24
25
  "scripts": {
25
- "proto-download": "curl -s https://raw.githubusercontent.com/AvaProtocol/EigenLayer-AVS/main/protobuf/avs.proto > grpc_codegen/avs.proto",
26
- "gen-protoc": "grpc_tools_node_protoc --js_out=import_style=commonjs,binary:./grpc_codegen/ --grpc_out=grpc_js:./grpc_codegen/ --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./grpc_codegen --proto_path=./grpc_codegen grpc_codegen/avs.proto",
27
26
  "build": "tsup src/index.ts --format cjs,esm --dts",
28
- "gen-apikey": "sh -c 'API_KEY=$(docker compose exec aggregator /ava create-api-key --role=admin --subject=apikey) && echo \"Generated API key for tests: $API_KEY\" && echo \"Writing to .env.test to replace the TEST_API_KEY env variable\" && sed -i \"\" -e \"s/^TEST_API_KEY=.*/TEST_API_KEY=$API_KEY/\" .env.test && echo \"Done.\"'",
29
- "test": "jest --config jest.config.cjs",
30
- "test:select": "npm run test -- --testNamePattern",
31
- "changeset": "changeset",
32
- "version": "changeset version"
27
+ "clean": "rm -rf dist"
33
28
  },
34
29
  "dependencies": {
30
+ "@avaprotocol/types": "0.9.2-dev.4",
35
31
  "@grpc/grpc-js": "^1.11.3",
36
32
  "@grpc/proto-loader": "^0.7.13",
37
33
  "dotenv": "^16.4.5",
@@ -41,26 +37,10 @@
41
37
  "lodash": "^4.17.21"
42
38
  },
43
39
  "devDependencies": {
44
- "@babel/core": "^7.26.0",
45
- "@babel/preset-env": "^7.26.0",
46
- "@babel/preset-typescript": "^7.26.0",
47
- "@changesets/cli": "^2.27.9",
48
- "@eslint/js": "^9.16.0",
49
- "@jest/globals": "^29.7.0",
50
40
  "@types/google-protobuf": "^3.15.12",
51
- "@types/jest": "^29.5.13",
52
41
  "@types/lodash": "^4.17.12",
53
- "@typescript-eslint/eslint-plugin": "^8.17.0",
54
- "@typescript-eslint/parser": "^8.17.0",
55
- "babel-jest": "^29.7.0",
56
- "eslint": "^9.16.0",
57
42
  "globals": "^15.13.0",
58
- "grpc_tools_node_protoc_ts": "^5.3.3",
59
- "grpc-tools": "^1.12.4",
60
- "jest": "^29.7.0",
61
- "ts-jest": "^29.2.5",
62
43
  "tsup": "^8.0.2",
63
44
  "typescript": "^5.4.2"
64
- },
65
- "type": "commonjs"
45
+ }
66
46
  }
package/LICENSE DELETED
@@ -1,201 +0,0 @@
1
- Apache License
2
- Version 2.0, January 2004
3
- http://www.apache.org/licenses/
4
-
5
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
-
7
- 1. Definitions.
8
-
9
- "License" shall mean the terms and conditions for use, reproduction,
10
- and distribution as defined by Sections 1 through 9 of this document.
11
-
12
- "Licensor" shall mean the copyright owner or entity authorized by
13
- the copyright owner that is granting the License.
14
-
15
- "Legal Entity" shall mean the union of the acting entity and all
16
- other entities that control, are controlled by, or are under common
17
- control with that entity. For the purposes of this definition,
18
- "control" means (i) the power, direct or indirect, to cause the
19
- direction or management of such entity, whether by contract or
20
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
- outstanding shares, or (iii) beneficial ownership of such entity.
22
-
23
- "You" (or "Your") shall mean an individual or Legal Entity
24
- exercising permissions granted by this License.
25
-
26
- "Source" form shall mean the preferred form for making modifications,
27
- including but not limited to software source code, documentation
28
- source, and configuration files.
29
-
30
- "Object" form shall mean any form resulting from mechanical
31
- transformation or translation of a Source form, including but
32
- not limited to compiled object code, generated documentation,
33
- and conversions to other media types.
34
-
35
- "Work" shall mean the work of authorship, whether in Source or
36
- Object form, made available under the License, as indicated by a
37
- copyright notice that is included in or attached to the work
38
- (an example is provided in the Appendix below).
39
-
40
- "Derivative Works" shall mean any work, whether in Source or Object
41
- form, that is based on (or derived from) the Work and for which the
42
- editorial revisions, annotations, elaborations, or other modifications
43
- represent, as a whole, an original work of authorship. For the purposes
44
- of this License, Derivative Works shall not include works that remain
45
- separable from, or merely link (or bind by name) to the interfaces of,
46
- the Work and Derivative Works thereof.
47
-
48
- "Contribution" shall mean any work of authorship, including
49
- the original version of the Work and any modifications or additions
50
- to that Work or Derivative Works thereof, that is intentionally
51
- submitted to Licensor for inclusion in the Work by the copyright owner
52
- or by an individual or Legal Entity authorized to submit on behalf of
53
- the copyright owner. For the purposes of this definition, "submitted"
54
- means any form of electronic, verbal, or written communication sent
55
- to the Licensor or its representatives, including but not limited to
56
- communication on electronic mailing lists, source code control systems,
57
- and issue tracking systems that are managed by, or on behalf of, the
58
- Licensor for the purpose of discussing and improving the Work, but
59
- excluding communication that is conspicuously marked or otherwise
60
- designated in writing by the copyright owner as "Not a Contribution."
61
-
62
- "Contributor" shall mean Licensor and any individual or Legal Entity
63
- on behalf of whom a Contribution has been received by Licensor and
64
- subsequently incorporated within the Work.
65
-
66
- 2. Grant of Copyright License. Subject to the terms and conditions of
67
- this License, each Contributor hereby grants to You a perpetual,
68
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
- copyright license to reproduce, prepare Derivative Works of,
70
- publicly display, publicly perform, sublicense, and distribute the
71
- Work and such Derivative Works in Source or Object form.
72
-
73
- 3. Grant of Patent License. Subject to the terms and conditions of
74
- this License, each Contributor hereby grants to You a perpetual,
75
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
- (except as stated in this section) patent license to make, have made,
77
- use, offer to sell, sell, import, and otherwise transfer the Work,
78
- where such license applies only to those patent claims licensable
79
- by such Contributor that are necessarily infringed by their
80
- Contribution(s) alone or by combination of their Contribution(s)
81
- with the Work to which such Contribution(s) was submitted. If You
82
- institute patent litigation against any entity (including a
83
- cross-claim or counterclaim in a lawsuit) alleging that the Work
84
- or a Contribution incorporated within the Work constitutes direct
85
- or contributory patent infringement, then any patent licenses
86
- granted to You under this License for that Work shall terminate
87
- as of the date such litigation is filed.
88
-
89
- 4. Redistribution. You may reproduce and distribute copies of the
90
- Work or Derivative Works thereof in any medium, with or without
91
- modifications, and in Source or Object form, provided that You
92
- meet the following conditions:
93
-
94
- (a) You must give any other recipients of the Work or
95
- Derivative Works a copy of this License; and
96
-
97
- (b) You must cause any modified files to carry prominent notices
98
- stating that You changed the files; and
99
-
100
- (c) You must retain, in the Source form of any Derivative Works
101
- that You distribute, all copyright, patent, trademark, and
102
- attribution notices from the Source form of the Work,
103
- excluding those notices that do not pertain to any part of
104
- the Derivative Works; and
105
-
106
- (d) If the Work includes a "NOTICE" text file as part of its
107
- distribution, then any Derivative Works that You distribute must
108
- include a readable copy of the attribution notices contained
109
- within such NOTICE file, excluding those notices that do not
110
- pertain to any part of the Derivative Works, in at least one
111
- of the following places: within a NOTICE text file distributed
112
- as part of the Derivative Works; within the Source form or
113
- documentation, if provided along with the Derivative Works; or,
114
- within a display generated by the Derivative Works, if and
115
- wherever such third-party notices normally appear. The contents
116
- of the NOTICE file are for informational purposes only and
117
- do not modify the License. You may add Your own attribution
118
- notices within Derivative Works that You distribute, alongside
119
- or as an addendum to the NOTICE text from the Work, provided
120
- that such additional attribution notices cannot be construed
121
- as modifying the License.
122
-
123
- You may add Your own copyright statement to Your modifications and
124
- may provide additional or different license terms and conditions
125
- for use, reproduction, or distribution of Your modifications, or
126
- for any such Derivative Works as a whole, provided Your use,
127
- reproduction, and distribution of the Work otherwise complies with
128
- the conditions stated in this License.
129
-
130
- 5. Submission of Contributions. Unless You explicitly state otherwise,
131
- any Contribution intentionally submitted for inclusion in the Work
132
- by You to the Licensor shall be under the terms and conditions of
133
- this License, without any additional terms or conditions.
134
- Notwithstanding the above, nothing herein shall supersede or modify
135
- the terms of any separate license agreement you may have executed
136
- with Licensor regarding such Contributions.
137
-
138
- 6. Trademarks. This License does not grant permission to use the trade
139
- names, trademarks, service marks, or product names of the Licensor,
140
- except as required for reasonable and customary use in describing the
141
- origin of the Work and reproducing the content of the NOTICE file.
142
-
143
- 7. Disclaimer of Warranty. Unless required by applicable law or
144
- agreed to in writing, Licensor provides the Work (and each
145
- Contributor provides its Contributions) on an "AS IS" BASIS,
146
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
- implied, including, without limitation, any warranties or conditions
148
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
- PARTICULAR PURPOSE. You are solely responsible for determining the
150
- appropriateness of using or redistributing the Work and assume any
151
- risks associated with Your exercise of permissions under this License.
152
-
153
- 8. Limitation of Liability. In no event and under no legal theory,
154
- whether in tort (including negligence), contract, or otherwise,
155
- unless required by applicable law (such as deliberate and grossly
156
- negligent acts) or agreed to in writing, shall any Contributor be
157
- liable to You for damages, including any direct, indirect, special,
158
- incidental, or consequential damages of any character arising as a
159
- result of this License or out of the use or inability to use the
160
- Work (including but not limited to damages for loss of goodwill,
161
- work stoppage, computer failure or malfunction, or any and all
162
- other commercial damages or losses), even if such Contributor
163
- has been advised of the possibility of such damages.
164
-
165
- 9. Accepting Warranty or Additional Liability. While redistributing
166
- the Work or Derivative Works thereof, You may choose to offer,
167
- and charge a fee for, acceptance of support, warranty, indemnity,
168
- or other liability obligations and/or rights consistent with this
169
- License. However, in accepting such obligations, You may act only
170
- on Your own behalf and on Your sole responsibility, not on behalf
171
- of any other Contributor, and only if You agree to indemnify,
172
- defend, and hold each Contributor harmless for any liability
173
- incurred by, or claims asserted against, such Contributor by reason
174
- of your accepting any such warranty or additional liability.
175
-
176
- END OF TERMS AND CONDITIONS
177
-
178
- APPENDIX: How to apply the Apache License to your work.
179
-
180
- To apply the Apache License to your work, attach the following
181
- boilerplate notice, with the fields enclosed by brackets "[]"
182
- replaced with your own identifying information. (Don't include
183
- the brackets!) The text should be enclosed in the appropriate
184
- comment syntax for the file format. We also recommend that a
185
- file or class name and description of purpose be included on the
186
- same "printed page" as the copyright notice for easier
187
- identification within third-party archives.
188
-
189
- Copyright [yyyy] [name of copyright owner]
190
-
191
- Licensed under the Apache License, Version 2.0 (the "License");
192
- you may not use this file except in compliance with the License.
193
- You may obtain a copy of the License at
194
-
195
- http://www.apache.org/licenses/LICENSE-2.0
196
-
197
- Unless required by applicable law or agreed to in writing, software
198
- distributed under the License is distributed on an "AS IS" BASIS,
199
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
- See the License for the specific language governing permissions and
201
- limitations under the License.
package/README.md DELETED
@@ -1,160 +0,0 @@
1
- # Ava SDK for JavaScript/TypeScript
2
-
3
- `ava-sdk-js` is a simple, type-safe wrapper around gRPC designed to simplify integration with Ava Protocol’s AVS. It enables developers to interact with Ava Protocol efficiently, whether on the client-side or server-side, and provides full TypeScript support for a seamless development experience.
4
-
5
- ## Features
6
-
7
- - Type-Safe SDK: Automatically generated TypeScript types from gRPC protocol buffers ensure type safety and reduce errors during development.
8
- - Seamless Integration: Works in both Node.js and browser environments, optimized for frameworks like Next.js.
9
- - Easy to Use: Abstracts the complexity of gRPC with a simple JavaScript/TypeScript API.
10
- - Efficient Communication: Leverages gRPC for fast, efficient communication with Ava Protocol’s AVS (Actively Validated Services).
11
-
12
- ## Installation
13
-
14
- To install `ava-sdk-js`, use npm:
15
-
16
- ```bash
17
- npm install ava-sdk-js
18
- ```
19
-
20
- Or with Yarn:
21
-
22
- ```bash
23
- yarn add ava-sdk-js
24
- ```
25
-
26
- ## Getting Started
27
-
28
- Here’s a quick example of how to use the SDK to get started with Ava Protocol:
29
-
30
- ```typescript
31
- import { AvaSDK } from "ava-sdk-js";
32
- ```
33
-
34
- ## Development
35
-
36
- ### Install Dependencies and Download Proto Files
37
-
38
- ```bash
39
- npm install # install grpc-tools, etc. as dev dependencies
40
- ```
41
-
42
- Then, run the following command to regenerate the types:
43
-
44
- ```bash
45
- # download the latest .proto file from https://github.com/AvaProtocol/EigenLayer-AVS
46
- npm run proto-download
47
-
48
- # Generate the TypeScript types and gRPC code based on the downloaded .proto file
49
- npm run gen-protoc
50
-
51
- # Build the source files in to ./dist folder
52
- npm run build
53
- ```
54
-
55
- ### Running Tests
56
-
57
- To ensure the SDK is functioning correctly, we have a comprehensive test suite. Follow these steps to run the tests:
58
-
59
- 1. Make sure all dependencies are installed, and build the project. Tests are run against the files in the `/dist` folder
60
- ```bash
61
- npm install
62
- npm run build
63
- ```
64
- 2. Before running the e2e tests, make sure to configure the required environment variables in your `.env.test` file, based on the `.env.example` file.
65
-
66
- 3. Bring up a locally environment for aggregator
67
-
68
- ```bash
69
- docker compose up -d --pull always
70
- ```
71
-
72
- > By default the above command will pull the docker image of the latest commit on the `main` branch of https://github.com/AvaProtocol/EigenLayer-AVS. Alternatively, we could also run tests against a specific commit with the below command.
73
- >
74
- > ```
75
- > export AVS_BUILD_VERSION=git-commit-hash-123
76
- > docker compose up -d --pull always
77
- > ```
78
-
79
- 4. Generate a test API key for the local tests with the following command. It will automatically save the output to the `TEST_API_KEY` variable in `.env.test`.
80
-
81
- ```bash
82
- npm run gen-apikey
83
-
84
- # or if not using docker, run the following command in ./EigenLayer-AVS/out
85
- ./out/ap create-api-key --role=admin --subject=apikey
86
- ```
87
-
88
- 5. Run the test command with env variables set in `.env.test`.
89
-
90
- ```bash
91
- # Run all tests
92
- npm test
93
-
94
- # or, run a specific test
95
- npm run test:select -- <authWithSignature>
96
- ```
97
-
98
- > Note: In order to individually test `cancelTask` or `deleteTask`, `createTask` test needs to run first.
99
-
100
- > ```bash
101
- > npm run test:select -- "createTask|cancelTask"
102
- > ```
103
-
104
- This will execute all unit and integration tests. Make sure all tests pass in local dev environment before submitting a pull request or deploying changes.
105
-
106
- ## Release Process
107
-
108
- This repository uses a two-step workflow process for creating new releases:
109
-
110
- 1. **Record changeset workflow**
111
-
112
- - Go to the "Actions" tab in GitHub, and run the "Record Changeset" workflow
113
- - Select the version bump type:
114
- - `patch` for backwards-compatible bug fixes (0.0.x)
115
- - `minor` for backwards-compatible features (0.x.0)
116
- - `major` for breaking changes (x.0.0)
117
- - Examine the Pull Request created by the workflow, and merge it if everything looks correct. This will record any commits before it as a major, minor, or patch.
118
-
119
- 2. **Create release workflow**
120
- - Go to the "Actions" tab in GitHub and run the "Create Release" workflow. This will run `npx changeset version` to bump up version in `package.json` based on the recorded changeset files. It will also create a new GitHub Release if the new version is higher than the current version in `package.json`.
121
- 3. **Publish to NPM**
122
- - After the last step, the version number in `package.json` is updated and a git tag with the new version number is created. Now you can publish the production version to NPM using `npm publish`.
123
-
124
- ### NPM Publishing Dev Versions
125
-
126
- The NPM publishing of dev versions can be handled manually, since the test cases reference the dist folder and don’t require a new version on NPM. NPM publish on dev tag is only required for testing the new version in a web app.
127
-
128
- 1. Publish a dev version and test it in your local environment. The `npm publish` will use the version number in `package.json`, so run `npm version prerelease --preid=dev` first if you need a new version number.
129
-
130
- ```bash
131
- # Optionally, update version with dev tag in package.json
132
- npm version prerelease --preid=dev
133
-
134
- # Publish to npm with dev tag
135
- npm publish --tag dev
136
- ```
137
-
138
- 2. Once tested, and a release is created using GitHub Actions, publish the production version to NPM:
139
- ```bash
140
- # Publish to npm with latest tag
141
- npm publish
142
- ```
143
-
144
- ### Utility Scripts
145
-
146
- To generate the key request message for signing, you can run the following command:
147
-
148
- ```bash
149
- npm run build # Make sure to build the project first
150
-
151
- export TEST_MNEMONIC=<your_mnemonic> && node scripts/signMessage.js
152
- ```
153
-
154
- ## Contributing
155
-
156
- We welcome contributions! Feel free to submit pull requests or open issues for any bugs or feature requests.
157
-
158
- ## License
159
-
160
- This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.