Swap-Aggregator-Subgraph/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js
Richa-iitr d211083153 Revert "Revert "added handler""
This reverts commit c36ee8c5ca.
2022-07-03 07:30:05 +05:30

25 lines
749 B
JavaScript

"use strict";
import { Coder } from "./abstract-coder";
import { pack, unpack } from "./array";
export class TupleCoder extends Coder {
constructor(coders, localName) {
let dynamic = false;
const types = [];
coders.forEach((coder) => {
if (coder.dynamic) {
dynamic = true;
}
types.push(coder.type);
});
const type = ("tuple(" + types.join(",") + ")");
super("tuple", type, localName, dynamic);
this.coders = coders;
}
encode(writer, value) {
return pack(writer, this.coders, value);
}
decode(reader) {
return reader.coerce(this.name, unpack(reader, this.coders));
}
}
//# sourceMappingURL=tuple.js.map