1.9.3 • Published 2 years ago

@getsafle/transaction-controller v1.9.3

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Safle Transactions Controller

This SDK returns the list of all the transactions done by a particular address. The transactions include both incoming and outgoing transactions. Also provided is a functionality to convert the unreadable EVM transaction data to human readable one.

Installation

To install this SDK,

npm install --save @getsafle/transactions-controller

Initialization

Initialize the constructor,

const safleTransactionsController = require('@getsafle/transactions-controller');

const transactionsController = new safleTransactionsController.TransactionController();

Get incoming transactions

This function returns the list of all the incoming transactions.

const incomingTransactions= await transactionsController.getIncomingTransactions({ address, fromBlock, network, apiKey });
  • address - user wallet public address,
  • fromBlock - Start block number
  • network - ethereum network selected/ chain selected
  • apiKey - etherscan/polygonscan api key(based on the network selected)

Get outgoing transactions

This function returns the list of all the outgoing transactions.

const outgoingTransactions= await transactionsController.getOutgoingTransactions({ address, fromBlock, network, apiKey });
  • address - user wallet public address,
  • fromBlock - Start block number
  • network - ethereum network selected/ chain selected
  • apiKey - etherscan/polygonscan api key(based on the network selected)

Get all transactions

This function returns the list of all the transactions on an address (incoming + outgoing)

const transactions= await transactionsController.getTransactions({ address, fromBlock, network, apiKey });
  • address - user wallet public address,
  • fromBlock - Start block number
  • network - ethereum network selected/ chain selected
  • apiKey - etherscan/polygonscan api key(based on the network selected)

Analyze Transactions

This function accepts an EVM transaction hash and analyzes the transaction to output human readable values.

const result = await transactionsController.analyzeTransaction(transactionHash, rpcUrl, network);
  • transactionHash - The transaction hash for the transaction to be analyzed.
  • rpcUrl - RPC URL of the chain of the transaction hash passed.
  • network - Network to be used to query the safleId. valid inputs - mainnet or testnet

Get Transaction Type

This function returns the type of transaction based on the contract function called.

const transactionType = transactionsController.getTransactionType(functionInput, rpcUrl);
  • functionInput - The function name and the input parameter datatype in string format. eg. transfer(address, uint256).
  • rpcUrl - RPC URL of the chain of the transaction hash passed.

Chains supported

  • ethereum
  • polygon
  • bsc
  • bitcoin
  • avalanche
1.9.3

2 years ago

1.9.2

2 years ago

1.9.1

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.1

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.1

3 years ago

1.2.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.0

4 years ago