mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
Bridges update subtree (#2625)
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
async function run(nodeName, networkInfo, args) {
|
||||
const {wsUri, userDefinedTypes} = networkInfo.nodesByName[nodeName];
|
||||
const api = await zombie.connect(wsUri, userDefinedTypes);
|
||||
|
||||
const accountAddress = args[0];
|
||||
const initialAccountData = await api.query.system.account(accountAddress);
|
||||
const initialAccountBalance = initialAccountData.data['free'];
|
||||
while (true) {
|
||||
const accountData = await api.query.system.account(accountAddress);
|
||||
const accountBalance = accountData.data['free'];
|
||||
if (accountBalance > initialAccountBalance) {
|
||||
return accountBalance;
|
||||
}
|
||||
|
||||
// else sleep and retry
|
||||
await new Promise((resolve) => setTimeout(resolve, 12000));
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { run }
|
||||
Reference in New Issue
Block a user