@descent-protocol/sdk
Version:
A Typescript library for interacting with the Descent Protocol
46 lines (45 loc) • 1.79 kB
TypeScript
import { InterfaceAbi, TransactionRequest, ethers } from 'ethers';
import { DescentClass } from '..';
export interface GetTransactionConfigParams {
from: NonNullable<TransactionRequest['from']>;
to: NonNullable<TransactionRequest['to']>;
data: NonNullable<TransactionRequest['data']>;
value?: TransactionRequest['value'];
gasLimit?: TransactionRequest['gasLimit'];
gasPrice?: TransactionRequest['gasPrice'];
nonce?: TransactionRequest['nonce'];
maxPriorityFeePerGas?: TransactionRequest['maxPriorityFeePerGas'];
maxFeePerGas?: TransactionRequest['maxFeePerGas'];
}
export type EstimateGasParams = {
abi: InterfaceAbi;
args: any;
} & Required<Pick<TransactionRequest, 'from' | 'to' | 'value'>>;
export declare class Internal {
private descent;
constructor(descent: DescentClass);
/**
* Returns TransactionObject for any calls.
*
* Parameter `gasPrice` must be defined in mode `node` and is optional in mode `browser`.
*
* Parameter `nonce` only takes effect in mode `node`.
*
* @param params.from
* @param params.to
* @param params.callData
* @param params.value (optional)
* @param params.gasLimit (optional)
* @param params.gasPrice (optional only for "browser" mode)
* @param params.nonce (optional) mostly for "node" mode
* @param params.maxFeePerGas (optional only for "browser" mode)
* @param params.maxPriorityFeePerGas (optional only for "browser" mode)
*/
getTransactionConfig: (params: GetTransactionConfigParams) => Promise<TransactionRequest>;
private getNonce;
private getGas;
/**
* Returns the ABI interface for any Descent Protocol contract.
*/
getInterface: (abiItems: InterfaceAbi) => ethers.Interface;
}