From 9ea50ed684f5a40d5819cbad2013a12ec8483092 Mon Sep 17 00:00:00 2001 From: dmoka Date: Mon, 9 Mar 2026 10:36:10 +0100 Subject: [PATCH 1/3] fix bug of atoken rounding error, leading to off by one error in reducible balance --- Cargo.lock | 6 ++-- integration-tests/Cargo.toml | 2 +- integration-tests/src/dca.rs | 53 ++++++++++++++++++++++++++++++++++++ pallets/dca/Cargo.toml | 2 +- pallets/dca/src/lib.rs | 7 +++-- runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/lib.rs | 2 +- 7 files changed, 65 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4999750a1..24697d2b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6161,7 +6161,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "399.0.0" +version = "400.0.0" dependencies = [ "alloy-primitives 0.7.7", "alloy-sol-types 0.7.7", @@ -9856,7 +9856,7 @@ dependencies = [ [[package]] name = "pallet-dca" -version = "1.15.0" +version = "1.16.0" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -15289,7 +15289,7 @@ checksum = "48fd7bd8a6377e15ad9d42a8ec25371b94ddc67abe7c8b9127bec79bebaaae18" [[package]] name = "runtime-integration-tests" -version = "1.71.0" +version = "1.72.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 18fc4a620..78d6ec08c 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.71.0" +version = "1.72.0" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/integration-tests/src/dca.rs b/integration-tests/src/dca.rs index 5392f9068..b0159ec7d 100644 --- a/integration-tests/src/dca.rs +++ b/integration-tests/src/dca.rs @@ -2124,6 +2124,59 @@ mod omnipool { assert_balance!(ALICE.into(), HDX, 0); }); } + + #[test] + fn sell_schedule_should_use_slippage_limit_when_min_amount_out_is_zero() { + TestNet::reset(); + Hydra::execute_with(|| { + //Arrange + init_omnipool_with_oracle_for_block_10(); + let alice_init_hdx_balance = 5000 * UNITS; + assert_ok!(Balances::force_set_balance( + RuntimeOrigin::root(), + ALICE.into(), + alice_init_hdx_balance, + )); + + let dca_budget = 1100 * UNITS; + let amount_to_sell = 100 * UNITS; + + // Create sell schedule with min_amount_out = 0 + // This means last_block_slippage_min_limit will be used as the effective limit + let schedule = Schedule { + owner: AccountId::from(ALICE), + period: 5u32, + total_amount: dca_budget, + max_retries: None, + stability_threshold: None, + slippage: Some(Permill::from_percent(5)), + order: Order::Sell { + asset_in: HDX, + asset_out: DAI, + amount_in: amount_to_sell, + min_amount_out: 0, + route: create_bounded_vec(vec![Trade { + pool: PoolType::Omnipool, + asset_in: HDX, + asset_out: DAI, + }]), + }, + }; + create_schedule(ALICE, schedule); + + let alice_dai_before = Currencies::free_balance(DAI, &ALICE.into()); + + //Act + go_to_block(12); + + //Assert - DCA executed successfully and schedule is still alive + let alice_dai_after = Currencies::free_balance(DAI, &ALICE.into()); + assert!(alice_dai_after > alice_dai_before, "ALICE should have received DAI from the trade"); + + let schedule = DCA::schedules(0); + assert!(schedule.is_some(), "DCA schedule should still be alive after execution"); + }); + } } mod fee { diff --git a/pallets/dca/Cargo.toml b/pallets/dca/Cargo.toml index d27a08ac7..46b978bf4 100644 --- a/pallets/dca/Cargo.toml +++ b/pallets/dca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-dca' -version = "1.15.0" +version = "1.16.0" description = 'A pallet to manage DCA scheduling' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/dca/src/lib.rs b/pallets/dca/src/lib.rs index 27913f013..1db9544d3 100644 --- a/pallets/dca/src/lib.rs +++ b/pallets/dca/src/lib.rs @@ -833,16 +833,19 @@ impl Pallet { let last_trade = trade_amounts.last().defensive_ok_or(Error::::InvalidState)?; let amount_out = last_trade.amount_out; - if *min_amount_out > last_block_slippage_min_limit { + let effective_min_limit = if *min_amount_out > last_block_slippage_min_limit { ensure!(amount_out >= *min_amount_out, Error::::TradeLimitReached); + amount_out } else { ensure!( amount_out >= last_block_slippage_min_limit, Error::::SlippageLimitReached ); + // Use slippage limit to mainly absorb aToken rounding errors + last_block_slippage_min_limit }; - T::RouteExecutor::sell(origin, *asset_in, *asset_out, amount_to_sell, amount_out, route.clone())?; + T::RouteExecutor::sell(origin, *asset_in, *asset_out, amount_to_sell, effective_min_limit, route.clone())?; Ok(AmountInAndOut { amount_in: amount_to_sell, diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 79724ae89..b25171388 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "399.0.0" +version = "400.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 50a083f0f..a4efba325 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -129,7 +129,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: Cow::Borrowed("hydradx"), impl_name: Cow::Borrowed("hydradx"), authoring_version: 1, - spec_version: 399, + spec_version: 400, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 9b937cd839c6907b8766971503f4f73a64bd302d Mon Sep 17 00:00:00 2001 From: dmoka Date: Mon, 9 Mar 2026 10:43:07 +0100 Subject: [PATCH 2/3] formatting --- integration-tests/src/dca.rs | 13 ++++++++----- pallets/dca/src/lib.rs | 9 ++++++++- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/integration-tests/src/dca.rs b/integration-tests/src/dca.rs index b0159ec7d..095d5bf6b 100644 --- a/integration-tests/src/dca.rs +++ b/integration-tests/src/dca.rs @@ -2133,10 +2133,10 @@ mod omnipool { init_omnipool_with_oracle_for_block_10(); let alice_init_hdx_balance = 5000 * UNITS; assert_ok!(Balances::force_set_balance( - RuntimeOrigin::root(), - ALICE.into(), - alice_init_hdx_balance, - )); + RuntimeOrigin::root(), + ALICE.into(), + alice_init_hdx_balance, + )); let dca_budget = 1100 * UNITS; let amount_to_sell = 100 * UNITS; @@ -2171,7 +2171,10 @@ mod omnipool { //Assert - DCA executed successfully and schedule is still alive let alice_dai_after = Currencies::free_balance(DAI, &ALICE.into()); - assert!(alice_dai_after > alice_dai_before, "ALICE should have received DAI from the trade"); + assert!( + alice_dai_after > alice_dai_before, + "ALICE should have received DAI from the trade" + ); let schedule = DCA::schedules(0); assert!(schedule.is_some(), "DCA schedule should still be alive after execution"); diff --git a/pallets/dca/src/lib.rs b/pallets/dca/src/lib.rs index 1db9544d3..ef0503180 100644 --- a/pallets/dca/src/lib.rs +++ b/pallets/dca/src/lib.rs @@ -845,7 +845,14 @@ impl Pallet { last_block_slippage_min_limit }; - T::RouteExecutor::sell(origin, *asset_in, *asset_out, amount_to_sell, effective_min_limit, route.clone())?; + T::RouteExecutor::sell( + origin, + *asset_in, + *asset_out, + amount_to_sell, + effective_min_limit, + route.clone(), + )?; Ok(AmountInAndOut { amount_in: amount_to_sell, From ebda58944db0b7365f65e6110073d011492fb46e Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Mar 2026 15:07:06 +0100 Subject: [PATCH 3/3] add dca monitor script and improve createProposal script --- scripts/dca-monitor/index.js | 296 +++++++ scripts/dca-monitor/package-lock.json | 1119 +++++++++++++++++++++++++ scripts/dca-monitor/package.json | 17 + scripts/mint-limit/createProposal.js | 24 +- 4 files changed, 1451 insertions(+), 5 deletions(-) create mode 100644 scripts/dca-monitor/index.js create mode 100644 scripts/dca-monitor/package-lock.json create mode 100644 scripts/dca-monitor/package.json diff --git a/scripts/dca-monitor/index.js b/scripts/dca-monitor/index.js new file mode 100644 index 000000000..21c585e36 --- /dev/null +++ b/scripts/dca-monitor/index.js @@ -0,0 +1,296 @@ +import {ApiPromise, WsProvider, Keyring} from "@polkadot/api"; + +const ENDPOINT = 'ws://localhost:8000'; +const BLOCK_COUNT = 150; + +async function main() { + console.log(`Connecting to ${ENDPOINT}...`); + const provider = new WsProvider(ENDPOINT); + const api = await ApiPromise.create({ + provider, + throwOnConnect: false, + throwOnError: false, + }); + + const chain = await api.rpc.system.chain(); + console.log(`Connected to ${chain}`); + + const keyring = new Keyring({type: 'sr25519'}); + const alice = keyring.addFromUri('//Alice'); + console.log(`Using account: ${alice.address}`); + + // Per-schedule tracker: Map + const schedules = new Map(); + const randomnessFailures = []; + const reserveUnlocks = []; + + // Non-DCA event trackers + const extrinsicFailures = []; + const routerExecutions = []; + const swaps = []; + const dustLost = []; + + const getSchedule = (id) => { + if (!schedules.has(id)) { + schedules.set(id, { + events: [], + status: 'active', + failureDetails: [], + who: null, + }); + } + return schedules.get(id); + }; + + const truncate = (addr) => { + if (!addr) return 'N/A'; + const s = addr.toString(); + return s.length > 16 ? `${s.slice(0, 8)}...${s.slice(-6)}` : s; + }; + + const decodeError = (dispatchError) => { + if (dispatchError.isModule) { + const decoded = api.registry.findMetaError(dispatchError.asModule); + return `${decoded.section}.${decoded.method}`; + } + return dispatchError.toString(); + }; + + let nonce = (await api.rpc.system.accountNextIndex(alice.address)).toNumber(); + + console.log(`\nProducing ${BLOCK_COUNT} blocks and monitoring DCA events...\n`); + + for (let i = 0; i < BLOCK_COUNT; i++) { + const blockHash = await new Promise((resolve, reject) => { + api.tx.system.remark('dca-monitor').signAndSend(alice, {nonce: nonce++}, (receipt) => { + if (receipt.status.isInBlock) { + resolve(receipt.status.asInBlock); + } + }).catch(reject); + }); + + const blockNumber = (await api.rpc.chain.getHeader(blockHash)).number.toNumber(); + + // Query ALL block events (DCA fires in on_initialize, not in extrinsic receipts) + const events = await api.query.system.events.at(blockHash); + + let dcaCount = 0; + let otherCount = 0; + for (const record of events) { + const {event} = record; + const section = event.section; + const method = event.method; + const data = event.data; + + if (section === 'dca') { + dcaCount++; + switch (method) { + case 'ExecutionStarted': { + const id = data[0].toString(); + const schedule = getSchedule(id); + schedule.events.push({method, block: blockNumber}); + break; + } + case 'Scheduled': { + const id = data[0].toString(); + const who = data[1].toString(); + const schedule = getSchedule(id); + schedule.who = who; + schedule.events.push({method, block: blockNumber}); + break; + } + case 'ExecutionPlanned': { + const id = data[0].toString(); + const who = data[1].toString(); + const schedule = getSchedule(id); + schedule.who = schedule.who || who; + schedule.events.push({method, block: blockNumber}); + break; + } + case 'TradeExecuted': { + const id = data[0].toString(); + const who = data[1].toString(); + const amountIn = data[2].toString(); + const amountOut = data[3].toString(); + const schedule = getSchedule(id); + schedule.who = schedule.who || who; + schedule.events.push({method, block: blockNumber, amountIn, amountOut}); + break; + } + case 'TradeFailed': { + const id = data[0].toString(); + const who = data[1].toString(); + const error = decodeError(data[2]); + const schedule = getSchedule(id); + schedule.who = schedule.who || who; + schedule.events.push({method, block: blockNumber, error}); + schedule.failureDetails.push({block: blockNumber, error}); + break; + } + case 'Terminated': { + const id = data[0].toString(); + const who = data[1].toString(); + const error = decodeError(data[2]); + const schedule = getSchedule(id); + schedule.who = schedule.who || who; + schedule.status = 'terminated'; + schedule.events.push({method, block: blockNumber, error}); + schedule.failureDetails.push({block: blockNumber, error: `TERMINATED: ${error}`}); + break; + } + case 'Completed': { + const id = data[0].toString(); + const who = data[1].toString(); + const schedule = getSchedule(id); + schedule.who = schedule.who || who; + schedule.status = 'completed'; + schedule.events.push({method, block: blockNumber}); + break; + } + case 'RandomnessGenerationFailed': { + const block = data[0].toString(); + const error = decodeError(data[1]); + randomnessFailures.push({block: blockNumber, error}); + break; + } + case 'ReserveUnlocked': { + const who = data[0].toString(); + const assetId = data[1].toString(); + reserveUnlocks.push({who, assetId, block: blockNumber}); + break; + } + default: + console.log(` Unknown DCA event: ${method}`); + } + } else if (section === 'system' && method === 'ExtrinsicFailed') { + otherCount++; + const dispatchError = data[0]; + extrinsicFailures.push({block: blockNumber, error: decodeError(dispatchError)}); + } else if (section === 'router' && method === 'Executed') { + otherCount++; + routerExecutions.push({ + block: blockNumber, + assetIn: data[0].toString(), + assetOut: data[1].toString(), + amountIn: data[2].toString(), + amountOut: data[3].toString(), + }); + } else if (section === 'broadcast' && method === 'Swapped3') { + otherCount++; + swaps.push({block: blockNumber, swapper: data[0].toString()}); + } else if (section === 'tokens' && method === 'DustLost') { + otherCount++; + dustLost.push({ + block: blockNumber, + who: data[0].toString(), + assetId: data[1].toString(), + amount: data[2].toString(), + }); + } + } + + const parts = []; + if (dcaCount > 0) parts.push(`${dcaCount} DCA`); + if (otherCount > 0) parts.push(`${otherCount} other`); + console.log(`Block #${blockNumber} (${i + 1}/${BLOCK_COUNT}): ${parts.length > 0 ? parts.join(', ') : 'no tracked events'}`); + } + + // === Output Summary === + console.log('\n' + '='.repeat(80)); + console.log('DCA MONITOR SUMMARY'); + console.log('='.repeat(80)); + + if (schedules.size === 0) { + console.log('\nNo DCA schedule events detected in the monitored blocks.'); + } else { + const tableData = []; + for (const [id, info] of schedules) { + const executions = info.events.filter(e => e.method === 'ExecutionStarted').length; + const tradesOk = info.events.filter(e => e.method === 'TradeExecuted').length; + const tradesFailed = info.events.filter(e => e.method === 'TradeFailed').length; + const lastTrade = [...info.events].reverse().find(e => e.method === 'TradeExecuted' || e.method === 'TradeFailed'); + tableData.push({ + 'Schedule ID': id, + 'Owner': truncate(info.who), + 'Executions': executions, + 'Trades OK': tradesOk, + 'Trades Failed': tradesFailed, + 'Last Trade': lastTrade ? (lastTrade.method === 'TradeExecuted' ? 'OK' : 'FAILED') : '-', + 'Status': info.status, + }); + } + console.log('\nSchedule Summary:'); + console.table(tableData); + + // Print failure details + const allFailures = []; + for (const [id, info] of schedules) { + for (const f of info.failureDetails) { + allFailures.push({'Schedule ID': id, 'Block': f.block, 'Error': f.error}); + } + } + if (allFailures.length > 0) { + console.log('\nFailure Details:'); + console.table(allFailures); + } + } + + if (randomnessFailures.length > 0) { + console.log('\nRandomness Generation Failures:'); + console.table(randomnessFailures); + } + + if (reserveUnlocks.length > 0) { + console.log('\nReserve Unlocks:'); + console.table(reserveUnlocks.map(r => ({ + 'Owner': truncate(r.who), + 'Asset ID': r.assetId, + 'Block': r.block, + }))); + } + + // === Non-DCA Events === + console.log('\n' + '='.repeat(80)); + console.log('OTHER EVENTS'); + console.log('='.repeat(80)); + + console.log(`\nRouter Executions: ${routerExecutions.length}`); + console.log(`Broadcast Swaps: ${swaps.length}`); + console.log(`Extrinsic Failures: ${extrinsicFailures.length}`); + console.log(`Dust Lost: ${dustLost.length}`); + + if (extrinsicFailures.length > 0) { + console.log('\nExtrinsic Failure Details:'); + console.table(extrinsicFailures); + } + + if (dustLost.length > 0) { + console.log('\nDust Lost Details:'); + console.table(dustLost.map(d => ({ + 'Block': d.block, + 'Who': truncate(d.who), + 'Asset ID': d.assetId, + 'Amount': d.amount, + }))); + } + + // Final verdict + const totalSchedules = schedules.size; + const terminatedSchedules = [...schedules.values()].filter(s => s.status === 'terminated').length; + const withTradeFailures = [...schedules.values()].filter(s => s.failureDetails.length > 0 && s.status !== 'terminated').length; + + console.log('\n' + '='.repeat(80)); + console.log('VERDICT'); + console.log('='.repeat(80)); + console.log(`DCA schedules: ${totalSchedules} observed — ${terminatedSchedules} terminated, ${withTradeFailures} with trade failures`); + console.log(`Extrinsic failures: ${extrinsicFailures.length}`); + console.log(`Dust lost events: ${dustLost.length}`); + console.log('='.repeat(80)); + + await api.disconnect(); + console.log('Disconnected.'); +} + +main() + .catch(console.error) + .finally(() => process.exit(0)); diff --git a/scripts/dca-monitor/package-lock.json b/scripts/dca-monitor/package-lock.json new file mode 100644 index 000000000..6b914deb4 --- /dev/null +++ b/scripts/dca-monitor/package-lock.json @@ -0,0 +1,1119 @@ +{ + "name": "dca-monitor", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "dca-monitor", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@polkadot/api": "^16.4.5", + "@polkadot/keyring": "^13.5.5" + } + }, + "node_modules/@noble/curves": { + "version": "1.9.7", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", + "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@polkadot-api/json-rpc-provider": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider/-/json-rpc-provider-0.0.1.tgz", + "integrity": "sha512-/SMC/l7foRjpykLTUTacIH05H3mr9ip8b5xxfwXlVezXrNVLp3Cv0GX6uItkKd+ZjzVPf3PFrDF2B2/HLSNESA==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot-api/json-rpc-provider-proxy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/json-rpc-provider-proxy/-/json-rpc-provider-proxy-0.1.0.tgz", + "integrity": "sha512-8GSFE5+EF73MCuLQm8tjrbCqlgclcHBSRaswvXziJ0ZW7iw3UEMsKkkKvELayWyBuOPa2T5i1nj6gFOeIsqvrg==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot-api/metadata-builders": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/metadata-builders/-/metadata-builders-0.3.2.tgz", + "integrity": "sha512-TKpfoT6vTb+513KDzMBTfCb/ORdgRnsS3TDFpOhAhZ08ikvK+hjHMt5plPiAX/OWkm1Wc9I3+K6W0hX5Ab7MVg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/substrate-bindings": "0.6.0", + "@polkadot-api/utils": "0.1.0" + } + }, + "node_modules/@polkadot-api/observable-client": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@polkadot-api/observable-client/-/observable-client-0.3.2.tgz", + "integrity": "sha512-HGgqWgEutVyOBXoGOPp4+IAq6CNdK/3MfQJmhCJb8YaJiaK4W6aRGrdQuQSTPHfERHCARt9BrOmEvTXAT257Ug==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/metadata-builders": "0.3.2", + "@polkadot-api/substrate-bindings": "0.6.0", + "@polkadot-api/utils": "0.1.0" + }, + "peerDependencies": { + "@polkadot-api/substrate-client": "0.1.4", + "rxjs": ">=7.8.0" + } + }, + "node_modules/@polkadot-api/substrate-bindings": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-bindings/-/substrate-bindings-0.6.0.tgz", + "integrity": "sha512-lGuhE74NA1/PqdN7fKFdE5C1gNYX357j1tWzdlPXI0kQ7h3kN0zfxNOpPUN7dIrPcOFZ6C0tRRVrBylXkI6xPw==", + "license": "MIT", + "optional": true, + "dependencies": { + "@noble/hashes": "^1.3.1", + "@polkadot-api/utils": "0.1.0", + "@scure/base": "^1.1.1", + "scale-ts": "^1.6.0" + } + }, + "node_modules/@polkadot-api/substrate-client": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@polkadot-api/substrate-client/-/substrate-client-0.1.4.tgz", + "integrity": "sha512-MljrPobN0ZWTpn++da9vOvt+Ex+NlqTlr/XT7zi9sqPtDJiQcYl+d29hFAgpaeTqbeQKZwz3WDE9xcEfLE8c5A==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/json-rpc-provider": "0.0.1", + "@polkadot-api/utils": "0.1.0" + } + }, + "node_modules/@polkadot-api/utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/@polkadot-api/utils/-/utils-0.1.0.tgz", + "integrity": "sha512-MXzWZeuGxKizPx2Xf/47wx9sr/uxKw39bVJUptTJdsaQn/TGq+z310mHzf1RCGvC1diHM8f593KrnDgc9oNbJA==", + "license": "MIT", + "optional": true + }, + "node_modules/@polkadot/api": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-16.5.4.tgz", + "integrity": "sha512-mX1fwtXCBAHXEyZLSnSrMDGP+jfU2rr7GfDVQBz0cBY1nmY8N34RqPWGrZWj8o4DxVu1DQ91sGncOmlBwEl0Qg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api-augment": "16.5.4", + "@polkadot/api-base": "16.5.4", + "@polkadot/api-derive": "16.5.4", + "@polkadot/keyring": "^14.0.1", + "@polkadot/rpc-augment": "16.5.4", + "@polkadot/rpc-core": "16.5.4", + "@polkadot/rpc-provider": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/types-augment": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/types-create": "16.5.4", + "@polkadot/types-known": "16.5.4", + "@polkadot/util": "^14.0.1", + "@polkadot/util-crypto": "^14.0.1", + "eventemitter3": "^5.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-augment": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/api-augment/-/api-augment-16.5.4.tgz", + "integrity": "sha512-9FTohz13ih458V2JBFjRACKHPqfM6j4bmmTbcSaE7hXcIOYzm4ABFo7xq5osLyvItganjsICErL2vRn2zULycw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api-base": "16.5.4", + "@polkadot/rpc-augment": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/types-augment": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-base": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/api-base/-/api-base-16.5.4.tgz", + "integrity": "sha512-V69v3ieg5+91yRUCG1vFRSLr7V7MvHPvo/QrzleIUu8tPXWldJ0kyXbWKHVNZEpVBA9LpjGvII+MHUW7EaKMNg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-core": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/util": "^14.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api-derive": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-16.5.4.tgz", + "integrity": "sha512-0JP2a6CaqTviacHsmnUKF4VLRsKdYOzQCqdL9JpwY/QBz/ZLqIKKPiSRg285EVLf8n/hWdTfxbWqQCsRa5NL+Q==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/api": "16.5.4", + "@polkadot/api-augment": "16.5.4", + "@polkadot/api-base": "16.5.4", + "@polkadot/rpc-core": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/util": "^14.0.1", + "@polkadot/util-crypto": "^14.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/api/node_modules/@polkadot/keyring": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-14.0.1.tgz", + "integrity": "sha512-kHydQPCeTvJrMC9VQO8LPhAhTUxzxfNF1HEknhZDBPPsxP/XpkYsEy/Ln1QzJmQqD5VsgwzLDE6cExbJ2CT9CA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1" + } + }, + "node_modules/@polkadot/keyring": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-13.5.9.tgz", + "integrity": "sha512-bMCpHDN7U8ytxawjBZ89/he5s3AmEZuOdkM/ABcorh/flXNPfyghjFK27Gy4OKoFxX52yJ2sTHR4NxM87GuFXQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "13.5.9", + "@polkadot/util-crypto": "13.5.9", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "13.5.9", + "@polkadot/util-crypto": "13.5.9" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/networks": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-13.5.9.tgz", + "integrity": "sha512-nmKUKJjiLgcih0MkdlJNMnhEYdwEml2rv/h59ll2+rAvpsVWMTLCb6Cq6q7UC44+8kiWK2UUJMkFU+3PFFxndA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "13.5.9", + "@substrate/ss58-registry": "^1.51.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/util": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-13.5.9.tgz", + "integrity": "sha512-pIK3XYXo7DKeFRkEBNYhf3GbCHg6dKQisSvdzZwuyzA6m7YxQq4DFw4IE464ve4Z7WsJFt3a6C9uII36hl9EWw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-bigint": "13.5.9", + "@polkadot/x-global": "13.5.9", + "@polkadot/x-textdecoder": "13.5.9", + "@polkadot/x-textencoder": "13.5.9", + "@types/bn.js": "^5.1.6", + "bn.js": "^5.2.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/util-crypto": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-13.5.9.tgz", + "integrity": "sha512-foUesMhxkTk8CZ0/XEcfvHk6I0O+aICqqVJllhOpyp/ZVnrTBKBf59T6RpsXx2pCtBlMsLRvg/6Mw7RND1HqDg==", + "license": "Apache-2.0", + "dependencies": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "13.5.9", + "@polkadot/util": "13.5.9", + "@polkadot/wasm-crypto": "^7.5.3", + "@polkadot/wasm-util": "^7.5.3", + "@polkadot/x-bigint": "13.5.9", + "@polkadot/x-randomvalues": "13.5.9", + "@scure/base": "^1.1.7", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "13.5.9" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/x-bigint": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-13.5.9.tgz", + "integrity": "sha512-JVW6vw3e8fkcRyN9eoc6JIl63MRxNQCP/tuLdHWZts1tcAYao0hpWUzteqJY93AgvmQ91KPsC1Kf3iuuZCi74g==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "13.5.9", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/x-global": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-13.5.9.tgz", + "integrity": "sha512-zSRWvELHd3Q+bFkkI1h2cWIqLo1ETm+MxkNXLec3lB56iyq/MjWBxfXnAFFYFayvlEVneo7CLHcp+YTFd9aVSA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/x-randomvalues": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-13.5.9.tgz", + "integrity": "sha512-Uuuz3oubf1JCCK97fsnVUnHvk4BGp/W91mQWJlgl5TIOUSSTIRr+lb5GurCfl4kgnQq53Zi5fJV+qR9YumbnZw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "13.5.9", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "13.5.9", + "@polkadot/wasm-util": "*" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/x-textdecoder": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-13.5.9.tgz", + "integrity": "sha512-W2HhVNUbC/tuFdzNMbnXAWsIHSg9SC9QWDNmFD3nXdSzlXNgL8NmuiwN2fkYvCQBtp/XSoy0gDLx0C+Fo19cfw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "13.5.9", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/keyring/node_modules/@polkadot/x-textencoder": { + "version": "13.5.9", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-13.5.9.tgz", + "integrity": "sha512-SG0MHnLUgn1ZxFdm0KzMdTHJ47SfqFhdIPMcGA0Mg/jt2rwrfrP3jtEIJMsHfQpHvfsNPfv55XOMmoPWuQnP/Q==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "13.5.9", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/networks": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/networks/-/networks-14.0.1.tgz", + "integrity": "sha512-wGlBtXDkusRAj4P7uxfPz80gLO1+j99MLBaQi3bEym2xrFrFhgIWVHOZlBit/1PfaBjhX2Z8XjRxaM2w1p7w2w==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "14.0.1", + "@substrate/ss58-registry": "^1.51.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-augment": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-augment/-/rpc-augment-16.5.4.tgz", + "integrity": "sha512-j9v3Ttqv/EYGezHtVksGJAFZhE/4F7LUWooOazh/53ATowMby3lZUdwInrK6bpYmG2whmYMw/Fo283fwDroBtQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-core": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-core": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-16.5.4.tgz", + "integrity": "sha512-92LOSTWujPjtmKOPvfCPs8rAaPFU+18wTtkIzwPwKxvxkN/SWsYSGIxmsoags9ramyHB6jp7Lr59TEuGMxIZzQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/rpc-augment": "16.5.4", + "@polkadot/rpc-provider": "16.5.4", + "@polkadot/types": "16.5.4", + "@polkadot/util": "^14.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/rpc-provider": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-16.5.4.tgz", + "integrity": "sha512-mNAIBRA3jMvpnHsuqAX4InHSIqBdgxFD6ayVUFFAzOX8Fh6Xpd4RdI1dqr6a1pCzjnPSby4nbg+VuadWwauVtg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/keyring": "^14.0.1", + "@polkadot/types": "16.5.4", + "@polkadot/types-support": "16.5.4", + "@polkadot/util": "^14.0.1", + "@polkadot/util-crypto": "^14.0.1", + "@polkadot/x-fetch": "^14.0.1", + "@polkadot/x-global": "^14.0.1", + "@polkadot/x-ws": "^14.0.1", + "eventemitter3": "^5.0.1", + "mock-socket": "^9.3.1", + "nock": "^13.5.5", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@substrate/connect": "0.8.11" + } + }, + "node_modules/@polkadot/rpc-provider/node_modules/@polkadot/keyring": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-14.0.1.tgz", + "integrity": "sha512-kHydQPCeTvJrMC9VQO8LPhAhTUxzxfNF1HEknhZDBPPsxP/XpkYsEy/Ln1QzJmQqD5VsgwzLDE6cExbJ2CT9CA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1" + } + }, + "node_modules/@polkadot/types": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-16.5.4.tgz", + "integrity": "sha512-8Oo1QWaL0DkIc/n2wKBIozPWug/0b2dPVhL+XrXHxJX7rIqS0x8sXDRbM9r166sI0nTqJiUho7pRIkt2PR/DMQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/keyring": "^14.0.1", + "@polkadot/types-augment": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/types-create": "16.5.4", + "@polkadot/util": "^14.0.1", + "@polkadot/util-crypto": "^14.0.1", + "rxjs": "^7.8.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-augment": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types-augment/-/types-augment-16.5.4.tgz", + "integrity": "sha512-AGjXR+Q9O9UtVkGw/HuOXlbRqVpvG6H8nr+taXP71wuC6RD9gznFBFBqoNkfWHD2w89esNVQLTvXHVxlLpTXqA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/types": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-codec": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types-codec/-/types-codec-16.5.4.tgz", + "integrity": "sha512-OQtT1pmJu2F3/+Vh1OiXifKoeRy+CU1+Lu7dgTcdO705dnxU4447Zup5JVCJDnxBmMITts/38vbFN2pD225AnA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "^14.0.1", + "@polkadot/x-bigint": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-create": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types-create/-/types-create-16.5.4.tgz", + "integrity": "sha512-URQnvr/sgvgIRSxIW3lmml6HMSTRRj2hTZIm6nhMTlYSVT4rLWx0ZbYUAjoPBbaJ+BmoqZ6Bbs+tA+5cQViv5Q==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/types-codec": "16.5.4", + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-known": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types-known/-/types-known-16.5.4.tgz", + "integrity": "sha512-Dd59y4e3AFCrH9xiqMU4xlG5+Zy0OTy7GQvqJVYXZFyAH+4HYDlxXjJGcSidGAmJcclSYfS3wyEkfw+j1EOVEw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/networks": "^14.0.1", + "@polkadot/types": "16.5.4", + "@polkadot/types-codec": "16.5.4", + "@polkadot/types-create": "16.5.4", + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types-support": { + "version": "16.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/types-support/-/types-support-16.5.4.tgz", + "integrity": "sha512-Ra6keCaO73ibxN6MzA56jFq9EReje7jjE4JQfzV5IpyDZdXcmPyJiEfa2Yps/YSP13Gc2e38t9FFyVau0V+SFQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "^14.0.1", + "tslib": "^2.8.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/types/node_modules/@polkadot/keyring": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-14.0.1.tgz", + "integrity": "sha512-kHydQPCeTvJrMC9VQO8LPhAhTUxzxfNF1HEknhZDBPPsxP/XpkYsEy/Ln1QzJmQqD5VsgwzLDE6cExbJ2CT9CA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/util-crypto": "14.0.1" + } + }, + "node_modules/@polkadot/util": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-14.0.1.tgz", + "integrity": "sha512-764HhxkPV3x5rM0/p6QdynC2dw26n+SaE+jisjx556ViCd4E28Ke4xSPef6C0Spy4aoXf2gt0PuLEcBvd6fVZg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-bigint": "14.0.1", + "@polkadot/x-global": "14.0.1", + "@polkadot/x-textdecoder": "14.0.1", + "@polkadot/x-textencoder": "14.0.1", + "@types/bn.js": "^5.1.6", + "bn.js": "^5.2.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/util-crypto": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-14.0.1.tgz", + "integrity": "sha512-Cu7AKUzBTsUkbOtyuNzXcTpDjR9QW0fVR56o3gBmzfUCmvO1vlsuGzmmPzqpHymQQ3rrfqV78CPs62EGhw0R+A==", + "license": "Apache-2.0", + "dependencies": { + "@noble/curves": "^1.3.0", + "@noble/hashes": "^1.3.3", + "@polkadot/networks": "14.0.1", + "@polkadot/util": "14.0.1", + "@polkadot/wasm-crypto": "^7.5.3", + "@polkadot/wasm-util": "^7.5.3", + "@polkadot/x-bigint": "14.0.1", + "@polkadot/x-randomvalues": "14.0.1", + "@scure/base": "^1.1.7", + "@scure/sr25519": "^0.2.0", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "14.0.1" + } + }, + "node_modules/@polkadot/wasm-bridge": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-bridge/-/wasm-bridge-7.5.4.tgz", + "integrity": "sha512-6xaJVvoZbnbgpQYXNw9OHVNWjXmtcoPcWh7hlwx3NpfiLkkjljj99YS+XGZQlq7ks2fVCg7FbfknkNb8PldDaA==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-util": "7.5.4", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-7.5.4.tgz", + "integrity": "sha512-1seyClxa7Jd7kQjfnCzTTTfYhTa/KUTDUaD3DMHBk5Q4ZUN1D1unJgX+v1aUeXSPxmzocdZETPJJRZjhVOqg9g==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-bridge": "7.5.4", + "@polkadot/wasm-crypto-asmjs": "7.5.4", + "@polkadot/wasm-crypto-init": "7.5.4", + "@polkadot/wasm-crypto-wasm": "7.5.4", + "@polkadot/wasm-util": "7.5.4", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-asmjs": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-asmjs/-/wasm-crypto-asmjs-7.5.4.tgz", + "integrity": "sha512-ZYwxQHAJ8pPt6kYk9XFmyuFuSS+yirJLonvP+DYbxOrARRUHfN4nzp4zcZNXUuaFhpbDobDSFn6gYzye6BUotA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-init": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-init/-/wasm-crypto-init-7.5.4.tgz", + "integrity": "sha512-U6s4Eo2rHs2n1iR01vTz/sOQ7eOnRPjaCsGWhPV+ZC/20hkVzwPAhiizu/IqMEol4tO2yiSheD4D6bn0KxUJhg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-bridge": "7.5.4", + "@polkadot/wasm-crypto-asmjs": "7.5.4", + "@polkadot/wasm-crypto-wasm": "7.5.4", + "@polkadot/wasm-util": "7.5.4", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*", + "@polkadot/x-randomvalues": "*" + } + }, + "node_modules/@polkadot/wasm-crypto-wasm": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto-wasm/-/wasm-crypto-wasm-7.5.4.tgz", + "integrity": "sha512-PsHgLsVTu43eprwSvUGnxybtOEuHPES6AbApcs7y5ZbM2PiDMzYbAjNul098xJK/CPtrxZ0ePDFnaQBmIJyTFw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/wasm-util": "7.5.4", + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/wasm-util": { + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-util/-/wasm-util-7.5.4.tgz", + "integrity": "sha512-hqPpfhCpRAqCIn/CYbBluhh0TXmwkJnDRjxrU9Bnqtw9nMNa97D8JuOjdd2pi0rxm+eeLQ/f1rQMp71RMM9t4w==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.7.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "*" + } + }, + "node_modules/@polkadot/x-bigint": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-bigint/-/x-bigint-14.0.1.tgz", + "integrity": "sha512-gfozjGnebr2rqURs31KtaWumbW4rRZpbiluhlmai6luCNrf5u8pB+oLA35kPEntrsLk9PnIG9OsC/n4hEtx4OQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-fetch": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-fetch/-/x-fetch-14.0.1.tgz", + "integrity": "sha512-yFsnO0xfkp3bIcvH70ZvmeUINYH1YnjOIS1B430f3w6axkqKhAOWCgzzKGMSRgn4dtm3YgwMBKPQ4nyfIsGOJQ==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "node-fetch": "^3.3.2", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-global": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-global/-/x-global-14.0.1.tgz", + "integrity": "sha512-aCI44DJU4fU0XXqrrSGIpi7JrZXK2kpe0jaQ2p6oDVXOOYEnZYXnMhTTmBE1lF/xtxzX50MnZrrU87jziU0qbA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-randomvalues": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-randomvalues/-/x-randomvalues-14.0.1.tgz", + "integrity": "sha512-/XkQcvshzJLHITuPrN3zmQKuFIPdKWoaiHhhVLD6rQWV60lTXA3ajw3ocju8ZN7xRxnweMS9Ce0kMPYa0NhRMg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "@polkadot/util": "14.0.1", + "@polkadot/wasm-util": "*" + } + }, + "node_modules/@polkadot/x-textdecoder": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textdecoder/-/x-textdecoder-14.0.1.tgz", + "integrity": "sha512-CcWiPCuPVJsNk4Vq43lgFHqLRBQHb4r9RD7ZIYgmwoebES8TNm4g2ew9ToCzakFKSpzKu6I07Ne9wv/dt5zLuw==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-textencoder": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-textencoder/-/x-textencoder-14.0.1.tgz", + "integrity": "sha512-VY51SpQmF1ccmAGLfxhYnAe95Spfz049WZ/+kK4NfsGF9WejxVdU53Im5C80l45r8qHuYQsCWU3+t0FNunh2Kg==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "tslib": "^2.8.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@polkadot/x-ws": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/@polkadot/x-ws/-/x-ws-14.0.1.tgz", + "integrity": "sha512-Q18hoSuOl7F4aENNGNt9XYxkrjwZlC6xye9OQrPDeHam1SrvflGv9mSZHyo+mwJs0z1PCz2STpPEN9PKfZvHng==", + "license": "Apache-2.0", + "dependencies": { + "@polkadot/x-global": "14.0.1", + "tslib": "^2.8.0", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@scure/base": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", + "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/sr25519": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/@scure/sr25519/-/sr25519-0.2.0.tgz", + "integrity": "sha512-uUuLP7Z126XdSizKtrCGqYyR3b3hYtJ6Fg/XFUXmc2//k2aXHDLqZwFeXxL97gg4XydPROPVnuaHGF2+xriSKg==", + "license": "MIT", + "dependencies": { + "@noble/curves": "~1.9.2", + "@noble/hashes": "~1.8.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@substrate/connect": { + "version": "0.8.11", + "resolved": "https://registry.npmjs.org/@substrate/connect/-/connect-0.8.11.tgz", + "integrity": "sha512-ofLs1PAO9AtDdPbdyTYj217Pe+lBfTLltdHDs3ds8no0BseoLeAGxpz1mHfi7zB4IxI3YyAiLjH6U8cw4pj4Nw==", + "deprecated": "versions below 1.x are no longer maintained", + "license": "GPL-3.0-only", + "optional": true, + "dependencies": { + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.5", + "@substrate/light-client-extension-helpers": "^1.0.0", + "smoldot": "2.0.26" + } + }, + "node_modules/@substrate/connect-extension-protocol": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/@substrate/connect-extension-protocol/-/connect-extension-protocol-2.2.2.tgz", + "integrity": "sha512-t66jwrXA0s5Goq82ZtjagLNd7DPGCNjHeehRlE/gcJmJ+G56C0W+2plqOMRicJ8XGR1/YFnUSEqUFiSNbjGrAA==", + "license": "GPL-3.0-only", + "optional": true + }, + "node_modules/@substrate/connect-known-chains": { + "version": "1.10.3", + "resolved": "https://registry.npmjs.org/@substrate/connect-known-chains/-/connect-known-chains-1.10.3.tgz", + "integrity": "sha512-OJEZO1Pagtb6bNE3wCikc2wrmvEU5x7GxFFLqqbz1AJYYxSlrPCGu4N2og5YTExo4IcloNMQYFRkBGue0BKZ4w==", + "license": "GPL-3.0-only", + "optional": true + }, + "node_modules/@substrate/light-client-extension-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@substrate/light-client-extension-helpers/-/light-client-extension-helpers-1.0.0.tgz", + "integrity": "sha512-TdKlni1mBBZptOaeVrKnusMg/UBpWUORNDv5fdCaJklP4RJiFOzBCrzC+CyVI5kQzsXBisZ+2pXm+rIjS38kHg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@polkadot-api/json-rpc-provider": "^0.0.1", + "@polkadot-api/json-rpc-provider-proxy": "^0.1.0", + "@polkadot-api/observable-client": "^0.3.0", + "@polkadot-api/substrate-client": "^0.1.2", + "@substrate/connect-extension-protocol": "^2.0.0", + "@substrate/connect-known-chains": "^1.1.5", + "rxjs": "^7.8.1" + }, + "peerDependencies": { + "smoldot": "2.x" + } + }, + "node_modules/@substrate/ss58-registry": { + "version": "1.51.0", + "resolved": "https://registry.npmjs.org/@substrate/ss58-registry/-/ss58-registry-1.51.0.tgz", + "integrity": "sha512-TWDurLiPxndFgKjVavCniytBIw+t4ViOi7TYp9h/D0NMmkEc9klFTo+827eyEJ0lELpqO207Ey7uGxUa+BS1jQ==", + "license": "Apache-2.0" + }, + "node_modules/@types/bn.js": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.2.0.tgz", + "integrity": "sha512-DLbJ1BPqxvQhIGbeu8VbUC1DiAiahHtAYvA0ZEAa4P31F7IaArc8z3C3BRQdWX4mtLQuABG4yzp76ZrS02Ui1Q==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "25.4.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.4.0.tgz", + "integrity": "sha512-9wLpoeWuBlcbBpOY3XmzSTG3oscB6xjBEEtn+pYXTfhyXhIxC5FsBer2KTopBlvKEiW9l13po9fq+SJY/5lkhw==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/bn.js": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.3.tgz", + "integrity": "sha512-EAcmnPkxpntVL+DS7bO1zhcZNvCkxqtkd0ZY53h06GNQ3DEkkGZ/gKgmDv6DdZQGj9BgfSPKtJJ7Dp1GPP8f7w==", + "license": "MIT" + }, + "node_modules/data-uri-to-buffer": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-4.0.1.tgz", + "integrity": "sha512-0R9ikRb668HB7QDxT1vkpuUBtqc53YyAwMwGeUFKRojY/NWKvdZ+9UYtRfGmhqNbRkTSVpMbmyhXipFFv2cb/A==", + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/eventemitter3": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.4.tgz", + "integrity": "sha512-mlsTRyGaPBjPedk6Bvw+aqbsXDtoAyAzm5MO7JgU+yVRyMQ5O8bD4Kcci7BS85f93veegeCPkL8R4GLClnjLFw==", + "license": "MIT" + }, + "node_modules/fetch-blob": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/fetch-blob/-/fetch-blob-3.2.0.tgz", + "integrity": "sha512-7yAQpD2UMJzLi1Dqv7qFYnPbaPx7ZfFK6PiIxQ4PfkGPyNyl2Ugx+a/umUonmKqjhM4DnfbMvdX6otXq83soQQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "paypal", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "dependencies": { + "node-domexception": "^1.0.0", + "web-streams-polyfill": "^3.0.3" + }, + "engines": { + "node": "^12.20 || >= 14.13" + } + }, + "node_modules/formdata-polyfill": { + "version": "4.0.10", + "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", + "integrity": "sha512-buewHzMvYL29jdeQTVILecSaZKnt/RJWjoZCF5OW60Z67/GmSLBkOFM7qh1PI3zFNtJbaZL5eQu1vLfazOwj4g==", + "license": "MIT", + "dependencies": { + "fetch-blob": "^3.1.2" + }, + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/mock-socket": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/mock-socket/-/mock-socket-9.3.1.tgz", + "integrity": "sha512-qxBgB7Qa2sEQgHFjj0dSigq7fX4k6Saisd5Nelwp2q8mlbAFh5dHV9JTTlF8viYJLSSWgMCZFUom8PJcMNBoJw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nock": { + "version": "13.5.6", + "resolved": "https://registry.npmjs.org/nock/-/nock-13.5.6.tgz", + "integrity": "sha512-o2zOYiCpzRqSzPj0Zt/dQ/DqZeYoaQ7TUonc/xUPjCGl9WeHpNbxgVvOquXYAaJzI0M9BXV3HTzG0p8IUAbBTQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.1.0", + "json-stringify-safe": "^5.0.1", + "propagate": "^2.0.0" + }, + "engines": { + "node": ">= 10.13" + } + }, + "node_modules/node-domexception": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", + "integrity": "sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==", + "deprecated": "Use your platform's native DOMException instead", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/jimmywarting" + }, + { + "type": "github", + "url": "https://paypal.me/jimmywarting" + } + ], + "license": "MIT", + "engines": { + "node": ">=10.5.0" + } + }, + "node_modules/node-fetch": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.3.2.tgz", + "integrity": "sha512-dRB78srN/l6gqWulah9SrxeYnxeddIG30+GOqK/9OlLVyLg3HPnr6SqOWTWOXKRwC2eGYCkZ59NNuSgvSrpgOA==", + "license": "MIT", + "dependencies": { + "data-uri-to-buffer": "^4.0.0", + "fetch-blob": "^3.1.4", + "formdata-polyfill": "^4.0.10" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/node-fetch" + } + }, + "node_modules/propagate": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/propagate/-/propagate-2.0.1.tgz", + "integrity": "sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/scale-ts": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/scale-ts/-/scale-ts-1.6.1.tgz", + "integrity": "sha512-PBMc2AWc6wSEqJYBDPcyCLUj9/tMKnLX70jLOSndMtcUoLQucP/DM0vnQo1wJAYjTrQiq8iG9rD0q6wFzgjH7g==", + "license": "MIT", + "optional": true + }, + "node_modules/smoldot": { + "version": "2.0.26", + "resolved": "https://registry.npmjs.org/smoldot/-/smoldot-2.0.26.tgz", + "integrity": "sha512-F+qYmH4z2s2FK+CxGj8moYcd1ekSIKH8ywkdqlOz88Dat35iB1DIYL11aILN46YSGMzQW/lbJNS307zBSDN5Ig==", + "license": "GPL-3.0-or-later WITH Classpath-exception-2.0", + "optional": true, + "dependencies": { + "ws": "^8.8.1" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/web-streams-polyfill": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.3.3.tgz", + "integrity": "sha512-d2JWLCivmZYTSIoge9MsgFCZrt571BikcWGYkjC1khllbTeDlGqZ2D8vD8E/lJa8WGWbb7Plm8/XJYV7IJHZZw==", + "license": "MIT", + "engines": { + "node": ">= 8" + } + }, + "node_modules/ws": { + "version": "8.19.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.19.0.tgz", + "integrity": "sha512-blAT2mjOEIi0ZzruJfIhb3nps74PRWTCz1IjglWEEpQl5XS/UNama6u2/rjFkDDouqr4L67ry+1aGIALViWjDg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + } + } +} diff --git a/scripts/dca-monitor/package.json b/scripts/dca-monitor/package.json new file mode 100644 index 000000000..161d97906 --- /dev/null +++ b/scripts/dca-monitor/package.json @@ -0,0 +1,17 @@ +{ + "name": "dca-monitor", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "type": "module", + "license": "ISC", + "description": "Monitor DCA pallet activity on a Chopsticks-based chain", + "dependencies": { + "@polkadot/api": "^16.4.5", + "@polkadot/keyring": "^13.5.5" + } +} diff --git a/scripts/mint-limit/createProposal.js b/scripts/mint-limit/createProposal.js index 195eb9f13..7302d6ebd 100644 --- a/scripts/mint-limit/createProposal.js +++ b/scripts/mint-limit/createProposal.js @@ -23,7 +23,7 @@ const sdk = await createSdkContext(api); // Time range (days) for Grafana query -const RANGE_DAYS = 90; +const RANGE_DAYS = 365; // Technical Committee threshold (how many approvals needed to start motion) const TC_THRESHOLD = 4; @@ -51,6 +51,7 @@ const MINT_LIMIT_OVERWRITES = { 15: BigInt("9000000000000000"), //VDOT 10: BigInt("5000000000000"), //USDT 22: BigInt("5000000000000"), //UDSC + 690: BigInt("506727271452772187242496"), // 2-Pool-GDOT ~$800k cap }; /* ========= HELPERS ========= */ @@ -99,9 +100,9 @@ function buildTwoXMaxQuery(currencyId, fromIso, toIso) { ), percentiles AS ( SELECT - PERCENTILE_CONT(0.01) WITHIN + PERCENTILE_CONT(0.05) WITHIN GROUP (ORDER BY net_deposits) AS p5, - PERCENTILE_CONT(0.99) WITHIN + PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY net_deposits) AS p95 FROM daily_data ), wins AS ( @@ -193,6 +194,7 @@ async function buildBatchCall({rpc, assetIds, rangeDays}) { const toIso = now.toISOString(); const calls = []; + const results = []; for (const assetId of assetIds) { let finalLimit; let isOverwrite = false; @@ -252,11 +254,20 @@ async function buildBatchCall({rpc, assetIds, rangeDays}) { ].filter(Boolean).join(', '); console.log(`${assetId} (${assetName}) -> mint limit = $${finalUsdAmount.toLocaleString()} | amount = ${adjustedLimit} ${statusFlags ? ` (${statusFlags})` : ''}`); + + results.push({ + 'Asset ID': assetId, + 'Name': assetName, + 'Mint Limit ($)': `$${finalUsdAmount.toLocaleString()}`, + 'Mint Limit (units)': adjustedLimit.toString(), + 'Notes': statusFlags || '-', + }); + calls.push(buildUpdateCall(api, assetId, adjustedLimit)); } const batch = api.tx.utility.batchAll(calls); - return {api, batch}; + return {api, batch, results}; } function buildTechnicalCommitteePropose(api, call, threshold) { @@ -270,7 +281,7 @@ function buildTechnicalCommitteePropose(api, call, threshold) { try { if (!ASSETS.length) throw new Error('ASSETS is empty.'); - const {api, batch} = await buildBatchCall({ + const {api, batch, results} = await buildBatchCall({ rpc: RPC, assetIds: ASSETS, rangeDays: RANGE_DAYS @@ -279,6 +290,9 @@ function buildTechnicalCommitteePropose(api, call, threshold) { // Wrap in technicalCommittee.propose const tcProposal = buildTechnicalCommitteePropose(api, batch, TC_THRESHOLD); + console.log('\n--- Mint Limit Summary ---'); + console.table(results); + console.log('\n--- utility.batchAll (human) ---\n', batch.method.toHuman()); console.log('\n--- TC propose (human) ---\n', tcProposal.method.toHuman()); console.log('\n--- TC propose HEX (submit as call/preimage) ---\n', tcProposal.method.toHex());