A web server that works as a middleware between Kima Transaction Widget and Kima Chain. Once it receives a transaction request from the frontend (Kima Transaction Widget), it will submit a transaction to Kima Chain using pre-defined wallet's private key and returns transaction id to the frontend. This wallet is called Developer Wallet, and it should have enough KIMA token to pay gas fee.
- Create a
.envfile - Copy the values from
.env.sampleinto your.envand fill in the values - Repeat for the Docker ENV files
/envs/dev.envand/envs/prod.env - To run locally:
npm run dev - Otherwise build the
docker-composeand run it - Use
docker-compose.ymlfor dev,docker-compose-prod.ymlfor prod
See OpenAPI documentation at /docs for more details (only available when NODE_ENV is development). The following is an overview of how the routes are used together.
- Get various info for the frontend from
/chains/*like supported chains, tokens, pool addresses, etc. GET /submit/fee: get the fees. Use this to determine the total amount for the ERC20 approval. The approval must be completed before submitting the transaction or the transfer will fail.POST /submit: submit will initiate the Kima Transaction and return a transaction id that can be used to monitor the status of the transactionGET /tx/{txId}/status: use the transaction id from submit to get the transaction status
If enabled by suppling the COMPLIANCE_URL environment variable, this route will check if an address meets compliance requirements- is not sanctioned, blocked, etc.
Use this in the frontend to notify the user an address is not compliant BEFORE doing the ERC20 approval. When compliance is enabled, the /submit endpoint will return status 403 (Forbidden) if an address is not compliant.
Returns the KYC status for a specific uuid verification session. You can use GET /uuid to get a new uuid.
Chain filtering is an optional feature that can be enabled by setting the KIMA_CHAIN_FILTER environment variable. It supports two modes:
whitelist: Only chains in the whitelist will be returned.blacklist: Only chains not in the blacklist will be returned.
This is a JSON object with the following structure:
origin: Filter for the origin chainmode: The mode to use. Can bewhitelistorblacklistchains: An array of chain short names to filter
target: Filter for the target chainmode: The mode to use. Can bewhitelistorblacklistchains: An array of chain short names to filter
Example:
{
"origin": {
"mode": "whitelist",
"chains": ["ARB", "OPT"]
},
"target": {
"mode": "blacklist",
"chains": ["TRX"]
}
}