Skip to content

Commit

Permalink
Testing session 11 war transfer
Browse files Browse the repository at this point in the history
  • Loading branch information
Tadeuchi committed Sep 6, 2024
1 parent 5aac4fb commit 5f69f83
Show file tree
Hide file tree
Showing 3 changed files with 8,022 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tools/bridge/transfer-tio-from-bridge-to-jmGG.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import { connect, createDataItemSigner } from '@permaweb/aoconnect';
import fs from 'node:fs';
import { backOff } from 'exponential-backoff';

const { message } = connect();

const WALLET = JSON.parse(fs.readFileSync('../.secrets/general/jwk.json', 'utf-8'));

async function tranfer() {
const signer = createDataItemSigner(WALLET);

let id;
try {
id = await backOff(() =>
message({
process: '89_4zUaRp7RAIz4wZ7n5VgW548i6L2n__-McQzqLn4c',
data: `
ao.send({
Target = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA',
Recipient = 'jmGGoJaDYDTx4OCM7MP-7l-VLIM4ZEGCS0cHPsSmiNE',
Action = 'Transfer',
Quantity = '800000000'
})`,
tags: [{ name: 'Action', value: 'Eval' }],
signer,
})
);
console.log(`Successfully sent 'eval' for process '89_4zUaRp7RAIz4wZ7n5VgW548i6L2n__-McQzqLn4c'.`);
console.log(`https://www.ao.link/#/message/${id}`);
} catch (e) {
console.error(e);
}

return id;
}

tranfer().then(console.log).catch(console.error);
Loading

0 comments on commit 5f69f83

Please sign in to comment.