These docs are for v2.0. Click to read the latest docs for v3.0.

Discussions

Ask a Question
Back to All

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