Bitcoin.me DeFi API (1.0.0)
Download OpenAPI specification:Download
REST API for integration with the Bitcoin.me DeFi platform on KleverChain.
This API provides endpoints for:
- Pools: Query liquidity pools and their details
- Quotation: Get swap and liquidity quotes
- Tokens: List available tokens
- Token Factory: Manage created tokens
- Portfolio: View wallet balances and positions
- Rewards: Check reward status
- Energy: Manage energy positions and KFI locking
Response samples
- 200
[- {
- "scAddress": "string",
- "name": "string",
- "value": "string",
- "apr": "string",
- "baseName": "string",
- "quoteName": "string",
- "baseAssetId": "string",
- "quoteAssetId": "string",
- "baseIconUrl": "string",
- "quoteIconUrl": "string",
- "baseTotalStaked": "string",
- "quoteTotalStaked": "string"
}
]Get Pool Details
Returns the details of a specific pool.
path Parameters
| scAddress required | string Smart contract address of the pool |
Responses
Response samples
- 200
- 404
{- "scAddress": "string",
- "name": "string",
- "value": "string",
- "apr": "string",
- "baseName": "string",
- "quoteName": "string",
- "baseAssetId": "string",
- "quoteAssetId": "string",
- "baseIconUrl": "string",
- "quoteIconUrl": "string",
- "baseTotalStaked": "string",
- "quoteTotalStaked": "string",
- "baseTokenPrice": "string",
- "quoteTokenPrice": "string",
- "basePriceVariation": "string",
- "quotePriceVariation": "string",
- "baseVolume": "string",
- "quoteVolume": "string",
- "fees": "string"
}Get Pool Transactions
Returns the latest swap transactions of a pool.
path Parameters
| scAddress required | string Smart contract address of the pool |
Responses
Response samples
- 200
- 400
[- {
- "action": "string",
- "tokenInAbbr": "string",
- "tokenInAmount": "string",
- "tokenInAmountUsd": "string",
- "tokenInAssetId": "string",
- "tokenInIcon": "string",
- "tokenOutAbbr": "string",
- "tokenOutAmount": "string",
- "tokenOutAmountUsd": "string",
- "tokenOutAssetId": "string",
- "tokenOutIcon": "string",
- "timestamp": 0
}
]Get Swap Quotation
Gets the swap quotation between two tokens.
Request Body schema: application/jsonrequired
| amountIn required | number Input token amount |
| tokenIn required | string Input token asset ID |
| tokenOut required | string Output token asset ID |
Responses
Request samples
- Payload
{- "amountIn": 0,
- "tokenIn": "string",
- "tokenOut": "string"
}Response samples
- 200
- 400
{- "tokenIn": "string",
- "amountIn": "string",
- "amountInUsd": "string",
- "tokenOut": "string",
- "amountOut": "string",
- "amountOutUsd": "string",
- "tokenInPrice": "string",
- "tokenOutPrice": "string",
- "tokenInPriceUsd": "string",
- "tokenOutPriceUsd": "string",
- "tokenInPrecision": 0,
- "tokenOutPrecision": 0
}Get Add Liquidity Quotation
Gets the quotation for adding liquidity to a pool.
Request Body schema: application/jsonrequired
| amountIn required | number Input token amount |
| tokenIn required | string Input token asset ID |
| tokenOut required | string Output token asset ID |
Responses
Request samples
- Payload
{- "amountIn": 0,
- "tokenIn": "string",
- "tokenOut": "string"
}Response samples
- 200
{- "tokenIn": "string",
- "amountIn": "string",
- "amountInUsd": "string",
- "tokenOut": "string",
- "amountOut": "string",
- "amountOutUsd": "string",
- "tokenInPrice": "string",
- "tokenOutPrice": "string",
- "tokenInPriceUsd": "string",
- "tokenOutPriceUsd": "string",
- "tokenInPrecision": 0,
- "tokenOutPrecision": 0
}Get Token Balances
Returns the token balances of an address.
path Parameters
| address required | string Bech32 wallet address |
Responses
Response samples
- 200
- 400
[- {
- "assetAbbr": "string",
- "assetName": "string",
- "assetId": "string",
- "assetPrice": "string",
- "amount": "string",
- "amountInUSD": "string",
- "iconURL": "string",
- "precision": 0
}
]Get Full Portfolio
Returns the complete portfolio of an address, including pool positions and token balances.
path Parameters
| address required | string Bech32 wallet address |
Responses
Response samples
- 200
- 400
{- "portfolioOverview": {
- "totalBalanceInUSD": "string",
- "tokenBalancesInUSD": "string",
- "poolBalancesInUSD": "string"
}, - "positions": {
- "Pool": {
- "property1": {
- "poolName": "string",
- "scAddress": "string",
- "assetId": "string",
- "rewardAssetId": "string",
- "assetAbbr": "string",
- "iconURL": "string",
- "firstTokenAmount": "string",
- "firstTokenAmountInUSD": "string",
- "firstTokenIconURL": "string",
- "secondTokenAmount": "string",
- "secondTokenAmountInUSD": "string",
- "secondTokenIconURL": "string",
- "amount": "string",
- "amountInUSD": "string",
- "unclaimedRewards": "string",
- "unclaimedRewardsInUSD": "string",
- "isClaimStakingRewardsEnable": true,
- "apr": 0,
- "minApr": 0,
- "maxApr": 0,
- "isUnbondToken": true,
- "categoryType": "string"
}, - "property2": {
- "poolName": "string",
- "scAddress": "string",
- "assetId": "string",
- "rewardAssetId": "string",
- "assetAbbr": "string",
- "iconURL": "string",
- "firstTokenAmount": "string",
- "firstTokenAmountInUSD": "string",
- "firstTokenIconURL": "string",
- "secondTokenAmount": "string",
- "secondTokenAmountInUSD": "string",
- "secondTokenIconURL": "string",
- "amount": "string",
- "amountInUSD": "string",
- "unclaimedRewards": "string",
- "unclaimedRewardsInUSD": "string",
- "isClaimStakingRewardsEnable": true,
- "apr": 0,
- "minApr": 0,
- "maxApr": 0,
- "isUnbondToken": true,
- "categoryType": "string"
}
}
}, - "tokenBalances": {
- "Token": {
- "property1": {
- "assetAbbr": "string",
- "assetName": "string",
- "assetId": "string",
- "assetPrice": "string",
- "amount": "string",
- "amountInUSD": "string",
- "iconURL": "string",
- "precision": 0,
- "categoryType": "string"
}, - "property2": {
- "assetAbbr": "string",
- "assetName": "string",
- "assetId": "string",
- "assetPrice": "string",
- "amount": "string",
- "amountInUSD": "string",
- "iconURL": "string",
- "precision": 0,
- "categoryType": "string"
}
}, - "Locked": { }
}
}Get Close Position Data
Returns the data to close an LP position.
path Parameters
| address required | string Bech32 wallet address |
| assetId required | string LP token Asset ID |
Responses
Response samples
- 200
- 400
{- "poolName": "string",
- "scAddress": "string",
- "firstTokenAmount": "string",
- "secondTokenAmount": "string",
- "firstTokenAmountInUSD": "string",
- "secondTokenAmountInUSD": "string",
- "firstTokenIconURL": "string",
- "secondTokenIconURL": "string",
- "amount": "string",
- "amountInUSD": "string"
}Get Energy Removal Penalty
Returns the penalty data for removing energy from a specific asset.
path Parameters
| address required | string Bech32 wallet address |
| assetId required | string xKFI Asset ID |
| nonce required | string SFT nonce |
Responses
Response samples
- 200
- 400
{- "removalFee": "string",
- "removalFeeInUSD": "string"
}Get Multiple Energy Removal Penalties
Returns the penalty data for removing energy from multiple assets.
Request Body schema: application/jsonrequired
| address required | string Bech32 wallet address |
| assetIds required | Array of strings List of xKFI asset IDs |
Responses
Request samples
- Payload
{- "address": "string",
- "assetIds": [
- "string"
]
}Response samples
- 200
- 400
{- "penaltyEnergyData": [
- {
- "assetId": "string",
- "removalFee": "string",
- "removalFeeInUSD": "string"
}
], - "energyPositions": [
- {
- "assetId": "string",
- "currentEnergy": "string",
- "kfiLocked": "string",
- "price": "string",
- "charge": 0
}
]
}Get Unlocked Tokens
Returns the user's unlocked tokens.
path Parameters
| address required | string Bech32 wallet address |
Responses
Response samples
- 200
- 400
[- {
- "unlockEpoch": 0,
- "lockedTokens": {
- "amount": 0,
- "tokenIdentifier": "string",
- "tokenNonce": 0
}, - "unlockedTokens": {
- "amount": 0,
- "tokenIdentifier": "string",
- "tokenNonce": 0
}
}
]