web3-utils#fromAscii TypeScript Examples

The following examples show how to use web3-utils#fromAscii. 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: web3-pure.ts    From rubic-sdk with GNU General Public License v3.0 5 votes vote down vote up
/**
     * @description Converts ascii address to bytes32 format
     * @param address Address to convert.
     */
    public static asciiToBytes32(address: string): string {
        const bytes = fromAscii(address);
        return `0x${bytes.slice(2).padStart(64, '0')}`;
    }