How to use the @ethersproject/bytes.hexValue function in @ethersproject/bytes

To help you get started, we’ve selected a few @ethersproject/bytes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ethers-io / ethers.js / packages / providers / lib.esm / formatter.js View on Github external
blockTag(blockTag) {
        if (blockTag == null) {
            return "latest";
        }
        if (blockTag === "earliest") {
            return "0x0";
        }
        if (blockTag === "latest" || blockTag === "pending") {
            return blockTag;
        }
        if (typeof (blockTag) === "number" || isHexString(blockTag)) {
            return hexValue(blockTag);
        }
        throw new Error("invalid blockTag");
    }
    // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.
github ethers-io / ethers.js / packages / providers / lib / formatter.js View on Github external
Formatter.prototype.blockTag = function (blockTag) {
        if (blockTag == null) {
            return "latest";
        }
        if (blockTag === "earliest") {
            return "0x0";
        }
        if (blockTag === "latest" || blockTag === "pending") {
            return blockTag;
        }
        if (typeof (blockTag) === "number" || bytes_1.isHexString(blockTag)) {
            return bytes_1.hexValue(blockTag);
        }
        throw new Error("invalid blockTag");
    };
    // Requires a hash, optionally requires 0x prefix; returns prefixed lowercase hash.
github ethers-io / ethers.js / packages / providers / lib / json-rpc-provider.js View on Github external
["gasLimit", "gasPrice", "nonce", "value"].forEach(function (key) {
            if (transaction[key] == null) {
                return;
            }
            var value = bytes_1.hexValue(transaction[key]);
            if (key === "gasLimit") {
                key = "gas";
            }
            result[key] = value;
        });
        ["from", "to", "data"].forEach(function (key) {
github ethers-io / ethers.js / packages / providers / lib / etherscan-provider.js View on Github external
function getTransactionString(transaction) {
    var result = [];
    for (var key in transaction) {
        if (transaction[key] == null) {
            continue;
        }
        var value = bytes_1.hexlify(transaction[key]);
        if ({ gasLimit: true, gasPrice: true, nonce: true, value: true }[key]) {
            value = bytes_1.hexValue(value);
        }
        result.push(key + "=" + value);
    }
    return result.join("&");
}
function getResult(result) {
github ethers-io / ethers.js / packages / providers / lib.esm / etherscan-provider.js View on Github external
function getTransactionString(transaction) {
    const result = [];
    for (let key in transaction) {
        if (transaction[key] == null) {
            continue;
        }
        let value = hexlify(transaction[key]);
        if ({ gasLimit: true, gasPrice: true, nonce: true, value: true }[key]) {
            value = hexValue(value);
        }
        result.push(key + "=" + value);
    }
    return result.join("&");
}
function getResult(result) {
github ethers-io / ethers.js / packages / providers / lib.esm / json-rpc-provider.js View on Github external
["gasLimit", "gasPrice", "nonce", "value"].forEach(function (key) {
            if (transaction[key] == null) {
                return;
            }
            const value = hexValue(transaction[key]);
            if (key === "gasLimit") {
                key = "gas";
            }
            result[key] = value;
        });
        ["from", "to", "data"].forEach(function (key) {
github ethers-io / ethers.js / packages / providers / lib / base-provider.js View on Github external
                                position: Promise.resolve(position).then(function (p) { return bytes_1.hexValue(p); })
                            })];
github ethers-io / ethers.js / packages / providers / lib.esm / base-provider.js View on Github external
                position: Promise.resolve(position).then((p) => hexValue(p))
            });