mirror of
https://github.com/Xahau/xahaud.git
synced 2025-11-20 02:25:53 +00:00
misc example changes to support v2
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -13,6 +13,9 @@ bin/project-cache.jam
|
||||
# Ignore python compiled files.
|
||||
*.pyc
|
||||
|
||||
# Ignore wasm files
|
||||
*.wasm
|
||||
|
||||
# Ignore Macintosh Desktop Services Store files.
|
||||
.DS_Store
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
#ifndef HOOKAPI_INCLUDED
|
||||
#define HOOKAPI_INCLUDED 1
|
||||
|
||||
|
||||
#define KEYLET_HOOK 1
|
||||
#define KEYLET_HOOK_STATE 2
|
||||
#define KEYLET_ACCOUNT 3
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
#define HOOKMACROS_INCLUDED 1
|
||||
|
||||
// hook developers should use this guard macro, simply GUARD(<maximum iterations>)
|
||||
#define GUARD(maxiter) _g(__LINE__, (maxiter)+1)
|
||||
#define GUARDM(maxiter, n) _g(((__LINE__ << 16) + n), (maxiter)+1)
|
||||
#define GUARD(maxiter) _g((1ULL << 31U) + __LINE__, (maxiter)+1)
|
||||
#define GUARDM(maxiter, n) _g(( (1ULL << 31U) + (__LINE__ << 16) + n), (maxiter)+1)
|
||||
|
||||
#define SBUF(str) (uint32_t)(str), sizeof(str)
|
||||
|
||||
|
||||
@@ -298,7 +298,6 @@ module.exports = {
|
||||
const randomAccount = ()=>
|
||||
{
|
||||
const acc = xrpljs.Wallet.fromSeed(kp.generateSeed());
|
||||
console.log(acc)
|
||||
return acc
|
||||
};
|
||||
|
||||
@@ -537,9 +536,40 @@ module.exports = {
|
||||
console.dir(m, {depth:null});
|
||||
}
|
||||
|
||||
|
||||
const hex_memos = (x) =>
|
||||
{
|
||||
if (!("Memos" in x))
|
||||
return;
|
||||
|
||||
for (y in x["Memos"])
|
||||
{
|
||||
for (a in x["Memos"][y])
|
||||
{
|
||||
let Fields = ["MemoFormat", "MemoType", "MemoData"];
|
||||
for (z in Fields)
|
||||
{
|
||||
if (Fields[z] in x["Memos"][y][a])
|
||||
{
|
||||
let u = x["Memos"][y][a][Fields[z]].toUpperCase()
|
||||
if (u.match(/^[0-9A-F]+$/))
|
||||
{
|
||||
x["Memos"][y][a][Fields[z]] = u;
|
||||
continue;
|
||||
}
|
||||
|
||||
x["Memos"][y][a][Fields[z]] =
|
||||
""+Buffer.from(x["Memos"][y][a][Fields[z]]).toString('hex').toUpperCase();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
api.connect().then(()=>
|
||||
{
|
||||
resolve({
|
||||
hex_memos: hex_memos,
|
||||
rbc: rbc,
|
||||
api: api,
|
||||
xrpljs: xrpljs,
|
||||
|
||||
Reference in New Issue
Block a user