UNPKG

2.1 kBTypeScriptView Raw
1/// <reference types="node" />
2import { BigNumber } from "bignumber.js";
3import { LedgerEthTransactionResolution } from "./services/types";
4export declare function splitPath(path: string): number[];
5export declare function hexBuffer(str: string): Buffer;
6export declare function maybeHexBuffer(str: string | null | undefined): Buffer | null | undefined;
7export declare const decodeTxInfo: (rawTx: Buffer) => {
8 decodedTx: any;
9 txType: number | null;
10 chainId: BigNumber;
11 chainIdTruncated: number;
12 vrsOffset: number;
13};
14/**
15 * @ignore for the README
16 *
17 * Helper to convert an integer as a hexadecimal string with the right amount of digits
18 * to respect the number of bytes given as parameter
19 *
20 * @param int Integer
21 * @param bytes Number of bytes it should be represented as (1 byte = 2 caraters)
22 * @returns The given integer as an hexa string padded with the right number of 0
23 */
24export declare const intAsHexBytes: (int: number, bytes: number) => string;
25/**
26 * @ignore for the README
27 *
28 * List of selectors (hexadecimal representation of the used method's signature) related to
29 * ERC20 (Tokens), ERC721/ERC1155 (NFT).
30 * You can verify and/or get more info about them on http://4byte.directory
31 */
32export declare enum ERC20_CLEAR_SIGNED_SELECTORS {
33 APPROVE = "0x095ea7b3",
34 TRANSFER = "0xa9059cbb"
35}
36export declare enum ERC721_CLEAR_SIGNED_SELECTORS {
37 APPROVE = "0x095ea7b3",
38 SET_APPROVAL_FOR_ALL = "0xa22cb465",
39 TRANSFER_FROM = "0x23b872dd",
40 SAFE_TRANSFER_FROM = "0x42842e0e",
41 SAFE_TRANSFER_FROM_WITH_DATA = "0xb88d4fde"
42}
43export declare enum ERC1155_CLEAR_SIGNED_SELECTORS {
44 SET_APPROVAL_FOR_ALL = "0xa22cb465",
45 SAFE_TRANSFER_FROM = "0xf242432a",
46 SAFE_BATCH_TRANSFER_FROM = "0x2eb2c2d6"
47}
48export declare const tokenSelectors: ERC20_CLEAR_SIGNED_SELECTORS[];
49export declare const nftSelectors: (ERC721_CLEAR_SIGNED_SELECTORS | ERC1155_CLEAR_SIGNED_SELECTORS)[];
50export declare const mergeResolutions: (resolutionsArray: Partial<LedgerEthTransactionResolution>[]) => LedgerEthTransactionResolution;
51//# sourceMappingURL=utils.d.ts.map
\No newline at end of file