/**
* @prettier
*/
///
import { BaseCoin as StaticsBaseCoin, CoinFamily } from '@bitgo-beta/statics';
import { BaseCoin, BitGoBase, KeyPair, ParsedTransaction, ParseTransactionOptions as BaseParseTransactionOptions, SignedTransaction, SignTransactionOptions as BaseSignTransactionOptions, TransactionExplanation, VerifyAddressOptions, VerifyTransactionOptions, Eddsa, MPCAlgorithm } from '@bitgo-beta/sdk-core';
import * as request from 'superagent';
export interface SignTransactionOptions extends BaseSignTransactionOptions {
txPrebuild: TransactionPrebuild;
prv: string;
}
export interface TransactionPrebuild {
txHex: string;
key: string;
blockHash: string;
nonce: number;
}
export interface ExplainTransactionOptions {
txPrebuild: TransactionPrebuild;
publicKey: string;
feeInfo: {
fee: string;
};
}
export interface VerifiedTransactionParameters {
txHex: string;
prv: string;
signer: string;
}
export interface NearParseTransactionOptions extends BaseParseTransactionOptions {
txPrebuild: TransactionPrebuild;
publicKey: string;
feeInfo: {
fee: string;
};
}
interface TransactionOutput {
address: string;
amount: string;
}
interface RecoveryOptions {
userKey: string;
backupKey: string;
bitgoKey: string;
recoveryDestination: string;
krsProvider?: string;
walletPassphrase: string;
}
interface NearTx {
serializedTx: string;
}
interface NearTxBuilderParamsFromNode {
nonce: number;
blockHash: string;
}
interface NearFeeConfig {
sendSir: number;
sendNotSir: number;
execution: number;
}
interface ProtocolConfigOutput {
storageAmountPerByte: number;
transferCost: NearFeeConfig;
receiptConfig: NearFeeConfig;
}
declare type TransactionInput = TransactionOutput;
export interface NearParsedTransaction extends ParsedTransaction {
inputs: TransactionInput[];
outputs: TransactionOutput[];
}
export declare type NearTransactionExplanation = TransactionExplanation;
export declare class Near extends BaseCoin {
protected readonly _staticsCoin: Readonly;
constructor(bitgo: BitGoBase, staticsCoin?: Readonly);
protected static initialized: boolean;
protected static MPC: Eddsa;
protected network: string;
static createInstance(bitgo: BitGoBase, staticsCoin?: Readonly): BaseCoin;
allowsAccountConsolidations(): boolean;
/**
* Flag indicating if this coin supports TSS wallets.
* @returns {boolean} True if TSS Wallets can be created for this coin
*/
supportsTss(): boolean;
getMPCAlgorithm(): MPCAlgorithm;
supportsStaking(): boolean;
getChain(): string;
getBaseChain(): string;
getFamily(): CoinFamily;
getFullName(): string;
getBaseFactor(): any;
/**
* Flag for sending value of 0
* @returns {boolean} True if okay to send 0 value, false otherwise
*/
valuelessTransferAllowed(): boolean;
/**
* Generate ed25519 key pair
*
* @param seed
* @returns {Object} object with generated pub, prv
*/
generateKeyPair(seed?: Buffer): KeyPair;
/**
* Return boolean indicating whether input is valid public key for the coin.
*
* @param {String} pub the pub to be checked
* @returns {Boolean} is it valid?
*/
isValidPub(pub: string): boolean;
/**
* Return boolean indicating whether the supplied private key is a valid near private key
*
* @param {String} prv the prv to be checked
* @returns {Boolean} is it valid?
*/
isValidPrv(prv: string): boolean;
/**
* Return boolean indicating whether input is valid public key for the coin
*
* @param {String} address the pub to be checked
* @returns {Boolean} is it valid?
*/
isValidAddress(address: string): boolean;
/** @inheritDoc */
signMessage(key: KeyPair, message: string | Buffer): Promise;
/**
* Explain/parse transaction
* @param params
*/
explainTransaction(params: ExplainTransactionOptions): Promise;
verifySignTransactionParams(params: SignTransactionOptions): VerifiedTransactionParameters;
/**
* Assemble keychain and half-sign prebuilt transaction
*
* @param params
* @param params.txPrebuild {TransactionPrebuild} prebuild object returned by platform
* @param params.prv {String} user prv
* @param callback
* @returns {Bluebird}
*/
signTransaction(params: SignTransactionOptions): Promise;
/**
* Builds a funds recovery transaction without BitGo
* @param params
*/
recover(params: RecoveryOptions): Promise;
/**
* Make a request to one of the public EOS nodes available
* @param params.payload
*/
protected getDataFromNode(params: {
payload?: Record;
}): Promise;
protected getAccessKey({ accountId, bs58EncodedPublicKey, }: {
accountId: string;
bs58EncodedPublicKey: string;
}): Promise;
protected getAccountBalance(accountId: string, storageAmountPerByte: number): Promise;
protected getProtocolConfig(): Promise;
protected getGasPrice(blockHash: string): Promise;
protected getPublicNodeUrls(): string[];
parseTransaction(params: NearParseTransactionOptions): Promise;
isWalletAddress(params: VerifyAddressOptions): boolean;
verifyTransaction(params: VerifyTransactionOptions): Promise;
private getBuilder;
}
export {};
//# sourceMappingURL=near.d.ts.map