Layer 2 Fulfilment Service
Overview
This SDK will give you the ability to transfer ERC20 tokens via zkSync, Loopring or StarkNET chains to a target address while retaining full custody of the source wallets without other infrastructure to support those chains. You will need to create an API endpoint that Banxa will use to invoke the service and return the transaction hash.
Before you begin
Ensure that you have completed the following prerequisites:
- Provide us your username for npm and we will add you as collaborators
- Login to npm with
npm login
- Install the SDK via
npm install l2_fulfilment_service
- Import the module
import * as l2_fulfilment_service from 'l2-fulfilment_service
Parameters
Parameter | Definition |
---|---|
toAddress | The address of the account the funds are being sent to |
amount | Amount to be sent |
coin | Coin to be sent |
chain | The chain for the coin to be sent on |
privateKey | Generated by you |
privateKeyPath | Path of the file (.txt) containing the privateKey |
Example request
txHash = await l2_fulfilment_service.fullfill(
"0x9945Fe84d915BD1c1dddF9971964c532c9a4A27f",
"0.000001",
'ETH',
'zksync',
"",
'./keys.txt'
)
Description
This request has:
toAddress → 0x9945Fe84d915BD1c1dddF9971964c532c9a4A27f
amount → 0.000001
coin → ETH
chain → zksync
privateKeyPath → /keys.txt
Ability to test the service
- Must use coin:ETH
- Must use chain:zksync
Note that all transactions will occur only on the zkSync testnet (rinkeby) until production approval received from Banxa.
Process
- Complete prerequisites
- Create an API endpoint and provide to Banxa
- Use preferred authentication
- Include required order checks in the API (e.g. Chainalysis, fraud checks)
- Create privateKey and secure as a secret e.g. via Docker (help) or Kubernetes (help)
- Banxa calls the API endpoint on demand with specified parameters (toAddress, amount, coin, chain)
- Your API performs all necessary checks before invoking the Layer 2 Fulfilment Service
- Transaction is broadcast to the network and the transfer is made
- Transaction hash is returned from partner to Banxa via the API response
Please note that the API created by you must:
- Use your preferred authentication - which Banxa will accept and use
- Incorporate any checks for the order to satisfy compliance and note that comprehensive fraud, AML and compliance checks also occur at Banxa
- Return the transaction hash as a string
Updated almost 2 years ago