UNPKG

@0xsequence/connect

Version:
96 lines 3.21 kB
import { SequenceAPIClient } from '@0xsequence/api'; import { commons } from '@0xsequence/core'; import { ContractType, TxnTransferType } from '@0xsequence/indexer'; export declare enum DecodingType { APPROVE = "approve", TRANSFER = "transfer", SWAP = "swap", AWARD_ITEM = "awardItem", UNIMPLEMENTED = "unimplemented", UNKNOWN = "unknown" } export interface BaseDecoding { type: DecodingType; signature: string; byteSignature: string; methodName: string; target: string; value: string; } export interface TransferProps extends BaseDecoding { type: DecodingType.TRANSFER; transferType: TxnTransferType; contractAddress: string; contractType: ContractType; from: string; to: string; tokenIds?: string[]; amounts: string[]; isNetworkFee?: boolean; } export interface AwardItemProps extends BaseDecoding { type: DecodingType.AWARD_ITEM; contractAddress: string; to: string; amount: string; } export interface UnknownProps extends BaseDecoding { type: DecodingType.UNKNOWN; } export type TxnProps = TransferProps | AwardItemProps; export declare const encodeTransactions: (transactions: Array<commons.transaction.Transaction | commons.transaction.TransactionEncoded>) => commons.transaction.TransactionEncoded[]; export declare enum ByteSignature { SEQUENCE_DEPLOY = "0x32c02a14", SEQUENCE_PUBLISH_CONFIG = "0x44d466c2", SEQUENCE_UPDATE_IMAGE_HASH = "0x29561426", SEQUENCE_UPDATE_IMPLEMENTATION = "0x025b22bc", SEQUENCE_REQUIRE_SESSION_NONCE = "0x8853baa0", EXECUTE = "0x7a9a1628", SELF_EXECUTE = "0x61c2926c", APPROVE = "0x095ea7b3", TRANSFER = "0xa9059cbb", DEPOSIT = "0xd0e30db0", WITHDRAW = "0x2e1a7d4d", ERC721_SAFE_TRANSFER_FROM = "0x42842e0e", ERC721_SAFE_TRANSFER_FROM_WITH_DATA = "0xb88d4fde", ERC1155_SAFE_TRANSFER_FROM = "0xf242432a", ERC1155_SAFE_BATCH_TRANSFER_FROM = "0x2eb2c2d6", NIFTYSWAP_BUY_TOKENS = "0xd93e8aaa", TRANSFORM_ERC20 = "0x415565b0", OUTBOUND_TRANSFER_TO = "0xa44bbb15", CELER_SEND = "0xa5977fbb", UNISWAPV3_MULTICALL = "0x5ae401dc", UNISWAPV2_SWAP_EXACT_TOKENS_FOR_TOKENS = "0x38ed1739", UNISWAPV2_SWAP_TOKENS_FOR_EXACT_TOKENS = "0x8803dbee", UNISWAPV2_SWAP_EXACT_ETH_FOR_TOKENS = "0x7ff36ab5", UNISWAPV2_SWAP_ETH_FOR_EXACT_TOKENS = "0xfb3bdb41", UNISWAPV2_SWAP_TOKENS_FOR_EXACT_ETH = "0x4a25d94a", UNISWAPV2_SWAP_EXACT_TOKENS_FOR_ETH = "0x18cbafe5", AWARD_ITEM = "0xcf378343" } export interface SafeBatchTransferFromArgs { _from: string; _to: string; _ids: string[]; _amounts: string[]; _data: string; } export interface ERC721SafeTransferFromArgs { from: string; to: string; tokenId: string; data?: string; } export interface ERC1155SafeTransferFromArgs { _from: string; _to: string; _id: string; _amount: string; _data: string; } export interface TransferArgs { recipient: string; amount: number; } export declare const decodeTransactions: (apiClient: SequenceAPIClient, accountAddress: string, txns: commons.transaction.Transaction[]) => Promise<TxnProps[]>; //# sourceMappingURL=txnDecoding.d.ts.map