PHP WebShell

Текущая директория: /opt/BitGoJS/modules/sdk-coin-algo/dist/src/lib

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

import { BaseCoin as CoinConfig } from '@bitgo/statics';
import BigNumber from 'bignumber.js';
import algosdk from 'algosdk';
import { Transaction } from './transaction';
import { KeyPair } from './keyPair';
import { BaseAddress, BaseFee, BaseKey, BaseTransactionBuilder, TransactionType } from '@bitgo/sdk-core';
export declare const MAINNET_GENESIS_ID = "mainnet-v1.0";
export declare const MAINNET_GENESIS_HASH = "wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=";
export declare const TESTNET_GENESIS_ID = "testnet-v1.0";
export declare const TESTNET_GENESIS_HASH = "SGO1GKSzyE7IEPItTxCByw9x8FmnrCDexi9/cOUJOiI=";
export declare const BETANET_GENESIS_ID = "betanet-v1.0";
export declare const BETANET_GENESIS_HASH = "mFgazF+2uRS1tMiL9dsj01hJGySEmPN28B/TjjvpVW0=";
export declare abstract class TransactionBuilder extends BaseTransactionBuilder {
    protected _transaction: Transaction;
    protected _keyPairs: KeyPair[];
    protected _fee: number;
    protected _isFlatFee: boolean;
    protected _sender: string;
    protected _genesisHash: string;
    protected _genesisId: string;
    protected _firstRound: number;
    protected _lastRound: number;
    protected _lease?: Uint8Array;
    protected _note?: Uint8Array;
    protected _reKeyTo?: string;
    protected _suggestedParams: algosdk.SuggestedParams;
    constructor(coinConfig: Readonly<CoinConfig>);
    /**
     * Sets the fee.
     *
     * The minimum fee is 1000 microalgos.
     *
     * @param {BaseFee} feeObj The amount to pay to the fee sink denoted in microalgos
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    fee(feeObj: BaseFee): this;
    /**
     * Sets whether the fee is a flat fee.
     *
     * A flat fee is the fee for the entire transaction whereas a normal fee
     * is a fee for every byte in the transaction.
     *
     * @param {boolean} isFlatFee Whether the fee should be specified as a flat fee.
     * @returns {TransactionBuilder} This transaction builder.
     */
    isFlatFee(isFlatFee: boolean): this;
    /**
     * Sets the transaction sender.
     *
     * @param {BaseAddress} sender The sender account
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    sender(sender: BaseAddress): this;
    /**
     * Sets the genesis id.
     *
     * @param {string} genesisId The genesis id.
     * @example "mainnet-v1.0"
     *
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    genesisId(genesisId: string): this;
    /**
     * Sets the genesis hash.
     *
     * The genesis hash must be base64 encoded.
     *
     * @param {string} genesisHash The genesis hash.
     * @example "wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8="
     *
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    genesisHash(genesisHash: string): this;
    /**
     * Sets the genesis id and hash to mainnet.
     *
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/algorand-networks/mainnet/#genesis-id
     * @see https://developer.algorand.org/docs/reference/algorand-networks/mainnet/#genesis-hash
     */
    mainnet(): this;
    /**
     * Sets the genesis id and hash to testnet.
     *
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/algorand-networks/testnet/#genesis-id
     * @see https://developer.algorand.org/docs/reference/algorand-networks/testnet/#genesis-hash
     */
    testnet(): this;
    /**
     * Sets the genesis id and hash to betanet.
     *
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/algorand-networks/betanet/#genesis-id
     * @see https://developer.algorand.org/docs/reference/algorand-networks/betanet/#genesis-hash
     */
    betanet(): this;
    /**
     * Sets the first round.
     *
     * @param {number} round The first protocol round on which this txn is valid.
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    firstRound(round: number): this;
    /**
     * Sets the last round.
     *
     * @param {number} round The first protocol round on which this txn is valid.
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    lastRound(round: number): this;
    /**
     * Sets the lease on the transaction.
     *
     * A lease is a mutex on the transaction that prevents any other transaction
     * from being sent with the same lease until the prior transaction's last
     * round has passed.
     *
     * @param {Uint8Array} lease The lease to put the transaction.
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    lease(lease: Uint8Array): this;
    /**
     * Sets the note for the transaction.
     *
     * @param {Uint8Array} note Arbitrary data for sender to store.
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    note(note: Uint8Array): this;
    /**
     * Sets the authorized address.
     *
     * The authorized asset will be used to authorize all future transactions.
     *
     * @param {BaseAddress} authorizer The address to delegate authorization authority to.
     * @returns {TransactionBuilder} This transaction builder.
     *
     * @see https://developer.algorand.org/docs/reference/transactions/
     */
    reKeyTo(authorizer: BaseAddress): this;
    /** @inheritdoc */
    validateAddress({ address }: BaseAddress): void;
    /** @inheritdoc */
    protected buildImplementation(): Promise<Transaction>;
    /**
     * Builds the algorand transaction.
     */
    protected abstract buildAlgoTxn(): algosdk.Transaction;
    /**
     * The transaction type.
     */
    protected abstract get transactionType(): TransactionType;
    /** @inheritdoc */
    protected fromImplementation(rawTransaction: Uint8Array | string): Transaction;
    /** @inheritdoc */
    protected signImplementation({ key }: BaseKey): Transaction;
    numberOfSigners(num: number): this;
    setSigners(addrs: string | string[]): this;
    /**
     * Sets the number of signers required to sign the transaction.
     *
     * The number of signers cannot be set to a negative value.
     *
     * @param {number} n The number of signers.
     * @returns {TransactionBuilder} This transaction builder.
     */
    numberOfRequiredSigners(n: number): this;
    /**
     * @inheritdoc
     * @see https://developer.algorand.org/docs/features/accounts/#transformation-private-key-to-base64-private-key
     */
    validateKey({ key }: BaseKey): void;
    /** @inheritdoc */
    validateRawTransaction(rawTransaction: Uint8Array | string): void;
    /** @inheritdoc */
    validateTransaction(_: Transaction): void;
    private validateBaseFields;
    /** @inheritdoc */
    validateValue(value: BigNumber): void;
    /** @inheritdoc */
    protected get transaction(): Transaction;
    /** @inheritdoc */
    protected set transaction(transaction: Transaction);
    /**
     * Convenience method to retrieve the algosdk suggested parameters.
     *
     * @returns {algosdk.SuggestedParams} The algosdk suggested parameters.
     */
    protected get suggestedParams(): algosdk.SuggestedParams;
}
//# sourceMappingURL=transactionBuilder.d.ts.map

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


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