Everscale
WC JSON-RPC for Everscale
ever_sign
Signature of a random message for authentication.
Parameters:
- message - some message in base64;
 - withSignatureId - bool or number
 - hashData - bool
 
Returns:
- signature - string signature in base64;
 - pubkey - public key of the wallet's address;
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_sign",
  "params": {
        "message": "some message in base64",
        "withSignatureId": true,
        "hashData": true
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "signature": "0xa3f207... in base64",
        "pubkey": "0x07bf94e...37e3"
    }
}
ever_sendMessage
Creates message, sends it to the network, monitors its processing and returns transaction's id.
Parameters:
- value - amount of coins attached to the message;
 - bounce - should the answer message be generated in case of an error;
 - destAddress - message destination address;
 - destPayload - message destination payload; 4.1. abi - destination contract ABI; 4.2. method - destination contract method; 4.3. params - destination contract method params
 
Returns:
- txId - transaction's id in blockchain;
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_sendMessage",
  "params": {
        "source_address": "0:695e42...b8d",
        "value": 1000000000,
        "bounce": False,
        "destAddress": "0:b38d96...708",
        "destPayload": {
            "abi": "",
            "method": "",
            "params": {}
        },
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "txId": "743e1c0046b82a48a2cf8cbe9a2059ce6f3862cfae377c77d9f1b4efd88d7acb"
    }
}
ever_signMessage
Message that can then be sent to the blockchain.
Parameters:
- value - amount of coins attached to the message;
 - bounce - should the answer message be generated in case of an error;
 - destAddress - message destination address;
 - destPayload - message destination payload; 4.1. abi - destination contract ABI; 4.2. method - destination contract method; 4.3. params - destination contract method params
 
Returns:
- signedExtMessage - signed external message;
 - expireAt - мessage expiration timestamp
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_processMessage",
  "params": {
        "source_address": "0:695e42...b8d",
        "value": 1000000000,
        "bounce": False,
        "destAddress": "0:b38d96...708",
        "destPayload": {
            "abi": "",
            "method": "",
            "params": {}
        },
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "signedExtMessage": "c0b0996a9f0ea8e472041857ff2da9cf8086a78603f823a7170891f43a217ff1",
        "expireAt": 1685594678
    }
}
ever_sendExternalMessage
Sends an external message to the contract.
Parameters:
- destAddress - message destination address;
 - destPayload - message destination payload; 2.1. abi - destination contract ABI; 2.2. method - destination contract method; 2.3. params - destination contract method params
 
Returns:
- txId - transaction's id in blockchain;
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_sendExternalMessage",
  "params": {
        "sourceAddress": "0:695e42...b8d",
        "destAddress": "0:b38d96...708",
        "destPayload": {
            "abi": "",
            "method": "",
            "params": {}
        },
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "txId": "743e1c0046b82a48a2cf8cbe9a2059ce6f3862cfae377c77d9f1b4efd88d7acb"
    }
};
ever_broadcastMessage
Sends an internal message from the user account without waiting for the transaction.
Parameters:
- value - amount of coins attached to the message;
 - bounce - should the answer message be generated in case of an error;
 - destAddress - message destination address;
 - destPayload - message destination payload; 4.1. abi - destination contract ABI; 4.2. method - destination contract method; 4.3. params - destination contract method params
 
Returns:
- hash: string - external message hash;
 - account: string - destination account address (equals to source_address);
 - expireAt: number - мessage expiration timestamp
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_broadcastMessage",
  "params": {
        "sourceAddress": "0:695e42...b8d",
        "value": 1000000000,
        "bounce": False,
        "destAddress": "0:b38d96...708",
        "destPayload": {
            "abi": "",
            "method": "",
            "params": {}
        },
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "hash": "743e1c0046b82a48a2cf8cbe9a2059ce6f3862cfae377c77d9f1b4efd88d7acb",
        "account": "0:695e42...b8d",
        "expireAt": 1684327417543
    }
};
ever_broadcastExternalMessage
Sends an external message to the contract without waiting for the transaction.
Parameters:
- destAddress - message destination address;
 - destPayload - message destination payload; 2.1. abi - destination contract ABI; 2.2. method - destination contract method; 2.3. params - destination contract method params
 
Returns:
- hash: string - external message hash;
 - account: string - destination account address (equals to source_address);
 - expireAt: number - мessage expiration timestamp
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_broadcastExternalMessage",
  "params": {
        "sourceAddress": "0:695e42...b8d",
        "destAddress": "0:b38d96...708",
        "destPayload": {
            "abi": "",
            "method": "",
            "params": {}
        },
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "hash": "743e1c0046b82a48a2cf8cbe9a2059ce6f3862cfae377c77d9f1b4efd88d7acb",
        "account": "0:b38d96...708",
        "expireAt": 1684327417543
    }
}
ever_addTokenAsset
Adds asset (TIP-3 or native tokens) to the selected account.
Parameters:
- rootContract - asset root address. Note: you can add native coin by leaving this field empty
 
Returns:
- newAsset: bool - returns true if the account did not have this asset before
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_addTokenAsset",
  "params": {
        "sourceAddress": "0:695e42...b8d",
        "rootContract": "0:b38d96...708"
    }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "newAsset": true
    }
}
ever_encryptData
Encrypts arbitrary data with specified algorithm for each specified recipient.
Parameters:
- recipientPublicKeys - public keys of recipients. Hex encoded;
 - algorithm - encryption algorithm. Currently supports only “ChaCha20Poly1305”
 - data - base64 encoded data;
 
Returns:
- encryptedData - encrypted data for each recipient 1.1. algorithm - encryption algorithm 1.2. sourcePublicKey - hex encoded encryptor's public key 1.3. recipientPublicKey - hex encoded recipient public key 1.4. data - base64 encoded data 1.5. nonce - base64 encoded nonce
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_encryptData",
  "params": {
       "sourceAddress": "0:695e42...b8d",
       "recipientPublicKeys": ["0x6e74...4e95", "0x9532...403f"],
       "algorithm": "ChaCha20Poly1305",
       "data": "ZGF0YQ=="
  }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result":  {
        "encryptedData": [
           {
            "algorithm": "ChaCha20Poly1305",
            "sourcePublicKey": "0x209f...d08f",
	      "recipientPublicKey": "0x6e74...4e95",
            "data": "ZW5jRGF0YTE=",
            "nonce": "bm9uY2Ux"
           },
           {
            "algorithm": "ChaCha20Poly1305",
            "sourcePublicKey": "0x209f...d08f",
            "recipientPublicKey": "0x6e74...4e95",
            "data":"ZW5jRGF0YTI=",
            "nonce":"bm9uY2Uy"
           }
        ]
    }
};
ever_decryptData
Decrypts encrypted data.
Parameters:
- algorithm - encryption algorithm. Currently supports only “ChaCha20Poly1305”
 - recipientPublicKey - hex encoded recipient public key
 - data - base64 encoded data
 - nonce - base64 encoded nonce
 
Returns:
- data - base64 encoded decrypted data
 
Example:
// Request
{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "ever_decryptData",
  "params": {
       "sourceAddress": "0:695e42...b8d",
       "algorithm": "ChaCha20Poly1305",
       "recipientPublicKey": "0x6e74...4e95",
       "data": "ZW5jRGF0YTE=",
       "nonce": "bm9uY2Ux"
  }
}
// Result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
       "data": "ZGF0YQ=="
   }
};