method.d.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { TronWeb } from '../../tronweb.js';
  2. import { Contract } from './index.js';
  3. export interface CallOptions {
  4. feeLimit?: number;
  5. callValue?: number;
  6. callTokenValue?: number;
  7. callTokenId?: number;
  8. userFeePercentage?: number;
  9. shouldPollResponse?: boolean;
  10. from?: string | false;
  11. rawParameter?: string;
  12. _isConstant?: true;
  13. }
  14. export interface SendOptions {
  15. from?: string | false;
  16. feeLimit?: number;
  17. callValue?: number;
  18. rawParameter?: string;
  19. userFeePercentage?: number;
  20. shouldPollResponse?: boolean;
  21. pollTimes?: number;
  22. rawResponse?: boolean;
  23. keepTxID?: boolean;
  24. }
  25. import type { FunctionFragment, FallbackFragment, ReceiveFragment, EventFragment, AbiInputsType, AbiOutputsType } from '../../types/ABI.js';
  26. export type AbiFragmentNoErrConstructor = FunctionFragment | EventFragment | FallbackFragment | ReceiveFragment;
  27. export declare class Method {
  28. tronWeb: TronWeb;
  29. contract: Contract;
  30. abi: AbiFragmentNoErrConstructor;
  31. name: string;
  32. inputs: AbiInputsType;
  33. outputs: AbiOutputsType;
  34. functionSelector: string | null;
  35. signature: string;
  36. defaultOptions: {
  37. feeLimit: number;
  38. callValue: number;
  39. userFeePercentage: number;
  40. shouldPollResponse: boolean;
  41. };
  42. constructor(contract: Contract, abi: AbiFragmentNoErrConstructor);
  43. decodeInput(data: string): any[];
  44. onMethod(...args: any[]): {
  45. call: (options?: CallOptions) => Promise<any[]>;
  46. send: (options?: SendOptions, privateKey?: string | false) => Promise<any>;
  47. };
  48. _call(types: [], args: [], options?: CallOptions): Promise<any[]>;
  49. _send(types: [], args: [], options?: SendOptions, privateKey?: string | false): Promise<any>;
  50. }