From bef70a874d4515597aceba676e8b026f1d1f90e1 Mon Sep 17 00:00:00 2001 From: kanshi <46557+kanshi@users.noreply.github.com> Date: Fri, 12 Jul 2024 11:22:08 +0200 Subject: [PATCH 1/4] Fix registrator address fetching --- operations/deploy-dashboard-dev.hcl | 2 +- operations/deploy-dashboard-live.hcl | 2 +- operations/deploy-dashboard-stage.hcl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/operations/deploy-dashboard-dev.hcl b/operations/deploy-dashboard-dev.hcl index db887af..c5cb458 100755 --- a/operations/deploy-dashboard-dev.hcl +++ b/operations/deploy-dashboard-dev.hcl @@ -31,7 +31,7 @@ job "deploy-relay-dashboard-dev" { NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/dev/address" ]]" NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-dev.dmz.ator.dev" NUXT_PUBLIC_SUPPORT_WALLET_PUBLIC_KEY_BASE64 = "{{.Data.data.SUPPORT_ADDRESS_BASE64}}" - NUXT_PUBLIC_REGISTRATOR_CONTRACT="0x850eDF904e64a61f175a11bD16A7501496131cc7" + NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/dev/address" ]]" {{with secret "kv/dashboard/dev"}} PERMAWEB_KEY="{{.Data.data.DASHBOARD_OWNER_KEY}}" {{end}} diff --git a/operations/deploy-dashboard-live.hcl b/operations/deploy-dashboard-live.hcl index ca72379..d17148d 100755 --- a/operations/deploy-dashboard-live.hcl +++ b/operations/deploy-dashboard-live.hcl @@ -29,7 +29,7 @@ job "deploy-relay-dashboard-live" { NUXT_PUBLIC_FACILITATOR_CONTRACT="[[ consulKey "facilitator/sepolia/live/address" ]]" NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/live/address" ]]" NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-live.dmz.ator.dev" - NUXT_PUBLIC_REGISTRATOR_CONTRACT="0x525C31B35065540059701eE5feC12120F581E96e" + NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/live/address" ]]" {{with secret "kv/dashboard/live"}} PERMAWEB_KEY="{{.Data.data.DASHBOARD_OWNER_KEY}}" NUXT_PUBLIC_SUPPORT_WALLET_PUBLIC_KEY_BASE64 = "{{.Data.data.SUPPORT_ADDRESS_BASE64}}" diff --git a/operations/deploy-dashboard-stage.hcl b/operations/deploy-dashboard-stage.hcl index 51cc493..8148d52 100755 --- a/operations/deploy-dashboard-stage.hcl +++ b/operations/deploy-dashboard-stage.hcl @@ -30,7 +30,7 @@ job "deploy-relay-dashboard-stage" { NUXT_PUBLIC_FACILITATOR_CONTRACT="[[ consulKey "facilitator/sepolia/stage/address" ]]" NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/stage/address" ]]" NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-stage.dmz.ator.dev" - NUXT_PUBLIC_REGISTRATOR_CONTRACT="0xe43443e3547ceE8Dc06ef389e35573f03408898F" + NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/stage/address" ]]" {{with secret "kv/dashboard/stage"}} PERMAWEB_KEY="{{.Data.data.DASHBOARD_OWNER_KEY}}" NUXT_PUBLIC_SUPPORT_WALLET_PUBLIC_KEY_BASE64 = "{{.Data.data.SUPPORT_ADDRESS_BASE64}}" From 7af7364509087df5526545cb156646129bf26100 Mon Sep 17 00:00:00 2001 From: kanshi <46557+kanshi@users.noreply.github.com> Date: Fri, 12 Jul 2024 12:52:40 +0200 Subject: [PATCH 2/4] Add script to fund deployer --- operations/fund-deployer.mjs | 25 ++ package-lock.json | 548 +++++++++++++++++++++++++++++++++++ 2 files changed, 573 insertions(+) create mode 100755 operations/fund-deployer.mjs diff --git a/operations/fund-deployer.mjs b/operations/fund-deployer.mjs new file mode 100755 index 0000000..804e0df --- /dev/null +++ b/operations/fund-deployer.mjs @@ -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)) diff --git a/package-lock.json b/package-lock.json index 8b9d072..91ada43 100755 --- a/package-lock.json +++ b/package-lock.json @@ -7,6 +7,7 @@ "name": "nuxt-app", "hasInstallScript": true, "dependencies": { + "@ar.io/sdk": "^1.2.1", "@iconify-json/eos-icons": "^1.1.10", "@iconify-json/heroicons": "^1.1.21", "@iconify-json/heroicons-outline": "^1.1.10", @@ -154,6 +155,315 @@ "node": ">=11.0.0" } }, + "node_modules/@ar.io/sdk": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@ar.io/sdk/-/sdk-1.2.2.tgz", + "integrity": "sha512-by/UFQzvqFCbiOWA2T0n3ENIVBDrXAcQSmRAcdBjwVCesRDNrMRAGAIqAGVfVbLGAiuv41pZ7oYWGSBMMYv9mQ==", + "dependencies": { + "@permaweb/aoconnect": "^0.0.55", + "arbundles": "0.11.0", + "arweave": "1.14.4", + "axios": "1.7.2", + "axios-retry": "^4.3.0", + "bunyan": "^1.8.15", + "eventemitter3": "^5.0.1", + "plimit-lit": "^3.0.1", + "warp-contracts": "1.4.45" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@ar.io/sdk/node_modules/arbundles": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/arbundles/-/arbundles-0.11.0.tgz", + "integrity": "sha512-8U4u5TjbD14mBO9bJkUfynVrHztBGtvYcMx2E5Yuyu/iiSRByJDFHfCINAY3+zvllkTipbPjTP5XlACJQIuRcw==", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/providers": "^5.7.2", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wallet": "^5.7.0", + "@irys/arweave": "^0.0.2", + "@noble/ed25519": "^1.6.1", + "base64url": "^3.0.1", + "bs58": "^4.0.1", + "keccak": "^3.0.2", + "secp256k1": "^5.0.0" + }, + "optionalDependencies": { + "@randlabs/myalgo-connect": "^1.1.2", + "algosdk": "^1.13.1", + "arweave-stream-tx": "^1.1.0", + "multistream": "^4.1.0", + "tmp-promise": "^3.0.2" + } + }, + "node_modules/@ar.io/sdk/node_modules/archiver": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/archiver/-/archiver-5.3.2.tgz", + "integrity": "sha512-+25nxyyznAXF7Nef3y0EbBeqmGZgeN/BxHX29Rs39djAfaFalmQ89SE6CWyDCHzGL0yt/ycBtNOmGTW0FyGWNw==", + "dependencies": { + "archiver-utils": "^2.1.0", + "async": "^3.2.4", + "buffer-crc32": "^0.2.1", + "readable-stream": "^3.6.0", + "readdir-glob": "^1.1.2", + "tar-stream": "^2.2.0", + "zip-stream": "^4.1.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ar.io/sdk/node_modules/archiver-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-2.1.0.tgz", + "integrity": "sha512-bEL/yUb/fNNiNTuUz979Z0Yg5L+LzLxGJz8x79lYmR54fmTIb6ob/hNQgkQnIUDWIFjZVQwl9Xs356I6BAMHfw==", + "dependencies": { + "glob": "^7.1.4", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^2.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@ar.io/sdk/node_modules/archiver-utils/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/@ar.io/sdk/node_modules/arweave": { + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/arweave/-/arweave-1.14.4.tgz", + "integrity": "sha512-tmqU9fug8XAmFETYwgUhLaD3WKav5DaM4p1vgJpEj/Px2ORPPMikwnSySlFymmL2qgRh2ZBcZsg11+RXPPGLsA==", + "dependencies": { + "arconnect": "^0.4.2", + "asn1.js": "^5.4.1", + "base64-js": "^1.5.1", + "bignumber.js": "^9.0.2" + }, + "engines": { + "node": ">=16.15.0" + } + }, + "node_modules/@ar.io/sdk/node_modules/async-mutex": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/async-mutex/-/async-mutex-0.4.1.tgz", + "integrity": "sha512-WfoBo4E/TbCX1G95XTjbWTE3X2XLG0m1Xbv2cwOtuPdyH9CZvnaA5nCt1ucjaKEgW2A5IF71hxrRhr83Je5xjA==", + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@ar.io/sdk/node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/@ar.io/sdk/node_modules/bignumber.js": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.1.tgz", + "integrity": "sha512-pHm4LsMJ6lzgNGVfZHjMoO8sdoRhOzOH4MLmY65Jg70bpxCKu5iOHNJyfF6OyvYw7t8Fpf35RuzUyqnQsj8Vig==", + "engines": { + "node": "*" + } + }, + "node_modules/@ar.io/sdk/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/@ar.io/sdk/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/@ar.io/sdk/node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "engines": { + "node": "*" + } + }, + "node_modules/@ar.io/sdk/node_modules/compress-commons": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/compress-commons/-/compress-commons-4.1.2.tgz", + "integrity": "sha512-D3uMHtGc/fcO1Gt1/L7i1e33VOvD4A9hfQLP+6ewd+BvG/gQ84Yh4oftEhAdjSMgBgwGL+jsppT7JYNpo6MHHg==", + "dependencies": { + "buffer-crc32": "^0.2.13", + "crc32-stream": "^4.0.2", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ar.io/sdk/node_modules/crc32-stream": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/crc32-stream/-/crc32-stream-4.0.3.tgz", + "integrity": "sha512-NT7w2JVU7DFroFdYkeq8cywxrgjPHWkdX1wjpRQXPX5Asews3tA+Ght6lddQO5Mkumffp3X7GEqku3epj2toIw==", + "dependencies": { + "crc-32": "^1.2.0", + "readable-stream": "^3.4.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ar.io/sdk/node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@ar.io/sdk/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/@ar.io/sdk/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "node_modules/@ar.io/sdk/node_modules/safe-stable-stringify": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.1.tgz", + "integrity": "sha512-dVHE6bMtS/bnL2mwualjc6IxEv1F+OCUpA46pKUj6F8uDbUM0jCCulPqRNPSnWwGNKx5etqMjZYdXtrm5KJZGA==", + "engines": { + "node": ">=10" + } + }, + "node_modules/@ar.io/sdk/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/@ar.io/sdk/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@ar.io/sdk/node_modules/warp-contracts": { + "version": "1.4.45", + "resolved": "https://registry.npmjs.org/warp-contracts/-/warp-contracts-1.4.45.tgz", + "integrity": "sha512-v4asbKIofCmQjH+1Q+yTyJmGUFwaL11zNnfaipRsxQ488MB7lGfQGNeadMfYhhc2yvUDhcVok1UcSfvfgugPaQ==", + "dependencies": { + "archiver": "^5.3.0", + "arweave": "1.14.4", + "async-mutex": "^0.4.0", + "bignumber.js": "9.1.1", + "events": "3.3.0", + "fast-copy": "^3.0.0", + "level": "^8.0.0", + "memory-level": "^1.0.0", + "safe-stable-stringify": "2.4.1", + "stream-buffers": "^3.0.2", + "unzipit": "^1.4.0", + "warp-arbundles": "^1.0.4", + "warp-isomorphic": "^1.0.7", + "warp-wasm-metering": "1.0.1" + }, + "engines": { + "node": ">=16.8" + } + }, + "node_modules/@ar.io/sdk/node_modules/zip-stream": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/zip-stream/-/zip-stream-4.1.1.tgz", + "integrity": "sha512-9qv4rlDiopXg4E69k+vMHjNN63YFMe9sZMrdlvKnCjlCRWeCBswPPMPUfx+ipsAWq1LXHe70RcbaHdJJpS6hyQ==", + "dependencies": { + "archiver-utils": "^3.0.4", + "compress-commons": "^4.1.2", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/@ar.io/sdk/node_modules/zip-stream/node_modules/archiver-utils": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/archiver-utils/-/archiver-utils-3.0.4.tgz", + "integrity": "sha512-KVgf4XQVrTjhyWmx6cte4RxonPLR9onExufI1jhvw/MQ4BB6IsZD5gT8Lq+u/+pRkWna/6JoHpiQioaqFP5Rzw==", + "dependencies": { + "glob": "^7.2.3", + "graceful-fs": "^4.2.0", + "lazystream": "^1.0.0", + "lodash.defaults": "^4.2.0", + "lodash.difference": "^4.5.0", + "lodash.flatten": "^4.4.0", + "lodash.isplainobject": "^4.0.6", + "lodash.union": "^4.6.0", + "normalize-path": "^3.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">= 10" + } + }, "node_modules/@babel/code-frame": { "version": "7.24.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", @@ -6236,6 +6546,59 @@ "node": "^16 || ^18 || >= 20" } }, + "node_modules/@permaweb/ao-scheduler-utils": { + "version": "0.0.19", + "resolved": "https://registry.npmjs.org/@permaweb/ao-scheduler-utils/-/ao-scheduler-utils-0.0.19.tgz", + "integrity": "sha512-xwIe9FqQ1UZxEYWvSGJDONz0xr4vDq2Ny1NeRUiO0dKYoonShN+oI1ULgrHocKOjOPNEgRX70vMCKGLe+3x70A==", + "dependencies": { + "lru-cache": "^10.2.2", + "ramda": "^0.30.0", + "zod": "^3.23.5" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@permaweb/ao-scheduler-utils/node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" + }, + "node_modules/@permaweb/ao-scheduler-utils/node_modules/ramda": { + "version": "0.30.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.30.1.tgz", + "integrity": "sha512-tEF5I22zJnuclswcZMc8bDIrwRHRzf+NqVEmqg50ShAZMP7MWeR/RGDthfM/p+BlqvF2fXAzpn8i+SJcYD3alw==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ramda" + } + }, + "node_modules/@permaweb/ao-scheduler-utils/node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + }, + "node_modules/@permaweb/aoconnect": { + "version": "0.0.55", + "resolved": "https://registry.npmjs.org/@permaweb/aoconnect/-/aoconnect-0.0.55.tgz", + "integrity": "sha512-W2GtLZedVseuDkCKk4CmM9SFmi0DdrMKqvhMBm9xo65z+Mzr/t1TEjMJKRNzEA2qh5IdwM43sWJ5fmbBYLg6TQ==", + "dependencies": { + "@permaweb/ao-scheduler-utils": "~0.0.16", + "buffer": "^6.0.3", + "debug": "^4.3.4", + "hyper-async": "^1.1.2", + "mnemonist": "^0.39.8", + "ramda": "^0.29.1", + "warp-arbundles": "^1.0.4", + "zod": "^3.22.4" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/@pinia/nuxt": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/@pinia/nuxt/-/nuxt-0.5.1.tgz", @@ -10814,6 +11177,17 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/axios-retry": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/axios-retry/-/axios-retry-4.4.1.tgz", + "integrity": "sha512-JGzNoglDHtHWIEvvAampB0P7jxQ/sT4COmW0FgSQkVg6o4KqNjNMBI6uFVOq517hkw/OAYYAG08ADtBlV8lvmQ==", + "dependencies": { + "is-retry-allowed": "^2.2.0" + }, + "peerDependencies": { + "axios": "0.x || 1.x" + } + }, "node_modules/b4a": { "version": "1.6.6", "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", @@ -11457,6 +11831,23 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/bunyan": { + "version": "1.8.15", + "resolved": "https://registry.npmjs.org/bunyan/-/bunyan-1.8.15.tgz", + "integrity": "sha512-0tECWShh6wUysgucJcBAoYegf3JJoZWibxdqhTm7OHPeT42qdjkZ29QCMcKwbgU1kiH+auSIasNRXMLWXafXig==", + "engines": [ + "node >=0.10.0" + ], + "bin": { + "bunyan": "bin/bunyan" + }, + "optionalDependencies": { + "dtrace-provider": "~0.8", + "moment": "^2.19.3", + "mv": "~2", + "safe-json-stringify": "~1" + } + }, "node_modules/bytes": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz", @@ -13345,6 +13736,19 @@ "resolved": "https://registry.npmjs.org/doublearray/-/doublearray-0.0.2.tgz", "integrity": "sha512-aw55FtZzT6AmiamEj2kvmR6BuFqvYgKZUkfQ7teqVRNqD5UE0rw8IeW/3gieHNKQ5sPuDKlljWEn4bzv5+1bHw==" }, + "node_modules/dtrace-provider": { + "version": "0.8.8", + "resolved": "https://registry.npmjs.org/dtrace-provider/-/dtrace-provider-0.8.8.tgz", + "integrity": "sha512-b7Z7cNtHPhH9EJhNNbbeqTcXB8LGFFZhq1PGgEvpeHlzd36bhbdTWoE/Ba/YguqpBSlAPKnARWhVlhunCMwfxg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "nan": "^2.14.0" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/duplexer": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", @@ -15049,6 +15453,11 @@ "url": "https://github.com/sponsors/typicode" } }, + "node_modules/hyper-async": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/hyper-async/-/hyper-async-1.1.2.tgz", + "integrity": "sha512-cnpOgKa+5FZOaccTtjduac1FrZuSc38/ftCp3vYJdUMt+7c+uvGDKLDK4MTNK8D3aFjIeveVrPcSgUPvzZLopg==" + }, "node_modules/i18next": { "version": "22.5.1", "resolved": "https://registry.npmjs.org/i18next/-/i18next-22.5.1.tgz", @@ -15579,6 +15988,17 @@ "@types/estree": "*" } }, + "node_modules/is-retry-allowed": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-2.2.0.tgz", + "integrity": "sha512-XVm7LOeLpTW4jV19QSH38vkswxoLud8sQ57YwJVTPWdiaI9I8keEhGFpBlslyVsgdQy4Opg8QOLb8YRgsyZiQg==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-ssh": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz", @@ -18303,6 +18723,14 @@ "ufo": "^1.5.3" } }, + "node_modules/mnemonist": { + "version": "0.39.8", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.39.8.tgz", + "integrity": "sha512-vyWo2K3fjrUw8YeeZ1zF0fy6Mu59RHokURlld8ymdUPjMlD9EC9ov1/YPqTgqRvUN9nTr3Gqfz29LYAmu0PHPQ==", + "dependencies": { + "obliterator": "^2.0.1" + } + }, "node_modules/module-error": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/module-error/-/module-error-1.0.2.tgz", @@ -18395,6 +18823,72 @@ "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "node_modules/mv": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/mv/-/mv-2.1.1.tgz", + "integrity": "sha512-at/ZndSy3xEGJ8i0ygALh8ru9qy7gWW1cmkaqBN29JmMlIvM//MEO9y1sk/avxuwnPcfhkejkLsuPxH81BrkSg==", + "optional": true, + "dependencies": { + "mkdirp": "~0.5.1", + "ncp": "~2.0.0", + "rimraf": "~2.4.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/mv/node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/mv/node_modules/glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha512-MKZeRNyYZAVVVG1oZeLaWie1uweH40m9AZwIwxyPbTSX4hHrVYSzLg0Ro5Z5R7XKkIX+Cc6oD1rqeDJnwsB8/A==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "optional": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mv/node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mv/node_modules/rimraf": { + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.5.tgz", + "integrity": "sha512-J5xnxTyqaiw06JjMftq7L9ouA448dw/E7dKghkP9WpKNuwmARNNg+Gk8/u5ryb9N/Yo2+z3MCwuqFK/+qPOPfQ==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "optional": true, + "dependencies": { + "glob": "^6.0.1" + }, + "bin": { + "rimraf": "bin.js" + } + }, "node_modules/mz": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", @@ -18405,6 +18899,12 @@ "thenify-all": "^1.0.0" } }, + "node_modules/nan": { + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.20.0.tgz", + "integrity": "sha512-bk3gXBZDGILuuo/6sKtr0DQmSThYHLtNCdSdXk9YkxD/jK6X2vmCyyXBBxyqZ4XcnzTyYEAThfX3DCEnLf6igw==", + "optional": true + }, "node_modules/nanoid": { "version": "5.0.7", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-5.0.7.tgz", @@ -18427,6 +18927,15 @@ "resolved": "https://registry.npmjs.org/napi-macros/-/napi-macros-2.2.2.tgz", "integrity": "sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==" }, + "node_modules/ncp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ncp/-/ncp-2.0.0.tgz", + "integrity": "sha512-zIdGUrPRFTUELUvr3Gmc7KZ2Sw/h1PiVM0Af/oHB6zgnV1ikqSfRk+TOufi79aHYCW3NiOXmr1BP5nWbzojLaA==", + "optional": true, + "bin": { + "ncp": "bin/ncp" + } + }, "node_modules/near-hd-key": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/near-hd-key/-/near-hd-key-1.2.1.tgz", @@ -19848,6 +20357,11 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==" + }, "node_modules/ofetch": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/ofetch/-/ofetch-1.3.4.tgz", @@ -20516,6 +21030,17 @@ "pathe": "^1.1.2" } }, + "node_modules/plimit-lit": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/plimit-lit/-/plimit-lit-3.0.1.tgz", + "integrity": "sha512-EyTTdP5LMX6WbHihG8R9w6DS+c3pyMpeKooOFuGDCyuVBogQjYNtoYwKLRD6hM1+VkHzGcfIuyLoWi6l5JA3iA==", + "dependencies": { + "queue-lit": "^3.0.0" + }, + "engines": { + "node": ">=18" + } + }, "node_modules/pngjs": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", @@ -21531,6 +22056,14 @@ "inherits": "~2.0.3" } }, + "node_modules/queue-lit": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/queue-lit/-/queue-lit-3.0.0.tgz", + "integrity": "sha512-iyVL2X5G58kICVGLW/nseYmdHxBoAp2Gav16H23NPtIllyEJ+UheHlYZqBjO+lJHRYoZRSrX7chH8tMrH9MB/A==", + "engines": { + "node": ">=18" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -21576,6 +22109,15 @@ "resolved": "https://registry.npmjs.org/radix3/-/radix3-1.1.2.tgz", "integrity": "sha512-b484I/7b8rDEdSDKckSSBA8knMpcdsXudlE/LNL639wFoHKwLbEkQFZHWEYwDC0wa0FKUcCY+GAF73Z7wxNVFA==" }, + "node_modules/ramda": { + "version": "0.29.1", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.29.1.tgz", + "integrity": "sha512-OfxIeWzd4xdUNxlWhgFazxsA/nl3mS4/jGZI5n00uWOoSSFRhC1b6gl6xvmzUamgmqELraWp0J/qqVlXYPDPyA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/ramda" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -22654,6 +23196,12 @@ } ] }, + "node_modules/safe-json-stringify": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/safe-json-stringify/-/safe-json-stringify-1.2.0.tgz", + "integrity": "sha512-gH8eh2nZudPQO6TytOvbxnuhYBOvDBBLW52tz5q6X58lJcd/tkmqFR+5Z9adS8aJtURSXWThWy/xJtJwixErvg==", + "optional": true + }, "node_modules/safe-stable-stringify": { "version": "2.4.3", "resolved": "https://registry.npmjs.org/safe-stable-stringify/-/safe-stable-stringify-2.4.3.tgz", From 4d9c2875a92a5522b2d1342e4e69f0304da93160 Mon Sep 17 00:00:00 2001 From: kanshi <46557+kanshi@users.noreply.github.com> Date: Fri, 12 Jul 2024 15:04:35 +0200 Subject: [PATCH 3/4] Fix logo, ignore pnpm-lock, cleanup readme --- .gitignore | 2 ++ README.md | 47 +----------------------------- components/DashboardHeader.vue | 1 - components/ui-kit/TitleAndLogo.vue | 14 ++------- 4 files changed, 5 insertions(+), 59 deletions(-) diff --git a/.gitignore b/.gitignore index 4a7f73a..da0a37b 100755 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,5 @@ logs .env .env.* !.env.example + +pnpm-lock.yaml \ No newline at end of file diff --git a/README.md b/README.md index d3ccf2a..4b62795 100755 --- a/README.md +++ b/README.md @@ -1,31 +1,7 @@ -# AnyOne Relay Dashboard (WIP) +# AnyOne Relay Dashboard This repo houses the code to display the user specific information pertaining to ANON Relays. -## To Do - -Since this is in progress, there is still work to be done. -While this list seems long much of the boilerplate exists. - -- Get claimable rewards total -- Get previously claimed to date -- Get reward history per user and plot a graph (empty array now) -- We need to implement signing for the functions - see below. -- Register, Claim and Renounce functions need to be tested (need mock data) -- We need decent mock data to test properly - -## Background - -This is actually the third iteration of this code: - -1. ANON built: https://github.com/ATOR-Development/ator-dashboard/ -2. Brewlabs built: https://github.com/brewlabs-code/ator/ -3. Brewlabs built stripped down: https://github.com/brewlabs-code/ator-relay-dashboard - -For reasons not worth getting into now ANON changed directions technically. As such the 2nd build was halted. -Now, the underlying tech has changed somewhat and we are developing an MVP version focussing on the user account section. -Much of the code has been migrated but also some updates where necessary. - ## Tech used While there is a bunch of other packages installed some worth pointing out are: @@ -82,26 +58,5 @@ Data is stored on chain using Arweave - this means it's permanent. Locally or in the app, the data is stored using Pinia. -### Getting data - -For the most part data is fetched using Nuxt's `useAsyncData`. -See https://nuxt.com/docs/getting-started/data-fetching - -Often, but not always, the results are stored in a Pinia state store. -Alongside the store there are actions to retrieve the data, these actions or functions are called by `useAsyncData`, this means we can easily refresh, cache and manage the data. - -#### To get relay data per user we do something like this: - -- Using the Warp SDK we can get the contracts state. -- Namely we want to get `verified` and `claimable` data. -- This returns a list of relay fingerprints and associated addresses, stored in Pinia as a Getter. -- The data is fetched here, `components\DataTableMyRelays.vue`, but stored in Pinia. -- Since this only gives us relay fingerprints, we make an additional request to Arweave (using ARDB) `stores\useMetricsStore.ts`. -- That gives use transaction data, namely the latest transaction ID. -- We use that to retrieve relay meta in JSON format for ALL relays. -- Then we need to map it to the existing fingerprints we retrieved earlier and display in the table. - ## Resources - - https://cookbook.g8way.io/concepts/index.html -- http://arweave.net/bKdUd6vonjrZS4-FUGMPr5ecOeF405pR2DdO_at1D9I (example of Arweave JSON data) diff --git a/components/DashboardHeader.vue b/components/DashboardHeader.vue index 9f4ee84..f372677 100755 --- a/components/DashboardHeader.vue +++ b/components/DashboardHeader.vue @@ -22,7 +22,6 @@ const menuStore = useMenuStore(); >