(GET) https://api.warmkey.finance/paymentV1/interface
The generation of deposit link is different to other APIs. Up to your usage, It can be called by either server side or client side.
Query Params For Deposit Link
On client side implementation, you can redirect user from merchant site to WARMKEY for out-app integration, or you can put this link in IFRAME for in-app integration.
On server side implementation, simply use CURL to query to receive JSON response.
| Parameter | Type / Format | Required | Description |
|---|---|---|---|
| account | string | ✅ | md5(api key) |
| path | string | ✅ | - Relative path of bip44. - Format is tableId/recordId. eg. 1/123. - User defined table ID: 1 can represent order, user or anything, - User defined record ID: 123 can be order id, user id or anything to match with primary key of table in your local db. |
| html_config | string / base64 | - below is base64-decoded string uses to override saved/default config. { "features": { "footer": true, "fullscreen": true, "connectWeb3Wallet": true }, "themeVariables": { "--w3m-font-family": "'Noto_Sans_a57643', 'Noto_Sans_Fallback_a57643'", "--w3m-border-radius-master": "4px", "--w3m-accent": "#10B981", "--w3m-color-mix": "#363636", "--w3m-color-mix-strength": 10 }, "themeMode": "dark" } - Only effect to response is html. | |
| response | string | enum: ["json", "html"], default is html. | |
| lang | string | enum: ["zh_CN", "en_US"], default is en_US. | |
| signature | string | ✅ | 64-bytes signature. |
Signature Generation
A signature is generated using RSA private key.
$payload = [
"account"=>md5($your_api_key),
"path"=>"1/123",
];
$signature_data = json_encode($payload);
$to_sign = hash('sha256', $signature_data, true);
$your_private_key_pem = <<EOD
-----BEGIN PRIVATE KEY-----
MIIBVwIBADANBgkqhkiG9w0BAQEFAASCAUEwggE9AgEAAkEA1eerGN7aInrV0myN
5RYAVL58JsUQCdkIUYDLoupVLnhO8uw0DD5ooNwd8gT8KJU0UzKSpRN+sjSwutD3
ZMrvAQIDAQABAkEA1VLwmKIPa5mTSwLF1DTH6bv6tvOK1jdjC11mOLh4cRjoEw83
FzwSfuWlGyFGdir5PE5SK/1D8nZ41h8bnw9pAQIhAP/AQKUYlha+t7gGstFc+J6Z
9ZgoxT44ngyF5dE/4+FRAiEA1hz8Rpwwrm8pwp+kdho8guTwozmpvMrQYdRufjag
RrECIQCTtZrgf3m3+0CqlZvTlam2GF+jGPEKhbKqsu7P0uGvcQIhAIr1MtEMqxd6
M6sI+q5fZqg4tufoE33gTo8/VBp7j1dxAiEAsvhkqXu0AWvkJxVrCfQWiv5RMxAL
LXPLNzdej9IFEns=
-----END PRIVATE KEY-----
EOD;
$private_key = openssl_pkey_get_private($your_private_key_pem);
openssl_sign($to_sign, $your_signature, $private_key, OPENSSL_ALGO_SHA256);
$your_signature = bin2hex($your_signature);
Deposit Link Generation
$deposit_link = "https://api.warmkey.finance/paymentV1/interface/?";
$payload = [
"account"=>md5($your_api_key),
"path"=>"1/123",
"signature"=> $your_signature,
];
$deposit_link .= http_build_query($payload);
Query Params For Return URL
- Redirect user from WARMKEY to merchant site when end user cancel or pay finish at WARMKEY.
- Only available if you implement out-app (link to WARMKEY) solution.
- Merchant's developer can design his own return UI/UX based on these returned params.
- Do not rely on these return params for critical operation. Instead call
Query Logendpoint for confirmed transactions.
| Parameter | Type / Format | Required | Description |
|---|---|---|---|
| txs | string / base64 | ✅ | base64_encode(json_encode([]TX array)). Empty array if deposit not detected. |
TX Array
| Array Index | Type / Format | Required | Description |
|---|---|---|---|
| 0 | string / address | ✅ | Sender address. |
| 1 | string / address | ✅ | Deposit address. |
| 2 | string / hex string | ✅ | Transaction hash. |
| 3 | string / double | ✅ | Deposit amount. |
| 4 | string | ✅ | Coin symbol. |
| 5 | string | ✅ | Network. |
JSON Response
This part only affect whom set response=json in query param.
| Parameter | Type / Format | Required | Description |
|---|---|---|---|
| $network | network object | ✅ | Key is network and value is network object |
Network Object
| Parameter | Type / Format | Required | Description |
|---|---|---|---|
| qr_code | string / base64 | ✅ | Base64 image. |
| deposit_address | string / address | ✅ | Deposit address |