Skip to content

Sign Contract Order

Endpoint

POST https://api.mycactus.dev/custody/v1/api/projects/{b_id}/wallets/{wallet_code}/signatures
POST https://api.mycactus.com/custody/v1/api/projects/{b_id}/wallets/{wallet_code}/signatures

Parameters

Path Parameters

FieldTypeDescription
b_id
Required
StringBusiness line ID
wallet_code
Required
StringDefi Wallet ID

Administrator is required to enable "Message Signing" under DeFi Account - EVM Whitelist Protection in order to perform this API call.

Body Parameters

FieldTypeDescription
order_no
Required
StringOrder number
address
Required
StringAddress
signature_version
Required
StringSignature type, Refer to METAMASK's official documents to learn more details
Allowed values: V4, personalSign
payload
Required
JsonNodeSignature information. View the formats for EVM compatible chain
chain
Required
StringCactus chain name
Allowed Value: Refer to Network Symbol column in Supported Token
description
Optional
StringDescription (max 50 characters)

Request Body Example

EVM request.json
{
    "address": "0x115eb8585ad0cfA18e1b7Fd39Dfc5c655adF8fB8",
    "signature_version": "personalSign",
    "payload": {"message": "0x2ca3vaa3....."},
    "chain": "ETH",
    "order_no": "D00000000001",
    "description": ""
}

To obtain the signed result, use the Get Smart Contract Transaction Details API and provide the orderNo. The result will be returned in the signed_data field.

Body Parameters

FieldTypeDescription
order_no
Required
StringOrder number
address
Required
StringAddress
signature_version
Required
StringSignature type
Allowed values: signMessage, signPsbt, signPsbts
payload
Required
JsonNodeSignature information. View the formats for BTC chain
chain
Required
StringCactus chain name
Allowed Value: BTC
description
Optional
StringDescription (max 50 characters)

BTC Chain Signature Types

signature_version Description
signMessage Message signing only
signPsbt Transaction signing
signPsbts Multiple transaction signing

Request Body Example

BTC request.json
{
    "address": "tb1pkhduwswuk7qhx77djyt730dp77tjrc8ullftfyr2deaa635d55ns04zext",
    "signature_version": "signMessage",
    "payload": {"text": "hello world~"},
    "chain": "BTC",
    "order_no": "TX00000000002",
    "description": ""
}

To obtain the signed result, use the Get Smart Contract Transaction Details API and provide the orderNo. The result will be returned in the signed_data field.

Administrator is required to enable "Message Signing" under DeFi Account - Cosmos Ecosystem Whitelist Protection in order to perform this API call.

Body Parameters

FieldTypeDescription
order_no
Required
StringOrder number
address
Required
StringAddress
signature_version
Required
StringSignature type
Allowed values: signAmino, signDirect, signArbitrary
payload
Required
JsonNodeSignature information. View the formats for Cosmos-based chain
chain
Required
StringCactus chain name
Allowed Value: Refer to Network Symbol column in Supported Token
description
Optional
StringDescription (max 50 characters)

Cosmos Signature Types

signature_version Description
signAmino Legacy JSON transaction signing
signDirect Protobuf (modern) transaction signing
signArbitrary Arbitrary data/message signing

Request Body Example

Cosmos request.json
{
  "address": "cosmos1qqp3t4zhpwxp8sjq9j7p42flf4z5r0u9ex7n3k",
  "signature_version": "signAmino",
  "payload": {
    "account_number": "123",
    "chain_id": "cosmoshub-4",
    "fee": {
      "amount": [
        { "denom": "uatom", "amount": "1000" }
      ],
      "gas": "200000"
    },
    "memo": "Test transaction",
    "msgs": [
      {
        "type": "cosmos-sdk/MsgSend",
        "value": {
          "from_address": "cosmos1...",
          "to_address": "cosmos1...",
          "amount": [
            { "denom": "uatom", "amount": "1000000" }
          ]
        }
      }
    ]
  },
  "chain": "COSMOS",
  "order_no": "D00000000001",
  "description": ""
}

To obtain the signed result, use the Get Smart Contract Transaction Details API and provide the orderNo. The result will be returned in the signed_data field.


Response

Response Body

FieldTypeDescription
codeIntegerResponse code (0 = success)
messageStringResponse message
successfulBooleanWhether the request was successful
dataObjectResponse data (see data object details below)

data (object)

FieldTypeDescription
OrderNoStringOrder number

Response Example

{
    "code": 0,
    "message": "",
    "successful": true,
    "data": {
        "OrderNo": "D00000000001"
    }
}