MCPcopy Create free account
hub / github.com/Project-DARC/DARC / executeOperationList

Function executeOperationList

darc-js/src/darcjs.ts:90–115  ·  view source on GitHub ↗
(
  operationList: OperationStruct[],
  wallet: ethers.Wallet,
  targetDARCAddress: string,
  notes?: string,
  delegateToAddress?: string
  )

Source from the content-addressed store, hash-verified

88 * @param delegateToAddress If the signer is not the operator, but the operator has approved the signer to sign on its behalf, then the signer can set this parameter to the operator's address. Otherwise, leave it undefined.
89 */
90export async function executeOperationList(
91 operationList: OperationStruct[],
92 wallet: ethers.Wallet,
93 targetDARCAddress: string,
94 notes?: string,
95 delegateToAddress?: string
96 ) {
97
98 const operatorAddress = delegateToAddress? delegateToAddress : wallet.address;
99 for (let i = 0; i < operationList.length; i++) {
100 operationList[i].operatorAddress = operatorAddress;
101 }
102 const program:ProgramStruct = {
103 programOperatorAddress: operatorAddress,
104 operations: operationList,
105 notes: notes? notes : ""
106 };
107
108 const attachedDARC = new DARC.DARC({
109 address: targetDARCAddress,
110 version: DARC.DARC_VERSION.Latest,
111 wallet: wallet,
112 });
113
114 await attachedDARC.entrance(program);
115}
116
117
118

Callers 4

expression-test.tsFile · 0.90
sdk-test.tsFile · 0.90
transpileAndRun.tsFile · 0.90

Calls 1

entranceMethod · 0.95

Tested by

no test coverage detected