ethers.js/packages/abi/lib.esm/coders/string.js
2020-07-13 08:03:56 -04:00

15 lines
456 B
JavaScript

"use strict";
import { toUtf8Bytes, toUtf8String } from "@ethersproject/strings";
import { DynamicBytesCoder } from "./bytes";
export class StringCoder extends DynamicBytesCoder {
constructor(localName) {
super("string", localName);
}
encode(writer, value) {
return super.encode(writer, toUtf8Bytes(value));
}
decode(reader) {
return toUtf8String(super.decode(reader));
}
}
//# sourceMappingURL=string.js.map