MCPcopy Create free account
hub / github.com/AztecProtocol/aztec-packages / encode

Method encode

yarn-project/stdlib/src/abi/encoder.ts:209–220  ·  view source on GitHub ↗

* Encodes all the arguments for the given function ABI. * @returns The encoded arguments.

()

Source from the content-addressed store, hash-verified

207 * @returns The encoded arguments.
208 */
209 public encode() {
210 if (this.args.length !== this.abi.parameters.length) {
211 throw new Error(
212 `Function '${this.abi.name}' expects ${this.abi.parameters.length} argument(s) but received ${this.args.length}`,
213 );
214 }
215 for (let i = 0; i < this.abi.parameters.length; i += 1) {
216 const parameterAbi = this.abi.parameters[i];
217 this.encodeArgument(parameterAbi.type, this.args[i], parameterAbi.name);
218 }
219 return this.flattened;
220 }
221
222 /**
223 * Encodes an array as a BoundedVec struct.

Callers 13

proveMethod · 0.45
fromMethod · 0.45
encodeArgumentsFunction · 0.45
serializeWithMessagePackFunction · 0.45
byteLengthFunction · 0.45
utf8WriteFunction · 0.45
ECDSATestSuiteFunction · 0.45
index.test.tsFile · 0.45
crypto.tsFile · 0.45
encryptFunction · 0.45
deriveKeyFromPassphraseFunction · 0.45

Calls 1

encodeArgumentMethod · 0.95

Tested by 1

ECDSATestSuiteFunction · 0.36