So I have this function implemented for my Contract
#[payable]
fn send_message(mut self, message: &str, receiver: &str) {
When I try to call it using near-cli
near call v1.messenger.ijelis.testnet send_message '{"message": "test","sender": "iejlis.near"}' --account-id ijelis.testnet
It gives me out this
Scheduling a call: v1.messenger.ijelis.testnet.send_message({"message": "test","sender": "iejlis.near"})
Doing account.functionCall()
Receipt: DDXubobUugwsGnr9GqXxMv7PJqT3YsLjTn14xWML4vx
Failure [v1.messenger.ijelis.testnet]: Error: Contract method is not found
ServerTransactionError: Contract method is not found
at Object.parseResultError (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29)
at Account.signAndSendTransactionV2 (/usr/local/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async scheduleFunctionCall (/usr/local/lib/node_modules/near-cli/commands/call.js:57:38)
at async Object.handler (/usr/local/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) {
type: 'MethodNotFound',
context: undefined,
index: 0,
transaction_outcome: {
proof: [ [Object] ],
block_hash: 'G4QJ5PPykJWieCyi9P5Rzxu73t1YCKLGKnWL7Z5nUbhd',
id: 'ExJyHwyCpjrFBXGXyr35Y6itkTPVpN1MtE4RnDbo2HBz',
outcome: {
logs: [],
receipt_ids: [Array],
gas_burnt: 2428039504502,
tokens_burnt: '242803950450200000000',
executor_id: 'ijelis.testnet',
status: [Object],
metadata: [Object]
}
}
}
What Am I doing wrong?
EDIT: I tried to deploy it using near-create-app interface, and everything worked fine.