UNPKG

saepenatus

Version:

Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, mul

29 lines 837 B
"use strict"; import { arrayify, hexlify } from "@ethersproject/bytes"; import { Coder } from "./abstract-coder"; export class DynamicBytesCoder extends Coder { constructor(type, localName) { super(type, type, localName, true); } defaultValue() { return "0x"; } encode(writer, value) { value = arrayify(value); let length = writer.writeValue(value.length); length += writer.writeBytes(value); return length; } decode(reader) { return reader.readBytes(reader.readValue().toNumber(), true); } } export class BytesCoder extends DynamicBytesCoder { constructor(localName) { super("bytes", localName); } decode(reader) { return reader.coerce(this.name, hexlify(super.decode(reader))); } } //# sourceMappingURL=bytes.js.map