PHP WebShell

Текущая директория: /usr/lib/node_modules/bitgo/node_modules/@bitgo/abstract-eth/dist/src/lib

Просмотр файла: transactionBuilder.d.ts

import { BaseCoin as CoinConfig } from '@bitgo/statics';
import EthereumCommon from '@ethereumjs/common';
import BigNumber from 'bignumber.js';
import { BaseAddress, BaseKey, BaseTransaction, BaseTransactionBuilder, TransactionType } from '@bitgo/sdk-core';
import { KeyPair } from './keyPair';
import { Fee, TxData } from './iface';
import { ERC1155TransferBuilder } from './transferBuilders/transferBuilderERC1155';
import { ERC721TransferBuilder } from './transferBuilders/transferBuilderERC721';
import { Transaction } from './transaction';
import { TransferBuilder } from './transferBuilder';
/**
 * EthereumLike transaction builder.
 */
export declare abstract class TransactionBuilder extends BaseTransactionBuilder {
    protected _type: TransactionType;
    protected _common: EthereumCommon;
    protected _sourceKeyPair: KeyPair;
    private _transaction;
    private _counter;
    private _fee;
    protected _value: string;
    private _txSignature;
    private _walletOwnerAddresses;
    protected _walletVersion: number;
    private _forwarderAddress;
    private _tokenAddress;
    protected _transfer: TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder;
    private _contractAddress;
    private _contractCounter;
    private _forwarderVersion;
    private _initCode;
    private _baseAddress;
    private _feeAddress;
    private _data;
    private _salt;
    protected _walletSimpleByteCode: string;
    /**
     * Public constructor.
     *
     * @param _coinConfig
     */
    constructor(_coinConfig: Readonly<CoinConfig>);
    /** @inheritdoc */
    protected buildImplementation(): Promise<BaseTransaction>;
    protected getTransactionData(): TxData;
    /** @inheritdoc */
    protected fromImplementation(rawTransaction: string, isFirstSigner?: boolean): Transaction;
    /**
     * Load the builder data using the deserialized transaction
     *
     * @param {TxData} transactionJson the deserialized transaction json
     * @param {boolean} isFirstSigner if the transaction is being signed by the first signer
     */
    protected loadBuilderInput(transactionJson: TxData, isFirstSigner?: boolean): void;
    protected setTransactionTypeFields(decodedType: TransactionType, transactionJson: TxData, isFirstSigner?: boolean): void;
    /** @inheritdoc */
    protected signImplementation(key: BaseKey): BaseTransaction;
    /** @inheritdoc */
    validateAddress(address: BaseAddress): void;
    /** @inheritdoc */
    validateKey(key: BaseKey): void;
    /**
     * Validate the raw transaction is either a JSON or
     * a hex encoded transaction
     *
     * @param {any} rawTransaction The raw transaction to be validated
     */
    validateRawTransaction(rawTransaction: any): void;
    private isEip1559Txn;
    private isRLPDecodable;
    protected validateBaseTransactionFields(): void;
    /** @inheritdoc */
    validateTransaction(transaction: BaseTransaction): void;
    /**
     * Check wallet owner addresses for wallet initialization transactions are valid or throw.
     */
    private validateWalletInitializationFields;
    /**
     * Check if a token address for the tx was defined or throw.
     */
    private validateTokenAddress;
    /**
     * Check if a forwarder address for the tx was defined or throw.
     */
    private validateForwarderAddress;
    /**
     * Check if a contract address for the wallet was defined or throw.
     */
    private validateContractAddress;
    /**
     * Checks if a contract call data field was defined or throws otherwise
     */
    private validateDataField;
    private setContract;
    validateValue(value: BigNumber): void;
    /**
     * The type of transaction being built.
     *
     * @param {TransactionType} type
     */
    type(type: TransactionType): void;
    /**
     * Set the transaction fees. Low fees may get a transaction rejected or never picked up by bakers.
     *
     * @param {Fee} fee Baker fees. May also include the maximum gas to pay
     */
    fee(fee: Fee): void;
    /**
     * Set the transaction counter to prevent submitting repeated transactions.
     *
     * @param {number} counter The counter to use
     */
    counter(counter: number): void;
    /**
     * The value to send along with this transaction. 0 by default
     *
     * @param {string} value The value to send along with this transaction
     */
    value(value: string): void;
    protected buildBase(data: string): TxData;
    /**
     * Set one of the owners of the multisig wallet.
     *
     * @param {string} address An Ethereum address
     */
    owner(address: string): void;
    /**
     * Build a transaction for a generic multisig contract.
     *
     * @returns {TxData} The Ethereum transaction data
     */
    protected buildWalletInitializationTransaction(walletVersion?: number): TxData;
    /**
     * Returns the smart contract encoded data
     *
     * @param {string[]} addresses - the contract signers
     * @returns {string} - the smart contract encoded data
     */
    protected getContractData(addresses: string[]): string;
    contract(address: string): void;
    /**
     * Gets the transfer funds builder if exist, or creates a new one for this transaction and returns it
     *
     * @param {string} data transfer data to initialize the transfer builder with, empty if none given
     * @param {boolean} isFirstSigner whether the transaction is being signed by the first signer
     * @returns {TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder} the transfer builder
     */
    abstract transfer(data?: string, isFirstSigner?: boolean): TransferBuilder | ERC721TransferBuilder | ERC1155TransferBuilder;
    /**
     * Returns the serialized sendMultiSig contract method data
     *
     * @returns {string} serialized sendMultiSig data
     */
    getSendData(): string;
    /**
     * Decide if the coin uses non-packed encoding for tx data
     *
     * @returns {boolean} true if the coin uses non-packed encoding for tx data
     */
    coinUsesNonPackedEncodingForTxData(): boolean;
    private buildSendTransaction;
    /**
     * Set the contract transaction nonce to calculate the forwarder address.
     *
     * @param {number} contractCounter The counter to use
     */
    contractCounter(contractCounter: number): void;
    /**
     * Build a transaction to create a forwarder.
     *
     * @returns {TxData} The Ethereum transaction data
     */
    private buildAddressInitializationTransaction;
    /**
     * Set the forwarder address to flush
     *
     * @param {string} address The address to flush
     */
    forwarderAddress(address: string): void;
    /**
     * Set the address of the ERC20 token contract that we are flushing tokens for
     *
     * @param {string} address the contract address of the token to flush
     */
    tokenAddress(address: string): void;
    /**
     * Build a transaction to flush tokens from a forwarder.
     *
     * @returns {TxData} The Ethereum transaction data
     */
    private buildFlushTokensTransaction;
    /**
     * Build a transaction to flush tokens from a forwarder.
     *
     * @returns {TxData} The Ethereum transaction data
     */
    private buildFlushCoinsTransaction;
    data(encodedCall: string): void;
    private buildGenericContractCallTransaction;
    /** @inheritdoc */
    protected get transaction(): Transaction;
    /** @inheritdoc */
    protected set transaction(transaction: Transaction);
    /**
     * Get the final v value. Final v is described in EIP-155.
     *
     * @protected for internal use when the enableFinalVField flag is true.
     */
    protected getFinalV(): string;
    /**
     * Set the forwarder version for address to be initialized
     *
     * @param {number} version forwarder version
     */
    forwarderVersion(version: number): void;
    /**
     * Set the salt to create the address using create2
     *
     * @param {string} salt The salt to create the address using create2, hex string
     */
    salt(salt: string): void;
    /**
     * Take the implementation address for the proxy contract, and get the binary initcode for the associated proxy
     *
     * @param {string} implementationAddress The address of the implementation contract
     */
    initCode(implementationAddress: string): void;
    /**
     * Set the wallet version for wallet to be initialized
     *
     * @param {number} version wallet version
     */
    walletVersion(version: number): void;
    /**
     * Set the base address of the wallet
     *
     * @param {string} address The wallet contract address
     */
    baseAddress(address: string): void;
    /**
     * Set the fee address of the wallet
     *
     * @param {string} address The fee address of the wallet
     */
    feeAddress(address: string): void;
    /**
     * Get the wallet version for wallet
     */
    getWalletVersion(): number;
}
//# sourceMappingURL=transactionBuilder.d.ts.map

Выполнить команду


Для локальной разработки. Не используйте в интернете!