Discussions
Is there a code example to how to blackist ongoing tx address ?
1. I would like to know If I can block the incomming transaction addr is a blacklisted one
2. How can I know if a particular addr already made a sucessful tx with me.
Do I need to create a list , and how do I map and filter to them.
Note : I am not from the C background, mostly javascript and java. please help
Thank you.
Posted by watchDhog69 2 months ago
About "inline functions"
Hi
there is a question that has been in my mind for some time.
https://github.com/XRPL-Labs/xrpld-hooks/discussions/57
I ask the question again here, because I think it is an important one.
about "C inline functions" and the compiler option to force compile "always inline".
There is a possibility to enable this functionality?
Inline functions, I know, can be an alternative to the awful macros.
recursion is not possible with inline functions
and the benefit could be a programming style very similar to javascript and solidity.
thank you
Posted by f1f47a23 3 months ago
EmitGeneration field value looks wrong
Hi
In 3 chained transactions test,
where the 1st ordinary payment txn triggers the 2nd emitted,
and the 2nd triggers the 3rd,
I see that the 2 emitted transactions have
the EmitGeneration field = 2(the 2nd) and 4(the 3rd)
1st txn
https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/D8868FF6761DACA9A704A98D9CD3225BC82E914B507364ECA4D273F919C4712B
2nd emitted txn triggered by the 1st
https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/47CDEC6EBA4AAEA9E640643C4A6ACAFF09E63DBE093138F10847EA407509ACE7
3rd emitted txn triggered by the 2nd
https://hooks-testnet-v2-explorer.xrpl-labs.com/tx/AF372886C4A3297A0137B43D6C3C823180A69779F060228D27C33F5DE015906F
But, according to the documentation, I should see values of 1 and 2
https://xrpl-hooks.readme.io/docs/emitted-transactions#emitdetails-block
fields are filled by etxn_details()
etxn_reserve always = 1
EmitBurden always = "1" seems correct
Posted by f1f47a23 3 months ago
trace(...) doesn't log the value string
While running blacklist.c (hooks-v2) I noticed that the trace() function
shows the message but not the value.
for example at line 43
trace(SBUF("Memo: "), memo_ptr, memo_len, 1);
it logs only "Memo :"
I tried several cases in others places but had the same result.
As a workaround, I suppose, it could work by concat message+value
Posted by f1f47a23 6 months ago
Improved error messaging when hooks don't conform to the engine contract?
I'm hoping to start a discussion orbiting around the error messages that the XRPL engine is returning when someone new (like me) is fumbling through all of this.
I understand that _g is required from the documentation's perspective. However the error message we get back from the engine isn't helpful for seeing this is the problem when you don't include it.
For instance if we don't include _g as an import you get a "Malformed transaction" error from the XRPL engine. Not super helpful for someone "down in the weeds" trying to learn.
Interestingly if you include _g but don't use it in your hook you get a "temBAD_SIGNATURE" error from the engine. Again, not super helpful because it leads you down the path of "debugging" how you signed the transaction. I wonder if it could be a more clear about the reason for the "Bad Signature"?
Any thoughts?
Posted by Jay Grissom over 1 year ago
Xumm KYC
Is there a way to add the KYC status to the ripple account?
Is there a way to call an outside api though a hook?
I've got a hook that can only accept a specific issuer/token but I also want this to be pinned to the KYC that is done through Xumm..
Any thoughts?
Posted by Denis Angell over 1 year ago
Can I use AssemblyScript?
Hi team,
Do you see any issue with using https://www.assemblyscript.org/ ?
I tried to compile your simple `accept` hook with AssemblyScript but when I submit the transaction with ripple-lib I get an error message:
```
data: {
resultCode: 'temMALFORMED',
resultMessage: 'Malformed transaction.',
engine_result: 'temMALFORMED',
engine_result_code: -299,
engine_result_message: 'Malformed transaction.',
tx_blob: '12001622800000002400441FC5201B004565333010000000000000000068400000000000000C7321031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B74473045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D7BA50061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D61708114A9E75BEA9E40D24E411DC9E5B1E209C5F015BA10',
tx_json: {
Account: 'rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g',
CreateCode: '0061736D0100000001130360017E017E60037F7F7E017E60027F7F017F021D0207636F6E74726F6C066163636570740001057574696C73025F67000203030200000503010000071803046362616B000204686F6F6B0003066D656D6F727902000A1B02040042000B140041004100420010001A4101410110011A42000B002610736F757263654D617070696E6755524C142E2F6F7074696D697A65642E7761736D2E6D6170',
Fee: '12',
Flags: 2147483648,
HookOn: '0000000000000000',
LastLedgerSequence: 4547891,
Sequence: 4464581,
SigningPubKey: '031707DDB63EB8B5447371F1EA5B83009475AE0981388BB7352403393F82230E1B',
TransactionType: 'SetHook',
TxnSignature: '3045022100E4F443EE595F93F4F604117D215A21CE5AC81974364155AA45BE6286E3A3978002203487A9EA95C297CD82281089DBC0B09A87384C99866B2BC1EDAD00AA1BE1698D',
hash: 'BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29'
}
}
```
Also in the rippled logs are showing:
```
2021-Sep-27 10:55:29.827798400 UTC OpenLedger:TRC HookSet[rGV4MXcjPTkdhVZLFrddVQPHz1WdXkvK6g-BA20CC222EE7A87D8C969B732041C3E92FDA7D6E66B9550294C65B3ADB7EAA29]: Malformed transaction. Hook attempted to specify import module other than 'env'
```
Thank you
Posted by Florent Uzio over 1 year ago
[accept Hook] - Cannot read property 'toBytesSink' of undefined
Hi, I am learning about Hooks and I wanted to try first with something simple and the "accept" hook.
I am using your code in accept.js and when I run it with "node accept.js ssXUB..." I get the following error:
TypeError: Cannot read property 'toBytesSink' of undefined
at BinarySerializer.writeFieldAndValue (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/serdes/binary-serializer.js:125:32)
at /Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/types/st-object.js:130:19
at Array.forEach (<anonymous>)
at Function.STObject.from (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/types/st-object.js:128:16)
at serializeObject (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/binary.js:59:32)
at signingData (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/binary.js:75:12)
at Object.encodeForSigning (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-binary-codec/dist/index.js:37:12)
at computeSignature (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:36:41)
at signWithKeypair (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:59:42)
at RippleAPI.sign (/Users/fuzio/Documents/Ripple/Github/webassembly-typescript/node_modules/ripple-lib/dist/npm/transaction/sign.js:163:16)
Have you already faced this issue?
Thank you
Posted by Florent Uzio over 1 year ago
Removing Hooks
Whats the plan here?
Are hooks overwritten?
Posted by Denis Angell over 1 year ago
How to store private information on a Hook?
I'm still new to Hooks and C in general but how can a Hooks developer store personal and confidential information on a Hook (e.x: Full Name, Age, ID) without it being publicly available.
I'm planning to code a Hook that only accepts KYC/AML enabled accounts' transactions to avoid unwanted transactions to the receiving account.
Any centralized or decentralized structures are accepted. Thank you.
Posted by wojak over 1 year ago