-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
573 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import Irys from '@irys/sdk' | ||
|
||
// Requires: PERMAWEB_KEY | ||
// $ node operations/fund-deployer.mjs | ||
|
||
const IRYS_NODE = 'https://node2.irys.xyz/' | ||
const jwk = JSON.parse( | ||
Buffer.from(process.env.PERMAWEB_KEY || 'NO_KEY', 'base64').toString('utf-8') | ||
) | ||
const irys = new Irys({ url: IRYS_NODE, token: 'arweave', key: jwk }) | ||
|
||
async function fundDeployer() { | ||
try { | ||
// const preBalance = await irys.getBalance('jp0QaS_Zai2hGaB-yRvAIMEtodmH_iHr0drpZxAZQtU') | ||
const preBalance = await irys.getLoadedBalance() | ||
console.log(`Irys loaded balance: ${preBalance}`) | ||
// const fundTx = await irys.fund(irys.utils.toAtomic(0.1)) | ||
// console.log(`Successfully funded ${irys.utils.fromAtomic(fundTx.quantity)} ${irys.token}`) | ||
} catch (e) { | ||
console.log('Error interacting with permadata ', e) | ||
} | ||
|
||
} | ||
|
||
fundDeployer().then().catch(err => console.error(err)) |
Oops, something went wrong.