You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
502 B
18 lines
502 B
"use strict";
|
|
import { toUtf8Bytes, toUtf8String } from "@ethersproject/strings";
|
|
import { DynamicBytesCoder } from "./bytes";
|
|
export class StringCoder extends DynamicBytesCoder {
|
|
constructor(localName) {
|
|
super("string", localName);
|
|
}
|
|
defaultValue() {
|
|
return "";
|
|
}
|
|
encode(writer, value) {
|
|
return super.encode(writer, toUtf8Bytes(value));
|
|
}
|
|
decode(reader) {
|
|
return toUtf8String(super.decode(reader));
|
|
}
|
|
}
|
|
//# sourceMappingURL=string.js.map
|