Hi,
I’m calling contract and I’m getting the tx hash and everything but I can’t find a way to get the response that I should get from the contract.
If I run dryRun… methods I get the response that I need but I can’t with normal methods.
The method checks if the data exists in the state based on the given parameter and should return object (with empty values or the data itself) at the end.
const signer = concordium.buildAccountSigner(secretKey);
const transaction = await RecheckContract[contractMethod](
contractClient,
{
senderAddress: accountAddress,
energy: concordium.Energy.create(10000),
amount: concordium.CcdAmount.zero(),
},
contractArgs,
signer
);
const tx = await client.waitForTransactionFinalization(transaction)
const transactionStatus = await client.getBlockItemStatus(transaction);
This is what I’m getting from the calls
TransactionHash {
buffer: Uint8Array(32) [
.....................
],
__type: 'ccd_transaction_hash'
}
{
blockHash: BlockHash {
buffer: Uint8Array(32) [
76, 143, 198, 178, 83, 187, 105, 190,
38, 31, 55, 79, 161, 62, 104, 90,
8, 150, 31, 9, 162, 121, 120, 191,
177, 69, 106, 141, 46, 140, 102, 3
],
typedJsonType: 'ccd_block_hash',
__type: 'ccd_block_hash'
},
summary: {
index: 0n,
energyCost: Energy { value: 1847n, __type: 'ccd_energy' },
hash: TransactionHash {
buffer: Uint8Array(32) [
.....................
],
__type: 'ccd_transaction_hash'
},
type: 'accountTransaction',
cost: 147165n,
sender: AccountAddress {
address: '.................',
decodedAddress: Uint8Array(32) [
......................
],
__type: 'ccd_account_address'
},
transactionType: 'update',
events: [
{
tag: 'Updated',
contractVersion: 1,
address: ContractAddress {
index: 10097n,
subindex: 0n,
__type: 'ccd_contract_address'
},
instigator: {
type: 'AddressAccount',
address: AccountAddress {
address: '.................',
decodedAddress: Uint8Array(32) [
................
],
__type: 'ccd_account_address'
}
},
amount: CcdAmount { microCcdAmount: 0n, __type: 'ccd_ccd_amount' },
message: Parameter {
buffer: Uint8Array(68) [
64, 0, 0, 0, 100, 98, 97, 97, 97, 53, 98, 49,
97, 49, 54, 97, 55, 99, 57, 55, 48, 51, 57, 52,
48, 57, 53, 57, 51, 98, 51, 56, 98, 102, 54, 97,
48, 55, 49, 98, 48, 53, 99, 50, 100, 53, 52, 53,
98, 101, 99, 48, 48, 56, 53, 101, 50, 101, 101, 53,
100, 55, 52, 97, 55, 101, 51, 54
],
__type: 'ccd_parameter'
},
receiveName: ReceiveName {
value: 'recheck.records',
__type: 'ccd_receive_name'
},
events: []
}
]
}
}
{
status: 'finalized',
outcome: {
blockHash: BlockHash {
buffer: Uint8Array(32) [
..............
],
typedJsonType: 'ccd_block_hash',
__type: 'ccd_block_hash'
},
summary: {
index: 0n,
energyCost: Energy { value: 1847n, __type: 'ccd_energy' },
hash: TransactionHash {
buffer: Uint8Array(32) [
...........
],
__type: 'ccd_transaction_hash'
},
type: 'accountTransaction',
cost: 147165n,
sender: AccountAddress {
address: '.................',
decodedAddress: Uint8Array(32) [
................
],
__type: 'ccd_account_address'
},
transactionType: 'update',
events: [
{
tag: 'Updated',
contractVersion: 1,
address: ContractAddress {
index: 10097n,
subindex: 0n,
__type: 'ccd_contract_address'
},
instigator: {
type: 'AddressAccount',
address: AccountAddress {
address: '.................',
decodedAddress: Uint8Array(32) [
..............
],
__type: 'ccd_account_address'
}
},
amount: CcdAmount { microCcdAmount: 0n, __type: 'ccd_ccd_amount' },
message: Parameter {
buffer: Uint8Array(68) [
64, 0, 0, 0, 100, 98, 97, 97, 97, 53, 98, 49,
97, 49, 54, 97, 55, 99, 57, 55, 48, 51, 57, 52,
48, 57, 53, 57, 51, 98, 51, 56, 98, 102, 54, 97,
48, 55, 49, 98, 48, 53, 99, 50, 100, 53, 52, 53,
98, 101, 99, 48, 48, 56, 53, 101, 50, 101, 101, 53,
100, 55, 52, 97, 55, 101, 51, 54
],
__type: 'ccd_parameter'
},
receiveName: ReceiveName {
value: 'recheck.records',
__type: 'ccd_receive_name'
},
events: []
}
]
}
}
}