ethers/lib/utils#Bytes TypeScript Examples

The following examples show how to use ethers/lib/utils#Bytes. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: sign-utils.ts    From shoyu with MIT License 7 votes vote down vote up
getMint721Digest = async (
    provider: any,
    token: string,
    recipient: string,
    tokenIds: BigNumberish[],
    data: Bytes,
    factoryAddress: string,
    nonce: BigNumberish
): Promise<string> => {
    const hash = getHash(
        ["bytes32", "address", "address", "uint256[]", "bytes", "uint256"],
        [MINT_BATCH_721_TYPEHASH, token, recipient, tokenIds, data, nonce]
    );
    const digest = await getDigest(provider, "TokenFactory", factoryAddress, hash);
    return digest;
}
Example #2
Source File: sign-utils.ts    From shoyu with MIT License 7 votes vote down vote up
getMint1155Digest = async (
    provider: any,
    token: string,
    recipient: string,
    tokenIds: BigNumberish[],
    amounts: BigNumberish[],
    data: Bytes,
    factoryAddress: string,
    nonce: BigNumberish
): Promise<string> => {
    const hash = getHash(
        ["bytes32", "address", "address", "uint256[]", "uint256[]", "bytes", "uint256"],
        [MINT_BATCH_1155_TYPEHASH, token, recipient, tokenIds, amounts, data, nonce]
    );
    const digest = await getDigest(provider, "TokenFactory", factoryAddress, hash);
    return digest;
}