Hi everyone, just wanted to point you to some syntactical errors in the example code of section "Execute a transaction" (at least for node.js).
correct form would be:
let transferTo = "0xa31e988eebc89d0bc3e4a9a5463545ea534593e4",
transferAmount = '1',
raw_calldata = JSON.stringify({
method: "directTransfers",
parameters: [[transferTo],[transferAmount]]
}),
meta_property = {
"name": "transaction_name" , //like, download
"type": "user_to_user", // user_to_user, company_to_user, user_to_company
"details" : "" // memo field to add additional info about the transaction
},
executeParams = {
user_id: "ee89965c-2fdb-41b5-8b6f-94f441463c7b",
to: "0xe37906219ad67cc1301b970539c9860f9ce8d991",
raw_calldata: raw_calldata,
meta_property: meta_property
};
i saw similar problems at various positions. if you just copy&paste the examples you will get errors/warnings concerning variable declarations
{"success":false,"err":{"code":"BAD_REQUEST","msg":"At least one parameter is invalid or missing. See \"err.error_data\" array for more details.","error_data":[{"parameter":"meta_property","msg":"Invalid parameter meta_property. Please ensure the input is well formed or visit https://dev.ost.com/platform/docs/api for details on accepted datatypes for API parameters."}],"internal_id":"v_ap_4"}}
Hi @nguyenpc,
You can follow this execute transaction guide here: https://dev.ost.com/platform/docs/guides/execute_transaction/#generating-qrcode-with-transaction-data
Hi @pyramus,
can send me your code snippet of execute transaction parameters?
meta_property = {
"name": "transaction_name",
"type": "company_to_user",
"details" : ""}
@ankit-yadv
Hi @nguyenpc,
You can follow this execute transaction guide here: https://dev.ost.com/platform/docs/guides/execute_transaction/#generating-qrcode-with-transaction-data
Thank you, I generated a QR code as guided, the app seems regconize the tx, however it crashed after scanning the QR code.
is there any other channel where we can submit our issue (i.e. Github)?
let meta_property = {
"name": "Signup Bonus",
"type": "company_to_user",
"details": "Credit to get started."
};
executeParams = {
user_id: companyUserId,
to: contractRuleAddress,
raw_calldata: raw_calldata,
// meta_property: meta_property
};
Hi @nguyenpc,
You can create a ticket here https://help.ost.com/support/home
I've submitted a ticket, thanks.
i got the same error until i got the Rules address from 'Direct Transfer', and placed into the (to)
let executeParams = {
user_id: "9931e53a-83e6-4f9c-92c2-1e4319eab349",
to: "0xe2c560d01f28d2962c934c747234f1453170fae8",
raw_calldata: raw_calldata,
//meta_property: meta_property
};
@Shinto2000_twitter yeah already know that. As said before,
let meta_property = { "name": "Signup Bonus", "type": "company_to_user", "details": "Credit to get started." }; executeParams = { user_id: companyUserId, to: contractRuleAddress, raw_calldata: raw_calldata, // meta_property: meta_property };
executes correctly / but crashes when I uncomment meta_property line
this is exactly like the API specs, but please try to run your own examples from Node.js and you'll see it will fail
Hi @pyramus,
I have updated the sample code for node.js. They are working with meta_property
included.
https://dev.ost.com/platform/docs/api/?javascript#execute-a-transaction
meta_property
is, it should have value for all three attributes. None of the attributes can be empty. meta_property
as a parameter is optional.
details
is not allowed and will break the request. Might be handy to mention, because currently only a max length is specified as limitation to this specific child attribute in the API documentation.