import { AuditDecryptedKeyParams, BaseCoin, BaseTransaction, BitGoBase, KeyPair, MultisigType, SignedTransaction, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo/sdk-core'; import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo/statics'; import { ExplainTransactionOptions, StxSignTransactionOptions, StxTransactionExplanation } from './types'; import { TransactionBuilder } from './lib/transactionBuilder'; import { AddressDetails, NativeStxBalance, RecoveryInfo, RecoveryOptions, RecoveryTransaction, SingleFungibleTokenBalance, StxNonceResponse } from './lib/iface'; import { TransferBuilder } from './lib/transferBuilder'; import { FungibleTokenTransferBuilder } from './lib/fungibleTokenTransferBuilder'; export declare class Stx extends BaseCoin { protected readonly _staticsCoin: Readonly; constructor(bitgo: BitGoBase, staticsCoin?: Readonly); static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin; getChain(): string; getFamily(): CoinFamily; getFullName(): string; getBaseFactor(): string | number; getTransaction(coinConfig: Readonly): TransactionBuilder; /** inherited doc */ getDefaultMultisigType(): MultisigType; verifyTransaction(params: VerifyTransactionOptions): Promise; /** * Check if address is valid, then make sure it matches the base address. * * @param {VerifyAddressOptions} params * @param {String} params.address - the address to verify * @param {String} params.baseAddress - the base address from the wallet */ isWalletAddress(params: VerifyAddressOptions): Promise; /** * Generate Stacks key pair * * @param {Buffer} seed - Seed from which the new keypair should be generated, otherwise a random seed is used * @returns {Object} object with generated pub and prv */ generateKeyPair(seed?: Buffer): KeyPair; /** * Return boolean indicating whether input is valid public key for the coin * * @param {string} pub the prv to be checked * @returns is it valid? */ isValidPub(pub: string): boolean; /** * Return boolean indicating whether input is valid private key for the coin * * @param {string} prv the prv to be checked * @returns is it valid? */ isValidPrv(prv: string): boolean; isValidAddress(address: string): boolean; /** * Signs stacks transaction * @param params */ signTransaction(params: StxSignTransactionOptions): Promise; parseTransaction(params: any): Promise; /** * Explain a Stacks transaction from txHex * @param params */ explainTransaction(params: ExplainTransactionOptions): Promise; /** * Get URLs of some active public nodes * @returns {String} node url */ getPublicNodeUrl(): string; /** * Get native stacks balance for an account * @param {String} address - stacks address * @returns {Promise} */ protected getNativeStxBalanceFromNode({ address }: { address: string; }): Promise; /** * Get single fungible token balance for an account * @param {String} address - stacks address * @param {String} assetId - fungible token asset id * @returns {Promise} */ protected getSingleFungibleTokenBalanceFromNode({ address, assetId, }: { address: string; assetId: string; }): Promise; /** * Get nonce data specific to an account from a public node * @param {String} address - stacks address * @returns {Promise} */ protected getAccountNonceFromNode({ address }: { address: string; }): Promise; /** * Get stacks transaction estimated fee * @param {String} txHex - hex of stacks transaction payload * @param {Number} txHexLength - length of built serialized transaction * @returns {Promise} - fee estimate (taking the lowest) */ protected getTransactionFeeEstimation({ txHex, txHexLength, }: { txHex: string; txHexLength: number; }): Promise; /** * Format for offline vault signing * @param {BaseTransaction} tx - base transaction * @returns {Promise} */ protected formatForOfflineVault(tx: BaseTransaction): Promise; /** * Get the recoverable amount & fee after subtracting the txn fee * @param {String} serializedHex - serialized txn hex * @param {Number} txHexLength - deserialized txn length * @param {String} balance - total account balance * @param {String} tokenBalance - total token balance * @returns {Promise>} */ protected getRecoverableAmountAndFee(serializedHex: string, txHexLength: number, balance: string, tokenBalance?: string): Promise>; /** * Method to find the right builder for token or native coin transfer * @param {String} contractAddress - token contract address * @param {String} contractName - token contract name * @returns {TransferBuilder|FungibleTokenTransferBuilder} */ protected getTokenOrNativeTransferBuilder(contractAddress?: string, contractName?: string): TransferBuilder | FungibleTokenTransferBuilder; /** * Method to build fungible token transfer transaction * @param {FungibleTokenTransferBuilder} builder - fungible token transfer builder * @param {String} contractAddress - token contract address * @param {String} contractName - token contract name * @param {String[]} pubs - account public keys * @param {Number} nonce - account nonce * @param {AddressDetails} rootAddressDetails - root address details * @param {AddressDetails} destinationAddressDetails - receive address details * @param {String} stxBalance - native stx balance * @returns {Promise} - built transaction */ protected buildTokenTransferTransaction({ builder, contractAddress, contractName, pubs, nonce, rootAddressDetails, destinationAddressDetails, stxBalance, }: { builder: FungibleTokenTransferBuilder; contractAddress: string; contractName: string; pubs: string[]; nonce: number; rootAddressDetails: AddressDetails; destinationAddressDetails: AddressDetails; stxBalance: string; }): Promise; /** * Method to build native transfer transaction * @param {TransferBuilder} builder - transfer builder * @param {String[]} pubs - account public keys * @param {Number} nonce - account nonce * @param {AddressDetails} destinationAddressDetails - receive address details * @param {String} stxBalance - native stx balance * @returns {Promise} - built transaction */ protected buildNativeTransferTransaction({ builder, pubs, nonce, destinationAddressDetails, stxBalance, }: { builder: TransferBuilder; pubs: string[]; nonce: number; destinationAddressDetails: AddressDetails; stxBalance: string; }): Promise; /** * Method that uses appropriate builder and builds transaction depending on token or native coin * @param {String[]} pubs - public keys * @param {AddressDetails} rootAddressDetails - sender address detail * @param {AddressDetails} destinationAddressDetails - receiver address detail * @param {Number} nonce - wallet nonce * @param {String} balance - wallet balance * @param {String | undefined} contractAddress - token contract address * @param {String | undefined} contractName - token contract name * @returns {Promise} built transaction */ protected getNativeOrTokenTransaction({ pubs, rootAddressDetails, destinationAddressDetails, nonce, stxBalance, contractAddressInput, contractName, }: { pubs: string[]; rootAddressDetails: AddressDetails; destinationAddressDetails: AddressDetails; nonce: number; stxBalance: string; contractAddressInput?: string; contractName?: string; }): Promise<{ tx: BaseTransaction; builder: TransferBuilder | FungibleTokenTransferBuilder; }>; /** * Method to recover native stx or sip10 tokens from bitgo hot & cold wallets * @param {String} params.backupKey - encrypted wallet backup key (public or private) * @param {String} params.userKey - encrypted wallet user key (public or private) * @param {String} params.rootAddress - wallet root address * @param {String} params.recoveryDestination - receive address * @param {String} params.bitgoKey - encrypted bitgo public key * @param {String} params.walletPassphrase - wallet password * @param {String} params.contractId - contract id of the token (mandatory for token recovery) * @returns {Promise} RecoveryTransaction.txHex - hex of serialized transaction (signed or unsigned) */ recover(params: RecoveryOptions): Promise; /** @inheritDoc */ auditDecryptedKey(params: AuditDecryptedKeyParams): void; } //# sourceMappingURL=stx.d.ts.map