NerveSwap JS SDK

Start

import nerveswap, { mainnet, testnet } from 'nerveswap-sdk
mainnet() // set up the network, default is mainnet

EVM to NERVE

Check token allowance

const needAuth = await nerveswap.evm.checkAuth({
  provider: 'ethereum', // the wallet collected to the dapp, ex: ethereum/NaboxWallet
  tokenContract: '',
  multySignContract: '',
  address: '', // your evm address
  amount: '' // transfer amount, ex: 1000000000000000000
})

Approve token

nerveswap.evm.approve({
  provider: 'ethereum',
  tokenContract: '',
  multySignContract: '',
  address: ''
});

Cross to NERVE

Get address and pub

NERVE Transfer

Transfer transaction

Withdrawal to L1, add withdrawal fee

Nerve Swap

Calculate the number of swaps

Send swap tx

Nerve Liquidity

Send create liquidity pair tx

Cal the amount of add liquidity

Send add liquidity tx

Cal the amount of remove liquidity

Send remove liquidity tx

Farm

Send farm stake tx

Claim

Unstake

Readme

Last updated