Class: BatchTransaction
Properties
Property | Type | Description | Defined in |
---|---|---|---|
batchContract | null | Contract | Parent Batch Smart Contract Used for aggregating all different transaction batches and executing in single transaction call. | execute.ts:39 |
batchProcessingContract | null | Contract | Batch smart contract with methods for executing Batched ETH and ERC20 transfer transactions | execute.ts:33 |
provider | null | Provider | Provider used to interact with the network This is fetched directly if ethereum object is present in Window (being used in browser) | execute.ts:23 |
signer | null | Signer | Signer used as runner for executing smart contracts transactions | execute.ts:28 |
Methods
executeERC20Batch()
executeERC20Batch(
erc20Batch
,allowanceAmount
):Promise
<ContractTransaction
>
Function to generate transaction data of only batch transactions of ERC20 transfers
Parameters
Parameter | Type | Description |
---|---|---|
| takes an array of | |
| total |
Returns
Promise
<ContractTransaction
>
Populated ERC20 Batch transaction calldata of the smart contract call.
Remarks
This function is called internally by processBatchTransaction
, but is also exported from the class for the users to generate the calldata of their batch transactions to use it for their own.
Defined in
execute.ts:252
executeEthBatch()
executeEthBatch(
ethBatch
,totalEthAmount
):Promise
<ContractTransaction
>
Function to generate transaction data of only batch transactions of ETH transfers
Parameters
Parameter | Type | Description |
---|---|---|
| takes an array of | |
|
| Total amount of ETH that the spender is going to transfer |
Returns
Promise
<ContractTransaction
>
Populated ETH Batch transaction calldata of the smart contract call.
Remarks
This function is called internally by processBatchTransaction
, but is also exported from the class for the users to generate the calldata of their batch transactions to use it for their own.
Defined in
execute.ts:226
getTxnLink()
getTxnLink(
hash
?):null
|string
Parameters
Parameter | Type |
---|---|
|
|
Returns
null
| string
Defined in
execute.ts:275
init()
init(
initialize
?):Promise
<boolean
>
Initializes BatchTransaction class by performing setup operations for contracts and class variables
Parameters
Parameter | Type | Description |
---|---|---|
| optional in Browser if ethereum object present. Required in Node env to pass provider, signer or private key. |
Returns
Promise
<boolean
>
true if successful
Defined in
execute.ts:54
processBatchTransactions()
processBatchTransactions(
batchData
,gasPrice
):Promise
<InvalidTransactions
[] |object
>
Function to process the ETH and ERC20 batch transactions
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
|
| User prepared raw transaction array of {BatchData} type | |
|
|
| Optional param if you want to send current gasPrice for this transaction. |
Returns
Promise
<InvalidTransactions
[] | object
>
Promise<{ txn: ethers.TransactionResponse, invalidTxns: InvalidTransactions[] } | InvalidTransactions[]>
Defined in
execute.ts:110