Copy link
Using API for external calls
Postman collection with all endpoints - Using_API_for_external_calls.postman_collection.zip
Reading a contract
post
https://api.cpay.world
/api/public/external/read
Endpoint POST /api/public/external/read
Parameters
Body
- abi
*
array
- contractAddress
*
string
- method
*
string
- args
*
array
- value
*
number
- options
*
object
- password
string
- sign
string
base64 format
Responses
- 200:OK{status: "string",data: "number"}
- 200:OK
Example
{status: "success",data: "1784570276729267899176"}
Estimated contract signature
post
https://api.cpay.world
/api/public/external/estimateWrite
Endpoint POST /api/public/external/estimateWrite
Parameters
Body
- abi
*
array
- contractAddress
*
string
- method
*
string
- args
*
array
- value
*
number
- options
*
object
- password
string
- sign
string
base64 format
Responses
- 200:OK{status: "string",data: {gasLimit: "number",gasPrice: "number",fee: "number"}}
- 200:OK
Example
{status: "success",data: {gasLimit: "32692",gasPrice: "10000000000",fee: "326920000000000"}}
Contract Signature
post
https://api.cpay.world
/api/public/external/write
Endpoint POST /api/public/external/write
Parameters
Body
- abi
*
array
- contractAddress
*
string
- method
*
string
- args
*
array
- value
*
number
- options
*
object
- password
string
- sign
string
base64 format
Responses
- 200:OK{status: "string",data: {_id: "string",hash: "string"}}
- 200:OK
Example
{status: "success",data: {_id: "63b599c0e36df204a60cce31",hash: "0xd42adf45662f13c47a86247bf31e97c8f848e8e7d9d80f893acb0221b9c9e574"}}