-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
348 changed files
with
8,116 additions
and
7,621 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"root": true, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"@typescript-eslint" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/eslint-recommended", | ||
"plugin:@typescript-eslint/recommended" | ||
], | ||
"rules": { | ||
"semi": ["error", "never"], | ||
"@typescript-eslint/ban-ts-comment": "off", | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/explicit-module-boundary-types": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,4 +16,6 @@ jobs: | |
|
||
- run: yarn install | ||
|
||
- run: yarn build | ||
- run: yarn build | ||
|
||
- run: yarn lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import {get, post} from '../connector/tatum'; | ||
import {TransactionHash} from '../model'; | ||
import {get, post} from '../connector/tatum' | ||
import {TransactionHash} from '../model' | ||
|
||
/** | ||
* Broadcasts signed transaction to the Bnb blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BnbBroadcast" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bnbBroadcast = async (txData: string, signatureId?: string): Promise<TransactionHash> => | ||
post(`/v3/bnb/broadcast`, {txData, signatureId}); | ||
post(`/v3/bnb/broadcast`, {txData, signatureId}) | ||
|
||
/** | ||
* Returns account by address from Bnb blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BnbGetAccount" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bnbGetAccount = async (address: string): Promise<{ account_number: number, address: string, sequence: number }> => get(`/v3/bnb/account/${address}`); | ||
export const bnbGetAccount = async (address: string): Promise<{ account_number: number, address: string, sequence: number }> => get(`/v3/bnb/account/${address}`) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
import BigNumber from 'bignumber.js'; | ||
import {get, post} from '../connector/tatum'; | ||
import {EstimateGasEth, EthBlock, EthEstimateGas, EthTx, TransactionHash} from '../model'; | ||
import BigNumber from 'bignumber.js' | ||
import {get, post} from '../connector/tatum' | ||
import {EstimateGasEth, EthBlock, EthEstimateGas, EthTx, TransactionHash} from '../model' | ||
|
||
/** | ||
* Broadcasts signed transaction to the Bsc blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscBroadcast" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscBroadcast = async (txData: string, signatureId?: string): Promise<TransactionHash> => | ||
post(`/v3/bsc/broadcast`, {txData, signatureId}); | ||
post(`/v3/bsc/broadcast`, {txData, signatureId}) | ||
|
||
/** | ||
* Returns a number of outgoing BSC transactions for the address from Bsc blockchain. <br> | ||
* When a transaction is sent, there can be multiple outgoing transactions, which are not yet processed by the blockchain. | ||
* To distinguish between them, there is a counter called a nonce, which represents the order of the transaction in the list of outgoing transactions. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscGetTransactionCount" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetTransactionsCount = async (address: string): Promise<number> => get(`/v3/bsc/transaction/count/${address}`); | ||
export const bscGetTransactionsCount = async (address: string): Promise<number> => get(`/v3/bsc/transaction/count/${address}`) | ||
|
||
/** | ||
* Returns information about Bsc blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscGetCurrentBlock" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetCurrentBlock = async (): Promise<number> => get(`/v3/bsc/block/current`); | ||
export const bscGetCurrentBlock = async (): Promise<number> => get(`/v3/bsc/block/current`) | ||
|
||
/** | ||
* Returns block by its hash from Bsc blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscGetBlock" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetBlock = async (hash: string): Promise<EthBlock> => get(`/v3/bsc/block/${hash}`); | ||
export const bscGetBlock = async (hash: string): Promise<EthBlock> => get(`/v3/bsc/block/${hash}`) | ||
|
||
/** | ||
* Returns balance on address from Bsc blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscGetBalance" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetAccountBalance = async (address: string): Promise<BigNumber> => get(`/v3/bsc/account/balance/${address}`); | ||
export const bscGetAccountBalance = async (address: string): Promise<BigNumber> => get(`/v3/bsc/account/balance/${address}`) | ||
|
||
/** | ||
* TODO: This endpoint dont exists? @SamuelSramko | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscBep20GetBalance" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetAccountBep20Address = async (address: string, contractAddress: string): Promise<number> => | ||
get(`/v3/bsc/account/balance/bep20/${address}?contractAddress=${contractAddress}`); | ||
get(`/v3/bsc/account/balance/bep20/${address}?contractAddress=${contractAddress}`) | ||
|
||
/** | ||
* Returns transaction by hash from Bsc blockchain. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscGetTransaction" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscGetTransaction = async (hash: string): Promise<EthTx> => get(`/v3/bsc/transaction/${hash}`); | ||
export const bscGetTransaction = async (hash: string): Promise<EthTx> => get(`/v3/bsc/transaction/${hash}`) | ||
|
||
/** | ||
* Returns gasLimit and gasPrice estimation of the transaction from Bsc blockchain. <br> | ||
* Gas price is obtained from https://explorer.bitquery.io/bsc/gas. <br> | ||
* For more details, see <a href="https://tatum.io/apidoc#operation/BscEstimateGas" target="_blank">Tatum API documentation</a> | ||
*/ | ||
export const bscEstimateGas = (body: EstimateGasEth): Promise<EthEstimateGas> => post('/v3/bsc/gas', body, EstimateGasEth); | ||
export const bscEstimateGas = (body: EstimateGasEth): Promise<EthEstimateGas> => post('/v3/bsc/gas', body, EstimateGasEth) |
Oops, something went wrong.