@pzhun/aleo_auth
v1.0.0
Published
A package to separate aleo signature (in dart) and proof (in nodejs)
Downloads
2
Readme
transfer demo
const AleoFFI = require("./aleo_ffi");
const url = "xxxx";
const private_key = "xxxx";
const recipient = "xxxx";
const amount_credits = 10000000;
const fee_credits = 10000000;
const transfer_type = "transfer_public_to_private";
// const amount_record =
// "record1qyqspttl9gdej22xemsrulz589z0szy0munwwl20l5vjc2eg40vyx9qxqyxx66trwfhkxun9v35hguerqqpqzqrcrl9u7daggvd2th8679wzzf557765tzus6fzzxsn7mjea6zt3qs7rtfs8fkywetjm8m2waff8yfmc4v5h2neemv90268surxtan3qjf5pppl";
const authorization = AleoFFI.executionAuthorization(
private_key,
recipient,
transfer_type,
amount_credits,
url,
""
);
const proof = AleoFFI.executeProof(url, authorization);
const feeAuthorization = AleoFFI.executionFeeAuthorization(
private_key,
transfer_type,
url,
fee_credits,
"",
proof
);
const feeProof = AleoFFI.executeFeeProof(url, feeAuthorization);
const tx = AleoFFI.buildTransactionOffline(proof, feeProof);
AleoFFI.broadcast(tx, url, transfer_type);