diff --git a/examples/package.json b/examples/package.json index 57c5a98..4e923d7 100644 --- a/examples/package.json +++ b/examples/package.json @@ -23,16 +23,16 @@ "watch-transfer-events": "./dist/watch-transfer-events/main.cjs" }, "dependencies": { - "@polkadot/rpc-provider": "^12.2.1", + "@polkadot/rpc-provider": "^12.2.2", "@sodazone/ocelloids-sdk": "1.2.12-dev.0", - "@substrate/connect": "^1.0.7", + "@substrate/connect": "^1.1.0", "graph-data-structure": "^3.5.0", "hjson": "^3.2.2", "rxjs": "^7.8.1", "yargs": "^17.7.2" }, "devDependencies": { - "tsup": "^8.1.0", + "tsup": "^8.2.3", "tsx": "^4.16.2" }, "tsup": { diff --git a/package.json b/package.json index b66bb6c..2f27b60 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "Xueying Wang " ], "bugs": "https://github.com/sodazone/ocelloids-sdk/issues", - "description": "Software development kit for building monitoring applications for Substrate networks.", + "description": "Software development kit for Polkadot and Substrate based networks.", "engines": { "node": ">=18.14" }, @@ -54,15 +54,15 @@ "@babel/preset-env": "^7.24.8", "@babel/preset-typescript": "^7.24.7", "@biomejs/biome": "1.8.3", - "@swc/core": "^1.6.13", + "@swc/core": "^1.7.2", "@swc/jest": "^0.2.36", "@types/jest": "^29.5.12", - "@types/node": "^20.14.10", + "@types/node": "^20.14.12", "esbuild": "^0.23.0", "jest": "^29.7.0", - "tsup": "^8.1.0", - "typedoc": "^0.26.4", - "typescript": "^5.5.3" + "tsup": "^8.2.3", + "typedoc": "^0.26.5", + "typescript": "^5.5.4" }, "overrides": { "word-wrap": "1.2.4" diff --git a/packages/core/README.md b/packages/core/README.md index 18bf279..b470726 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -100,9 +100,11 @@ You can also explore a practical example of how custom methods and types are reg ## Nested Calls Flattener -The Flattener, a specialized helper class, recursively extracts all nested calls from a given extrinsic. It assigns the subset of events in that extrinsic corresponding to each call and maps any execution errors to the extracted calls. This is particularly useful when dealing with extrinsics containing nested batch, multisig, or proxy calls. +The `CorrelatedFlattener`, a specialized helper class, recursively extracts all nested calls from a given extrinsic. It assigns the subset of events within that extrinsic to each call and maps any execution errors to the extracted calls. This is particularly useful when dealing with extrinsics that contain nested batch, multisig, or proxy calls. -The Flattener is utilized within the `flattenCalls` operator and is also exported for external use, such as in an observer handler: +A `BasicFlattener` is also provided to skip event correlation while still extracting nested calls. + +The flatteners are used within the `flattenCalls` operator and are also exported for external use, such as in an observer handler: ```javascript // Flatten and log extrinsic 8695536-2 on Rococo ([Subscan link](https://rococo.subscan.io/extrinsic/8695536-2)) @@ -112,7 +114,7 @@ apis.rx.polkadot.pipe( filter(tx => tx.extrinsic.extrinsicId === '8695536-2') // Filter for only the `forceBatch` extrinsic ).subscribe(tx => { // Initialise flattener and flatten nested calls - const flattener = new Flattener(tx); + const flattener = new CorrelatedFlattener(tx); flattener.flatten(); const calls = flattener.flattenedCalls; calls.forEach(c => { diff --git a/packages/core/package.json b/packages/core/package.json index bf8a6f2..937ecdf 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -27,8 +27,8 @@ "url": "https://github.com/sodazone/ocelloids-sdk.git" }, "dependencies": { - "@polkadot/api": "^12.2.1", - "@substrate/connect-known-chains": "^1.1.9", + "@polkadot/api": "^12.2.2", + "@substrate/connect-known-chains": "^1.2.0", "mingo": "^6.4.15", "rxjs": "^7.8.1", "web-worker": "1.3.0" diff --git a/packages/core/src/client/known-chains.ts b/packages/core/src/client/known-chains.ts index bd8be46..cafb9cf 100644 --- a/packages/core/src/client/known-chains.ts +++ b/packages/core/src/client/known-chains.ts @@ -1,3 +1,5 @@ +/* istanbul ignore file */ + import { WellKnownChain } from '@substrate/connect' async function chainSpecOf(conf: Promise<{ chainSpec: string }>) { diff --git a/packages/core/src/operators/flatten.spec.ts b/packages/core/src/operators/flatten.spec.ts index 8fe1a71..ff5f5d9 100644 --- a/packages/core/src/operators/flatten.spec.ts +++ b/packages/core/src/operators/flatten.spec.ts @@ -3,18 +3,18 @@ import { of } from 'rxjs' -import { nestedItems, testBlocks } from '@sodazone/ocelloids-sdk-test' +import { cloneExtrinsic, nestedItems, testBlocks } from '@sodazone/ocelloids-sdk-test' import type { DataToMatch } from '@sodazone/ocelloids-sdk-test' import { types } from '../index.js' import { TxWithIdAndEvent } from '../types/interfaces.js' -import { flattenCalls } from './flatten.js' +import { FlattenerMode, flattenCalls } from './flatten.js' const { number, hash } = testBlocks[0].block.header describe('flatten call operator', () => { describe('flattenCall', () => { - const assertResults = (result: TxWithIdAndEvent, nestedCalls: DataToMatch[]) => { + const assertResults = (result: TxWithIdAndEvent, nestedCalls: DataToMatch[], mode = FlattenerMode.CORRELATED) => { expect(result).toBeDefined() const { @@ -32,219 +32,269 @@ describe('flatten call operator', () => { const name = `${method.section}.${method.method}` expect(name).toEqual(call.name) - // Assert that nested call dispatch errors are correlated correctly - expect(dispatchError?.toHuman()).toEqual(call.dispatchError) - // Assert that nested call origins are extracted correctly extraSigners.forEach((o, i) => { expect(o.type).toEqual(call.extraSigners[i].type) expect(o.address.toString()).toEqual(call.extraSigners[i].address) }) - // Assert that nested call events are correlated correctly - events.forEach((e, i) => { - expect(e.section).toEqual(call.events[i].section) - expect(e.method).toEqual(call.events[i].method) - }) + if (mode === FlattenerMode.CORRELATED) { + // Assert that nested call dispatch errors are correlated correctly + expect(dispatchError?.toHuman()).toEqual(call.dispatchError) + + // Assert that nested call events are correlated correctly + events.forEach((e, i) => { + expect(e.section).toEqual(call.events[i].section) + expect(e.method).toEqual(call.events[i].method) + }) + } } - it('should flatten nested multisig + proxy extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testMultisigProxy - const testNestedTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testPipe = flattenCalls()(of(testNestedTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - assertResults(result, data) - c++ - }, - complete: () => { - expect(c).toBe(data.length) - done() - }, - }) - }) - - it('should flatten nested batch extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testBatch - const testNestedBatchTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testPipe = flattenCalls()(of(testNestedBatchTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - assertResults(result, data) - c++ - }, - complete: () => { - expect(c).toBe(data.length) - done() - }, - }) - }) - - it('should flatten force batch extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testForceBatch - const testForceBatchTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testPipe = flattenCalls()(of(testForceBatchTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - assertResults(result, data) - c++ - }, - complete: () => { - expect(c).toBe(data.length) - done() - }, - }) - }) - - it('should flatten deep nested batch + batchAll extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testDeepNested - const testDeepNestedTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testPipe = flattenCalls()(of(testDeepNestedTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - assertResults(result, data) - c++ - }, - complete: () => { - expect(c).toBe(data.length) - done() - }, - }) - }) - - it('should flatten multisig threshold 1 extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testMultisigThreshold1 - const testMultisigThreshold1TxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testPipe = flattenCalls()(of(testMultisigThreshold1TxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - assertResults(result, data) - c++ - }, - complete: () => { - expect(c).toBe(data.length) - done() - }, - }) - }) - - it('should work with batched and non-batched extrinsics', (done) => { - const { extrinsic, events, data } = nestedItems.testDeepNested - const testDeepNestedTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - extrinsic, - events - ) - const testNonBatchTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - testBlocks[0].extrinsics[2], - testBlocks[0].events - ) - const testPipe = flattenCalls()(of(testNonBatchTxWithId, testDeepNestedTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - c++ - expect(result).toBeDefined() - }, - complete: () => { - expect(c).toBe(data.length + 1) - done() - }, - }) - }) - - it('should work with non-batched extrinsics', (done) => { - const testNonBatchTxWithId = types.enhanceTxWithIdAndEvents( - { - blockNumber: number, - blockPosition: 2, - blockHash: hash, - }, - testBlocks[0].extrinsics[2], - testBlocks[0].events - ) - const testPipe = flattenCalls()(of(testNonBatchTxWithId)) - - let c = 0 - testPipe.subscribe({ - next: (result: TxWithIdAndEvent) => { - c++ - expect(result).toBeDefined() - expect(result.extrinsic.signer.toHuman()).toEqual({ Id: '1sa85enM8EQ56Tzfyg97kvQf1CYfPoTczin4ASYTwUdH9iK' }) - expect(result.extrinsic.method.toHuman()).toEqual({ - args: { - dest: { Id: '16hp43x8DUZtU8L3cJy9Z8JMwTzuu8ZZRWqDZnpMhp464oEd' }, - value: '733,682,465,000', - }, - method: 'transferKeepAlive', - section: 'balances', - }) - }, - complete: () => { - expect(c).toBe(1) - done() - }, - }) - }) + function testDeepNested(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testDeepNested + const testDeepNestedTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + extrinsic, + events + ) + const testPipe = flattenCalls(mode)(of(testDeepNestedTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + assertResults(result, data, mode) + c++ + }, + complete: () => { + expect(c).toBe(data.length) + done() + }, + }) + } + } + + function testForceBatch(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testForceBatch + const testForceBatchTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + extrinsic, + events + ) + const testPipe = flattenCalls(mode)(of(testForceBatchTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + assertResults(result, data, mode) + c++ + }, + complete: () => { + expect(c).toBe(data.length) + done() + }, + }) + } + } + + function testNestedMultisigAndProxy(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testMultisigProxy + const testNestedTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + { ...extrinsic, extrinsic: cloneExtrinsic(extrinsic.extrinsic) }, + events + ) + const testPipe = flattenCalls(mode)(of(testNestedTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + assertResults(result, data, mode) + c++ + }, + complete: () => { + expect(c).toBe(data.length) + done() + }, + }) + } + } + + function testNestedBatch(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testBatch + const testNestedBatchTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + extrinsic, + events + ) + const testPipe = flattenCalls(mode)(of(testNestedBatchTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + assertResults(result, data, mode) + c++ + }, + complete: () => { + expect(c).toBe(data.length) + done() + }, + }) + } + } + + function testMixedBatched(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testDeepNested + const testDeepNestedTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + extrinsic, + events + ) + const testNonBatchTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + testBlocks[0].extrinsics[2], + testBlocks[0].events + ) + const testPipe = flattenCalls(mode)(of(testNonBatchTxWithId, testDeepNestedTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + c++ + expect(result).toBeDefined() + }, + complete: () => { + expect(c).toBe(data.length + 1) + done() + }, + }) + } + } + + function testNonBatched(mode = FlattenerMode.CORRELATED) { + return (done) => { + const testNonBatchTxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + testBlocks[0].extrinsics[2], + testBlocks[0].events + ) + const testPipe = flattenCalls(mode)(of(testNonBatchTxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + c++ + expect(result).toBeDefined() + expect(result.extrinsic.signer.toHuman()).toEqual({ Id: '1sa85enM8EQ56Tzfyg97kvQf1CYfPoTczin4ASYTwUdH9iK' }) + expect(result.extrinsic.method.toHuman()).toEqual({ + args: { + dest: { Id: '16hp43x8DUZtU8L3cJy9Z8JMwTzuu8ZZRWqDZnpMhp464oEd' }, + value: '733,682,465,000', + }, + method: 'transferKeepAlive', + section: 'balances', + }) + }, + complete: () => { + expect(c).toBe(1) + done() + }, + }) + } + } + + function testThreshold1(mode = FlattenerMode.CORRELATED) { + return (done) => { + const { extrinsic, events, data } = nestedItems.testMultisigThreshold1 + const testMultisigThreshold1TxWithId = types.enhanceTxWithIdAndEvents( + { + blockNumber: number, + blockPosition: 2, + blockHash: hash, + }, + { ...extrinsic, extrinsic: cloneExtrinsic(extrinsic.extrinsic) }, + events + ) + const testPipe = flattenCalls(mode)(of(testMultisigThreshold1TxWithId)) + + let c = 0 + testPipe.subscribe({ + next: (result: TxWithIdAndEvent) => { + assertResults(result, data, mode) + c++ + }, + complete: () => { + expect(c).toBe(data.length) + done() + }, + }) + } + } + + it('should flatten nested multisig + proxy extrinsics', testNestedMultisigAndProxy()) + + it( + 'should flatten nested multisig + proxy extrinsics without correlation', + testNestedMultisigAndProxy(FlattenerMode.BASIC) + ) + + it('should flatten nested batch extrinsics', testNestedBatch()) + + it('should flatten nested batch extrinsics without correlation', testNestedBatch(FlattenerMode.BASIC)) + + it('should flatten force batch extrinsics', testForceBatch()) + + it('should flatten force batch extrinsics without correlation', testForceBatch(FlattenerMode.BASIC)) + + it('should flatten deep nested batch + batchAll extrinsics', testDeepNested()) + + it( + 'should flatten deep nested batch + batchAll extrinsics without correlation', + testDeepNested(FlattenerMode.BASIC) + ) + + it('should flatten multisig threshold 1 extrinsics', testThreshold1()) + + it('should flatten multisig threshold 1 extrinsics without correlation', testThreshold1(FlattenerMode.BASIC)) + + it('should work with batched and non-batched extrinsics', testMixedBatched()) + + it('should work with batched and non-batched extrinsics without correlation', testMixedBatched(FlattenerMode.BASIC)) + + it('should work with non-batched extrinsics', testNonBatched()) + + it('should work with non-batched extrinsics without correlation', testNonBatched(FlattenerMode.BASIC)) }) }) diff --git a/packages/core/src/operators/flatten.ts b/packages/core/src/operators/flatten.ts index 229972f..031324d 100644 --- a/packages/core/src/operators/flatten.ts +++ b/packages/core/src/operators/flatten.ts @@ -4,13 +4,21 @@ import { Observable, concatMap } from 'rxjs' import { TxWithIdAndEvent } from '../types/interfaces.js' -import { Flattener } from './flatten/flattener.js' -import { hasParser } from './flatten/index.js' +import { createFlattener, isNested } from './flatten/index.js' -function withFlattener(tx: TxWithIdAndEvent, sorted: boolean) { +export enum FlattenerMode { + BASIC, + CORRELATED, +} + +export { Flattener, createFlattener } from './flatten/index.js' + +function withFlattener(tx: TxWithIdAndEvent, mode: FlattenerMode, sorted: boolean) { try { - const flattener = new Flattener(tx) + const flattener = createFlattener(tx, mode) + flattener.flatten() + return sorted ? flattener.flattenedCalls.sort((a: TxWithIdAndEvent, b: TxWithIdAndEvent) => { return (a.levelId ?? '0').localeCompare(b.levelId ?? '0') @@ -34,8 +42,8 @@ function withFlattener(tx: TxWithIdAndEvent, sorted: boolean) { * * @param sorted - (Optional) preserve the order of nested calls. Defaults to true. */ -export function flattenCalls(sorted = true) { +export function flattenCalls(mode = FlattenerMode.CORRELATED, sorted = true) { return (source: Observable): Observable => { - return source.pipe(concatMap((tx) => (hasParser(tx) ? withFlattener(tx, sorted) : [tx]))) + return source.pipe(concatMap((tx) => (isNested(tx) ? withFlattener(tx, mode, sorted) : [tx]))) } } diff --git a/packages/core/src/operators/flatten/basic/flattener.ts b/packages/core/src/operators/flatten/basic/flattener.ts new file mode 100644 index 0000000..14099b9 --- /dev/null +++ b/packages/core/src/operators/flatten/basic/flattener.ts @@ -0,0 +1,36 @@ +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { Flattener } from '../interfaces.js' +import { findParser } from './index.js' + +/** + * Flattens nested calls in the extrinsic without event correlation. + * Supports all the extractors registered in the {@link parsers} map. + */ +export class BasicFlattener implements Flattener { + private calls: TxWithIdAndEvent[] + private tx: TxWithIdAndEvent + + constructor(tx: TxWithIdAndEvent) { + this.tx = tx + this.calls = [] + } + + flatten(id = '0') { + this.tx.levelId = id + this.calls.push(this.tx) + + const parser = findParser(this.tx) + + if (parser) { + const nestedCalls = parser(this.tx) + for (let i = nestedCalls.length - 1; i >= 0; i--) { + this.tx = nestedCalls[i] + this.flatten(`${id}.${i}`) + } + } + } + + get flattenedCalls(): TxWithIdAndEvent[] { + return this.calls + } +} diff --git a/packages/core/src/operators/flatten/basic/index.ts b/packages/core/src/operators/flatten/basic/index.ts new file mode 100644 index 0000000..d477f3a --- /dev/null +++ b/packages/core/src/operators/flatten/basic/index.ts @@ -0,0 +1,22 @@ +import { TxWithIdAndEvent } from '../../../types/interfaces.js' + +import { extractAsMultiCall, extractAsMutiThreshold1Call } from './multisig.js' +import { extractProxyCalls } from './proxy.js' +import { extractAnyBatchCalls, extractAsDerivativeCall } from './utility.js' + +type CallParser = (tx: TxWithIdAndEvent) => TxWithIdAndEvent[] + +const parsers: Record = { + 'proxy.proxy': extractProxyCalls, + 'proxy.proxyAnnounced': extractProxyCalls, + 'multisig.asMulti': extractAsMultiCall, + 'multisig.asMultiThreshold1': extractAsMutiThreshold1Call, + 'utility.batch': extractAnyBatchCalls, + 'utility.batchAll': extractAnyBatchCalls, + 'utility.forceBatch': extractAnyBatchCalls, + 'utility.asDerivative': extractAsDerivativeCall, +} + +export function findParser({ extrinsic: { method } }: TxWithIdAndEvent): CallParser | undefined { + return parsers[`${method.section}.${method.method}`] +} diff --git a/packages/core/src/operators/flatten/basic/multisig.ts b/packages/core/src/operators/flatten/basic/multisig.ts new file mode 100644 index 0000000..7d7b7e6 --- /dev/null +++ b/packages/core/src/operators/flatten/basic/multisig.ts @@ -0,0 +1,33 @@ +import type { Call } from '@polkadot/types/interfaces/runtime' + +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTx, getArgValueFromTx, getMultisigAddress } from '../util.js' + +export function extractAsMutiThreshold1Call(tx: TxWithIdAndEvent) { + return extractMultisig(tx, 1) +} + +export function extractAsMultiCall(tx: TxWithIdAndEvent) { + return extractMultisig(tx) +} + +function extractMultisig(tx: TxWithIdAndEvent, threshold?: number) { + let extraSigner + try { + const multisigAddress = getMultisigAddress(tx.extrinsic, threshold) + extraSigner = { + type: 'multisig', + address: multisigAddress, + } + } catch { + // + } + const call = getArgValueFromTx(tx.extrinsic, 'call') as Call + return [ + callAsTx({ + call, + tx, + extraSigner, + }), + ] +} diff --git a/packages/core/src/operators/flatten/basic/proxy.ts b/packages/core/src/operators/flatten/basic/proxy.ts new file mode 100644 index 0000000..696ad9c --- /dev/null +++ b/packages/core/src/operators/flatten/basic/proxy.ts @@ -0,0 +1,19 @@ +import { MultiAddress } from '@polkadot/types/interfaces' +import type { Call } from '@polkadot/types/interfaces/runtime' + +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTx, getArgValueFromTx } from '../util.js' + +export function extractProxyCalls(tx: TxWithIdAndEvent) { + const { extrinsic } = tx + const real = getArgValueFromTx(extrinsic, 'real') as MultiAddress + const call = getArgValueFromTx(extrinsic, 'call') as Call + + return [ + callAsTx({ + call, + tx, + extraSigner: { type: 'proxied', address: real }, + }), + ] +} diff --git a/packages/core/src/operators/flatten/basic/utility.ts b/packages/core/src/operators/flatten/basic/utility.ts new file mode 100644 index 0000000..642f3c7 --- /dev/null +++ b/packages/core/src/operators/flatten/basic/utility.ts @@ -0,0 +1,29 @@ +import type { u16 } from '@polkadot/types-codec' + +import type { AnyTuple, CallBase } from '@polkadot/types-codec/types' +import type { FunctionMetadataLatest } from '@polkadot/types/interfaces' + +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTx } from '../util.js' + +export function extractAnyBatchCalls(tx: TxWithIdAndEvent) { + const { extrinsic } = tx + const calls = extrinsic.args[0] as unknown as CallBase[] + return calls.map((call) => + callAsTx({ + call, + tx, + }) + ) +} + +export function extractAsDerivativeCall(tx: TxWithIdAndEvent) { + const [_, call] = tx.extrinsic.args as unknown as [u16, CallBase] + + return [ + callAsTx({ + call, + tx, + }), + ] +} diff --git a/packages/core/src/operators/flatten/flattener.ts b/packages/core/src/operators/flatten/correlated/flattener.ts similarity index 91% rename from packages/core/src/operators/flatten/flattener.ts rename to packages/core/src/operators/flatten/correlated/flattener.ts index 8f95f2f..a080097 100644 --- a/packages/core/src/operators/flatten/flattener.ts +++ b/packages/core/src/operators/flatten/correlated/flattener.ts @@ -5,14 +5,13 @@ import { logger } from '@polkadot/util' import type { DispatchError, DispatchInfo } from '@polkadot/types/interfaces' -import { GenericExtrinsicWithId } from '../../types/index.js' -import { EventWithId, TxWithIdAndEvent } from '../../types/interfaces.js' +import { GenericExtrinsicWithId } from '../../../types/index.js' +import { EventWithId, TxWithIdAndEvent } from '../../../types/interfaces.js' +import { Flattener } from '../interfaces.js' +import { isEventType } from '../util.js' import { findParser } from './index.js' -import { isEventType } from './util.js' -const l = logger('oc-ops-flatten') - -const MAX_EVENTS = 200 +const l = logger('oc-ops-flattener') /** * Enum representing static, well-known boundaries. @@ -49,7 +48,7 @@ const isAllBoundary = (boundary: Boundary): boundary is Boundaries => { * Flattens nested calls in the extrinsic and correlates the events belonging to each call. * Supports all the extractors registered in the {@link parsers} map. */ -export class Flattener { +export class CorrelatedFlattener implements Flattener { private events: { event: EventWithId callId: number @@ -62,11 +61,6 @@ export class Flattener { const { extrinsic } = tx const { registry } = extrinsic - if (tx.events.length > MAX_EVENTS) { - l.warn(`Number of events (${tx.events.length}) in tx exceeds max limit of ${MAX_EVENTS}. Skipping flatten...`) - throw new Error(`Number of events (${tx.events.length}) in tx exceeds max limit of ${MAX_EVENTS}`) - } - // work on a copy of the events and extrinsics this.events = tx.events .slice() diff --git a/packages/core/src/operators/flatten/correlated/index.ts b/packages/core/src/operators/flatten/correlated/index.ts new file mode 100644 index 0000000..bd4f1f5 --- /dev/null +++ b/packages/core/src/operators/flatten/correlated/index.ts @@ -0,0 +1,49 @@ +// Copyright 2023-2024 SO/DA zone +// SPDX-License-Identifier: Apache-2.0 + +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { Boundary, CorrelatedFlattener } from './flattener.js' +import { extractAsMultiCall, extractAsMutiThreshold1Call } from './multisig.js' +import { extractProxyCalls } from './proxy.js' +import { extractAsDerivativeCall, extractBatchAllCalls, extractBatchCalls, extractForceBatchCalls } from './utility.js' + +/** + * Type that represents an extractor function. + */ +type CallParser = ( + tx: TxWithIdAndEvent, + flattener: CorrelatedFlattener +) => { + call: TxWithIdAndEvent + boundary?: Boundary +}[] + +/** + * Parsers object which maps method signatures to their corresponding extractor functions. + * Extractor functions take a transaction as input and return the nested call(s) + * as an array of transactions, a single transaction, or undefined based on the extraction logic. + */ +export const parsers: Record = { + 'proxy.proxy': extractProxyCalls, + 'proxy.proxyAnnounced': extractProxyCalls, + 'multisig.asMulti': extractAsMultiCall, + 'multisig.asMultiThreshold1': extractAsMutiThreshold1Call, + 'utility.batch': extractBatchCalls, + 'utility.batchAll': extractBatchAllCalls, + 'utility.forceBatch': extractForceBatchCalls, + 'utility.asDerivative': extractAsDerivativeCall, +} + +/** + * Returns a call parser matching the extrinsic call name or undefined. + */ +export function findParser({ extrinsic: { method } }: TxWithIdAndEvent): CallParser | undefined { + return parsers[`${method.section}.${method.method}`] +} + +/** + * Returns true if a parser exists for the given extrinsic call name. + */ +export function hasParser(tx: TxWithIdAndEvent): boolean { + return findParser(tx) !== undefined +} diff --git a/packages/core/src/operators/flatten/multisig.ts b/packages/core/src/operators/flatten/correlated/multisig.ts similarity index 77% rename from packages/core/src/operators/flatten/multisig.ts rename to packages/core/src/operators/flatten/correlated/multisig.ts index faff618..33daa59 100644 --- a/packages/core/src/operators/flatten/multisig.ts +++ b/packages/core/src/operators/flatten/correlated/multisig.ts @@ -2,15 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { Null, Result } from '@polkadot/types-codec' -import type { Vec } from '@polkadot/types-codec' import { AccountId32, DispatchError } from '@polkadot/types/interfaces' import type { Address, Call } from '@polkadot/types/interfaces/runtime' -import { isU8a, u8aToHex } from '@polkadot/util' -import { createKeyMulti } from '@polkadot/util-crypto' -import { TxWithIdAndEvent } from '../../types/interfaces.js' -import { Boundaries, Flattener } from './flattener.js' -import { callAsTxWithBoundary, getArgValueFromEvent, getArgValueFromTx } from './util.js' +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTxWithBoundary, getArgValueFromEvent, getArgValueFromTx, getMultisigAddress } from '../util.js' +import { Boundaries, CorrelatedFlattener } from './flattener.js' const MultisigExecuted = 'multisig.MultisigExecuted' const MultisigExecutedBoundary = { @@ -32,7 +29,7 @@ const MultisigExecutedBoundary = { * @returns The extracted multisig call as TxWithIdAndEvent. * Returns undefined if the 'MultisigExecuted' event is not found in the transaction events. */ -export function extractAsMultiCall(tx: TxWithIdAndEvent, flattener: Flattener) { +export function extractAsMultiCall(tx: TxWithIdAndEvent, flattener: CorrelatedFlattener) { const { extrinsic } = tx const multisigExecutedIndex = flattener.findEventIndex(MultisigExecuted) @@ -74,16 +71,7 @@ export function extractAsMultiCall(tx: TxWithIdAndEvent, flattener: Flattener) { * @returns The extracted multisig call as TxWithIdAndEvent. */ export function extractAsMutiThreshold1Call(tx: TxWithIdAndEvent) { - const { extrinsic } = tx - const otherSignatories = getArgValueFromTx(tx.extrinsic, 'other_signatories') as Vec - // Signer must be added to the signatories to obtain the multisig address - const signatories = otherSignatories.map((s) => s.toString()) - signatories.push(extrinsic.signer.toString()) - const multisig = createKeyMulti(signatories, 1) - const multisigAddress = extrinsic.registry.createTypeUnsafe('Address', [ - isU8a(multisig) ? u8aToHex(multisig) : multisig, - ]) as Address - + const multisigAddress = getMultisigAddress(tx.extrinsic, 1) const call = getArgValueFromTx(tx.extrinsic, 'call') as Call return [ diff --git a/packages/core/src/operators/flatten/proxy.ts b/packages/core/src/operators/flatten/correlated/proxy.ts similarity index 87% rename from packages/core/src/operators/flatten/proxy.ts rename to packages/core/src/operators/flatten/correlated/proxy.ts index b5a8c0d..17d2464 100644 --- a/packages/core/src/operators/flatten/proxy.ts +++ b/packages/core/src/operators/flatten/correlated/proxy.ts @@ -5,9 +5,9 @@ import type { Null, Result } from '@polkadot/types-codec' import { DispatchError, MultiAddress } from '@polkadot/types/interfaces' import type { Call } from '@polkadot/types/interfaces/runtime' -import { TxWithIdAndEvent } from '../../types/interfaces.js' -import { Flattener } from './flattener.js' -import { callAsTxWithBoundary, getArgValueFromTx } from './util.js' +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTxWithBoundary, getArgValueFromTx } from '../util.js' +import { CorrelatedFlattener } from './flattener.js' const ProxyExecuted = 'proxy.ProxyExecuted' const ProxyExecutedBoundary = { @@ -22,7 +22,7 @@ const ProxyExecutedBoundary = { * @param tx - The input transaction to extract proxy calls from . * @returns The extracted proxy call as TxWithIdAndEvent. */ -export function extractProxyCalls(tx: TxWithIdAndEvent, flattener: Flattener) { +export function extractProxyCalls(tx: TxWithIdAndEvent, flattener: CorrelatedFlattener) { const { extrinsic } = tx const real = getArgValueFromTx(extrinsic, 'real') as MultiAddress const call = getArgValueFromTx(extrinsic, 'call') as Call diff --git a/packages/core/src/operators/flatten/utility.ts b/packages/core/src/operators/flatten/correlated/utility.ts similarity index 90% rename from packages/core/src/operators/flatten/utility.ts rename to packages/core/src/operators/flatten/correlated/utility.ts index a8c16cf..8f2d757 100644 --- a/packages/core/src/operators/flatten/utility.ts +++ b/packages/core/src/operators/flatten/correlated/utility.ts @@ -6,11 +6,9 @@ import type { Null, Result } from '@polkadot/types-codec' import type { AnyTuple, CallBase } from '@polkadot/types-codec/types' import type { DispatchError, FunctionMetadataLatest } from '@polkadot/types/interfaces' -import { TxWithIdAndEvent } from '../../types/interfaces.js' -import { Boundaries, Flattener } from './flattener.js' -import { callAsTxWithBoundary, getArgValueFromTx, isEventType } from './util.js' - -const MAX_BATCH_CALLS = 50 +import { TxWithIdAndEvent } from '../../../types/interfaces.js' +import { callAsTxWithBoundary, getArgValueFromTx, isEventType } from '../util.js' +import { Boundaries, CorrelatedFlattener } from './flattener.js' const BatchCompleted = 'utility.BatchCompleted' const BatchCompletedWithErrors = 'utility.BatchCompletedWithErrors' @@ -36,13 +34,13 @@ const DispatchedAsBoundary = { * * @param calls - Array of batch calls. * @param tx - The original transaction. - * @param flattener - The {@link Flattener} instance. + * @param flattener - The {@link CorrelatedFlattener} instance. * @returns An array of batch calls mapped as {@link TxWithIdAndEvent}. */ function mapBatchErrored( calls: CallBase[], tx: TxWithIdAndEvent, - flattener: Flattener + flattener: CorrelatedFlattener ) { let from = flattener.nextPointer @@ -91,10 +89,10 @@ export function extractAsDerivativeCall(tx: TxWithIdAndEvent) { * maps the execution result from the event to the extracted call. * * @param tx - The 'dispatchAs' transaction. - * @param flattener - The {@link Flattener} instance. + * @param flattener - The {@link CorrelatedFlattener} instance. * @returns The extracted call as {@link TxWithIdAndEvent}. */ -export function extractDispatchAsCall(tx: TxWithIdAndEvent, flattener: Flattener) { +export function extractDispatchAsCall(tx: TxWithIdAndEvent, flattener: CorrelatedFlattener) { const { extrinsic, events } = tx const call = getArgValueFromTx(extrinsic, 'call') as CallBase @@ -165,17 +163,13 @@ function mapBatchInterrupt( * 'BatchCompleted' event is emitted if all items are executed succesfully, otherwise emits 'BatchInterrupted' * * @param tx - The 'utility.batch' transaction. - * @param flattener - The {@link Flattener} instance. + * @param flattener - The {@link CorrelatedFlattener} instance. * @returns The array of extracted batch calls * with correlated events and dispatch result as {@link TxWithIdAndEvent}. */ -export function extractBatchCalls(tx: TxWithIdAndEvent, flattener: Flattener) { +export function extractBatchCalls(tx: TxWithIdAndEvent, flattener: CorrelatedFlattener) { const { extrinsic } = tx const calls = extrinsic.args[0] as unknown as CallBase[] - if (calls.length > MAX_BATCH_CALLS) { - throw new Error('Batch too large to process') - } - const batchCompletedIndex = flattener.findEventIndex(BatchCompleted) const batchInterruptedIndex = flattener.findEventIndex(BatchInterrupted) const isInterrupted = @@ -204,9 +198,6 @@ export function extractBatchCalls(tx: TxWithIdAndEvent, flattener: Flattener) { export function extractBatchAllCalls(tx: TxWithIdAndEvent) { const { extrinsic, dispatchError } = tx const calls = extrinsic.args[0] as unknown as CallBase[] - if (calls.length > MAX_BATCH_CALLS) { - throw new Error('Batch too large to process') - } if (dispatchError === undefined) { // If batch executed successfully, extract as normal batch complete calls @@ -223,16 +214,13 @@ export function extractBatchAllCalls(tx: TxWithIdAndEvent) { * If some items fails, will emit ItemFailed for failed items, ItemCompleted for successful items, and BatchCompletedWithErrors at the end. * * @param tx - The transaction with ID and events. - * @param flattener - The {@link Flattener} instance. + * @param flattener - The {@link CorrelatedFlattener} instance. * @returns The array of extracted batch calls * with correlated events and dispatch result as {@link TxWithIdAndEvent}. */ -export function extractForceBatchCalls(tx: TxWithIdAndEvent, flattener: Flattener) { +export function extractForceBatchCalls(tx: TxWithIdAndEvent, flattener: CorrelatedFlattener) { const { extrinsic } = tx const calls = extrinsic.args[0] as unknown as CallBase[] - if (calls.length > MAX_BATCH_CALLS) { - throw new Error('Batch too large to process') - } const batchCompletedIndex = flattener.findEventIndex(BatchCompleted) const batchErroredIndex = flattener.findEventIndex(BatchCompletedWithErrors) diff --git a/packages/core/src/operators/flatten/index.ts b/packages/core/src/operators/flatten/index.ts index 6bde62e..1e3f4f5 100644 --- a/packages/core/src/operators/flatten/index.ts +++ b/packages/core/src/operators/flatten/index.ts @@ -1,49 +1,51 @@ -// Copyright 2023-2024 SO/DA zone -// SPDX-License-Identifier: Apache-2.0 +import { logger } from '@polkadot/util' import { TxWithIdAndEvent } from '../../types/interfaces.js' -import { Boundary, Flattener } from './flattener.js' -import { extractAsMultiCall, extractAsMutiThreshold1Call } from './multisig.js' -import { extractProxyCalls } from './proxy.js' -import { extractAsDerivativeCall, extractBatchAllCalls, extractBatchCalls, extractForceBatchCalls } from './utility.js' -/** - * Type that represents an extractor function. - */ -type CallParser = ( - tx: TxWithIdAndEvent, - flattener: Flattener -) => { - call: TxWithIdAndEvent - boundary?: Boundary -}[] +import { FlattenerMode } from '../flatten.js' +import { BasicFlattener } from './basic/flattener.js' +import { CorrelatedFlattener } from './correlated/flattener.js' +import { hasParser } from './correlated/index.js' +import { Flattener } from './index.js' -/** - * Parsers object which maps method signatures to their corresponding extractor functions. - * Extractor functions take a transaction as input and return the nested call(s) - * as an array of transactions, a single transaction, or undefined based on the extraction logic. - */ -export const parsers: Record = { - 'proxy.proxy': extractProxyCalls, - 'proxy.proxyAnnounced': extractProxyCalls, - 'multisig.asMulti': extractAsMultiCall, - 'multisig.asMultiThreshold1': extractAsMutiThreshold1Call, - 'utility.batch': extractBatchCalls, - 'utility.batchAll': extractBatchAllCalls, - 'utility.forceBatch': extractForceBatchCalls, - 'utility.asDerivative': extractAsDerivativeCall, -} +const l = logger('oc-ops-flattener') + +const DEFAULT_MAX_EVENTS = 200 + +export * from './interfaces.js' /** - * Returns a call parser matching the extrinsic call name or undefined. + * Creates a flattener instance based on the provided transaction and mode. + * + * If the mode is set to BASIC, or if the number of events in the transaction exceeds the maximum allowed, + * a BasicFlattener is returned. Otherwise, a CorrelatedFlattener is used to support event correlation. + * + * @param tx - The transaction containing ID and associated events. + * @param mode - The mode of flattening to use (BASIC or correlated). + * @param maxEvents - The maximum number of events allowed for correlated flattening (defaults to DEFAULT_MAX_EVENTS). + * @returns A Flattener instance appropriate for the given mode and transaction. */ -export function findParser({ extrinsic: { method } }: TxWithIdAndEvent): CallParser | undefined { - return parsers[`${method.section}.${method.method}`] +export function createFlattener(tx: TxWithIdAndEvent, mode: FlattenerMode, maxEvents = DEFAULT_MAX_EVENTS): Flattener { + if (mode === FlattenerMode.BASIC) { + return new BasicFlattener(tx) + } + + if (tx.events.length > maxEvents) { + l.warn( + `Number of events (${tx.events.length}) in tx exceeds max limit of ${maxEvents}. Fallback to skip event correlation.` + ) + return new BasicFlattener(tx) + } + + return new CorrelatedFlattener(tx) } /** - * Returns true if a parser exists for the given extrinsic call name. + * Determines if a transaction is nested based on the presence of a flattener parser for the extrinsic call. + * + * @param tx - The transaction to check. + * @returns True if the transaction is nested, false otherwise. */ -export function hasParser(tx: TxWithIdAndEvent): boolean { - return findParser(tx) !== undefined +export function isNested(tx: TxWithIdAndEvent): boolean { + return hasParser(tx) } diff --git a/packages/core/src/operators/flatten/interfaces.ts b/packages/core/src/operators/flatten/interfaces.ts new file mode 100644 index 0000000..2da0b71 --- /dev/null +++ b/packages/core/src/operators/flatten/interfaces.ts @@ -0,0 +1,9 @@ +import { TxWithIdAndEvent } from '../../types/interfaces.js' + +/** + * Interface for extrinsic flatteners. + */ +export interface Flattener { + flatten() + get flattenedCalls(): TxWithIdAndEvent[] +} diff --git a/packages/core/src/operators/flatten/util.ts b/packages/core/src/operators/flatten/util.ts index 3328bde..b1565b5 100644 --- a/packages/core/src/operators/flatten/util.ts +++ b/packages/core/src/operators/flatten/util.ts @@ -2,12 +2,16 @@ // SPDX-License-Identifier: Apache-2.0 import { GenericCall, GenericExtrinsic } from '@polkadot/types' +import type { Vec, u16 } from '@polkadot/types-codec' import type { AnyTuple, CallBase } from '@polkadot/types-codec/types' -import type { DispatchError, Event, FunctionMetadataLatest } from '@polkadot/types/interfaces' +import type { AccountId32, DispatchError, Event, FunctionMetadataLatest } from '@polkadot/types/interfaces' +import type { Address } from '@polkadot/types/interfaces/runtime' +import { isU8a, u8aToHex } from '@polkadot/util' +import { createKeyMulti } from '@polkadot/util-crypto' import { ExtraSigner, GenericExtrinsicWithId } from '../../types/extrinsic.js' import { ExtrinsicWithId, TxWithIdAndEvent } from '../../types/interfaces.js' -import { Boundary } from './flattener.js' +import { Boundary } from './correlated/flattener.js' type CallContext = { call: CallBase @@ -57,6 +61,43 @@ export function callAsTxWithBoundary({ call, tx, boundary, callError, extraSigne } } +/** + * Constructs a transaction with a flattened call and optional extra signer. + * + * This function creates a new extrinsic with the provided call and any extra signers, + * incorporating additional information such as block number, position, and hash. + * + * @param ctx - The call context containing the call, transaction details, and optional extra signer. + * @returns An object with the updated transaction, including the modified extrinsic. + */ +export function callAsTx({ call, tx, extraSigner }: CallContext) { + const { extrinsic } = tx + const flatCall = new GenericCall(extrinsic.registry, call) + const { blockNumber, blockPosition, blockHash } = extrinsic + const flatExtrinsic = new GenericExtrinsic(extrinsic.registry, { + method: flatCall, + signature: extrinsic.inner.signature, + }) + const txWithId = new GenericExtrinsicWithId( + flatExtrinsic, + { + blockNumber, + blockHash, + blockPosition, + }, + extrinsic.extraSigners + ) + + if (extraSigner) { + txWithId.addExtraSigner(extraSigner) + } + + return { + ...tx, + extrinsic: txWithId, + } +} + /** * Retrieves the value of an argument from an extrinsic. * @@ -75,6 +116,25 @@ export function getArgValueFromTx(extrinsic: ExtrinsicWithId, name: string) { throw new Error(`Extrinsic ${extrinsic.method.toHuman()} does not contain argument with name ${name}`) } +/** + * Generates a multisig address from the given extrinsic. + * + * @param extrinsic - The extrinsic containing the signer and other signatories. + * @param threshold - (Optional) Number of required signatories. Defaults to the value from the extrinsic. + * @returns The computed multisig address. + */ +export function getMultisigAddress(extrinsic: ExtrinsicWithId, threshold?: number) { + const otherSignatories = getArgValueFromTx(extrinsic, 'other_signatories') as Vec + // Signer must be added to the signatories to obtain the multisig address + const signatories = otherSignatories.map((s) => s.toString()) + signatories.push(extrinsic.signer.toString()) + const multisig = createKeyMulti(signatories, threshold ?? (getArgValueFromTx(extrinsic, 'threshold') as u16)) + const multisigAddress = extrinsic.registry.createTypeUnsafe('Address', [ + isU8a(multisig) ? u8aToHex(multisig) : multisig, + ]) as Address + return multisigAddress +} + /** * Retrieves the value of an argument from an event. * diff --git a/packages/core/src/operators/index.ts b/packages/core/src/operators/index.ts index c0f2e33..a855024 100644 --- a/packages/core/src/operators/index.ts +++ b/packages/core/src/operators/index.ts @@ -14,4 +14,3 @@ export * from './convert.js' export * from './retry.js' export * from './util.js' export * from './debug.js' -export { Flattener } from './flatten/flattener.js' diff --git a/packages/pallets/contracts/package.json b/packages/pallets/contracts/package.json index 3d55d6b..8939abf 100644 --- a/packages/pallets/contracts/package.json +++ b/packages/pallets/contracts/package.json @@ -26,7 +26,7 @@ "url": "https://github.com/sodazone/ocelloids-sdk.git" }, "dependencies": { - "@polkadot/api-contract": "^12.2.1", + "@polkadot/api-contract": "^12.2.2", "@sodazone/ocelloids-sdk": "1.2.12-dev.0" }, "devDependencies": { diff --git a/packages/test/package.json b/packages/test/package.json index 6ba0ee4..2ad5b91 100644 --- a/packages/test/package.json +++ b/packages/test/package.json @@ -20,7 +20,7 @@ "shx": "^0.3.4" }, "dependencies": { - "@polkadot/api": "^12.2.1", + "@polkadot/api": "^12.2.2", "@polkadot/util": "^13.0.2", "rxjs": "^7.8.1" }, diff --git a/packages/test/src/_blocks.ts b/packages/test/src/_blocks.ts index 1c96560..f861355 100644 --- a/packages/test/src/_blocks.ts +++ b/packages/test/src/_blocks.ts @@ -8,7 +8,7 @@ import { decode } from 'cbor-x' import { createSignedBlockExtended } from '@polkadot/api-derive' import type { TxWithEvent } from '@polkadot/api-derive/types' import { Metadata, TypeRegistry } from '@polkadot/types' -import type { AccountId, Event, EventRecord, SignedBlock } from '@polkadot/types/interfaces' +import type { AccountId, Event, EventRecord, Extrinsic, SignedBlock } from '@polkadot/types/interfaces' import metadataStatic from './__data__/metadata/polkadot-hex-18977445.js' import type { BinBlock } from './_types.js' @@ -37,6 +37,15 @@ export function testBlocksFrom(file: string, mds: `0x${string}` = metadataStatic }) } +export function cloneExtrinsic(extrinsic: Extrinsic, mds: `0x${string}` = metadataStatic) { + const registry = new TypeRegistry() + const metadata = new Metadata(registry, mds) + + registry.setMetadata(metadata) + + return registry.createType('Extrinsic', extrinsic) as Extrinsic +} + export const testBlocks = testBlocksFrom('blocks.cbor.bin').slice(0, 3) export const testHeaders = testBlocks.map((tb) => tb.block.header) export const testExtrinsics = testBlocks.reduce((acc: TxWithEvent[], tb) => acc.concat(tb.extrinsics), []) diff --git a/yarn.lock b/yarn.lock index 1ae6443..476e047 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1964,13 +1964,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/aix-ppc64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/aix-ppc64@npm:0.21.4" - conditions: os=aix & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/aix-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/aix-ppc64@npm:0.21.5" @@ -1985,13 +1978,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-arm64@npm:0.21.4" - conditions: os=android & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/android-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-arm64@npm:0.21.5" @@ -2006,13 +1992,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-arm@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-arm@npm:0.21.4" - conditions: os=android & cpu=arm - languageName: node - linkType: hard - "@esbuild/android-arm@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-arm@npm:0.21.5" @@ -2027,13 +2006,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/android-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/android-x64@npm:0.21.4" - conditions: os=android & cpu=x64 - languageName: node - linkType: hard - "@esbuild/android-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/android-x64@npm:0.21.5" @@ -2048,13 +2020,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/darwin-arm64@npm:0.21.4" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/darwin-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/darwin-arm64@npm:0.21.5" @@ -2069,13 +2034,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/darwin-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/darwin-x64@npm:0.21.4" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@esbuild/darwin-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/darwin-x64@npm:0.21.5" @@ -2090,13 +2048,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/freebsd-arm64@npm:0.21.4" - conditions: os=freebsd & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/freebsd-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/freebsd-arm64@npm:0.21.5" @@ -2111,13 +2062,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/freebsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/freebsd-x64@npm:0.21.4" - conditions: os=freebsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/freebsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/freebsd-x64@npm:0.21.5" @@ -2132,13 +2076,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-arm64@npm:0.21.4" - conditions: os=linux & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/linux-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-arm64@npm:0.21.5" @@ -2153,13 +2090,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-arm@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-arm@npm:0.21.4" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@esbuild/linux-arm@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-arm@npm:0.21.5" @@ -2174,13 +2104,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ia32@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-ia32@npm:0.21.4" - conditions: os=linux & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/linux-ia32@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-ia32@npm:0.21.5" @@ -2195,13 +2118,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-loong64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-loong64@npm:0.21.4" - conditions: os=linux & cpu=loong64 - languageName: node - linkType: hard - "@esbuild/linux-loong64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-loong64@npm:0.21.5" @@ -2216,13 +2132,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-mips64el@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-mips64el@npm:0.21.4" - conditions: os=linux & cpu=mips64el - languageName: node - linkType: hard - "@esbuild/linux-mips64el@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-mips64el@npm:0.21.5" @@ -2237,13 +2146,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-ppc64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-ppc64@npm:0.21.4" - conditions: os=linux & cpu=ppc64 - languageName: node - linkType: hard - "@esbuild/linux-ppc64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-ppc64@npm:0.21.5" @@ -2258,13 +2160,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-riscv64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-riscv64@npm:0.21.4" - conditions: os=linux & cpu=riscv64 - languageName: node - linkType: hard - "@esbuild/linux-riscv64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-riscv64@npm:0.21.5" @@ -2279,13 +2174,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-s390x@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-s390x@npm:0.21.4" - conditions: os=linux & cpu=s390x - languageName: node - linkType: hard - "@esbuild/linux-s390x@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-s390x@npm:0.21.5" @@ -2300,13 +2188,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/linux-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/linux-x64@npm:0.21.4" - conditions: os=linux & cpu=x64 - languageName: node - linkType: hard - "@esbuild/linux-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/linux-x64@npm:0.21.5" @@ -2321,13 +2202,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/netbsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/netbsd-x64@npm:0.21.4" - conditions: os=netbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/netbsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/netbsd-x64@npm:0.21.5" @@ -2349,13 +2223,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/openbsd-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/openbsd-x64@npm:0.21.4" - conditions: os=openbsd & cpu=x64 - languageName: node - linkType: hard - "@esbuild/openbsd-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/openbsd-x64@npm:0.21.5" @@ -2370,13 +2237,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/sunos-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/sunos-x64@npm:0.21.4" - conditions: os=sunos & cpu=x64 - languageName: node - linkType: hard - "@esbuild/sunos-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/sunos-x64@npm:0.21.5" @@ -2391,13 +2251,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-arm64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-arm64@npm:0.21.4" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@esbuild/win32-arm64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-arm64@npm:0.21.5" @@ -2412,13 +2265,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-ia32@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-ia32@npm:0.21.4" - conditions: os=win32 & cpu=ia32 - languageName: node - linkType: hard - "@esbuild/win32-ia32@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-ia32@npm:0.21.5" @@ -2433,13 +2279,6 @@ __metadata: languageName: node linkType: hard -"@esbuild/win32-x64@npm:0.21.4": - version: 0.21.4 - resolution: "@esbuild/win32-x64@npm:0.21.4" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@esbuild/win32-x64@npm:0.21.5": version: 0.21.5 resolution: "@esbuild/win32-x64@npm:0.21.5" @@ -2933,91 +2772,91 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-augment@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/api-augment@npm:12.2.1" +"@polkadot/api-augment@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/api-augment@npm:12.2.2" dependencies: - "@polkadot/api-base": 12.2.1 - "@polkadot/rpc-augment": 12.2.1 - "@polkadot/types": 12.2.1 - "@polkadot/types-augment": 12.2.1 - "@polkadot/types-codec": 12.2.1 + "@polkadot/api-base": 12.2.2 + "@polkadot/rpc-augment": 12.2.2 + "@polkadot/types": 12.2.2 + "@polkadot/types-augment": 12.2.2 + "@polkadot/types-codec": 12.2.2 "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: 6db34541be0fbcfafd5446715cb12b2223b59f74e9fea0147c411b082d4057256172ef0ba570fa50d539a1ca5d583d02408778a549813104a2c4f6b2a7ba744a + checksum: 8ff1834aa64d8b16de224cdd0f3f610edba139075c942318789bf1ef83113bfa00c57b9194d22c443a1b7c615df365fcd4b9accd41ad30a2816feae14f597e29 languageName: node linkType: hard -"@polkadot/api-base@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/api-base@npm:12.2.1" +"@polkadot/api-base@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/api-base@npm:12.2.2" dependencies: - "@polkadot/rpc-core": 12.2.1 - "@polkadot/types": 12.2.1 + "@polkadot/rpc-core": 12.2.2 + "@polkadot/types": 12.2.2 "@polkadot/util": ^13.0.2 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: 2faa213e9185e8686182323b4a5de222145131429aa8ddb728bf6833381b2906a76e99b6e53d4bd52009f1032be1c19362206c928f7f9779b7fe88443359a417 + checksum: 9981aaf62709f29e76699aec7b1e5138947d41c5b46a99df3d3ea881977c1375fbd02654fb5d6a1007c424aaf2589a76e6f0a16ee148870468feaf9759017631 languageName: node linkType: hard -"@polkadot/api-contract@npm:^12.2.1": - version: 12.2.1 - resolution: "@polkadot/api-contract@npm:12.2.1" +"@polkadot/api-contract@npm:^12.2.2": + version: 12.2.2 + resolution: "@polkadot/api-contract@npm:12.2.2" dependencies: - "@polkadot/api": 12.2.1 - "@polkadot/api-augment": 12.2.1 - "@polkadot/types": 12.2.1 - "@polkadot/types-codec": 12.2.1 - "@polkadot/types-create": 12.2.1 + "@polkadot/api": 12.2.2 + "@polkadot/api-augment": 12.2.2 + "@polkadot/types": 12.2.2 + "@polkadot/types-codec": 12.2.2 + "@polkadot/types-create": 12.2.2 "@polkadot/util": ^13.0.2 "@polkadot/util-crypto": ^13.0.2 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: 3112924bbe90f1da9f0f274edd0bee7a11a33a9e5481c8f77daa75c4e2eda222ab36493d6153c54d4e9463a74d782315aedde87a83ba4ccc4dd03ebd1b1d2948 + checksum: 124ced4aa45f185b7164962ca3870f7cb291b00500aef0f5be79e10d30fc325e1a3f1f029478c65ae3b0e5b79d8b9f95d306d45e8e26afcd9afa8259eb91e2f6 languageName: node linkType: hard -"@polkadot/api-derive@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/api-derive@npm:12.2.1" +"@polkadot/api-derive@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/api-derive@npm:12.2.2" dependencies: - "@polkadot/api": 12.2.1 - "@polkadot/api-augment": 12.2.1 - "@polkadot/api-base": 12.2.1 - "@polkadot/rpc-core": 12.2.1 - "@polkadot/types": 12.2.1 - "@polkadot/types-codec": 12.2.1 + "@polkadot/api": 12.2.2 + "@polkadot/api-augment": 12.2.2 + "@polkadot/api-base": 12.2.2 + "@polkadot/rpc-core": 12.2.2 + "@polkadot/types": 12.2.2 + "@polkadot/types-codec": 12.2.2 "@polkadot/util": ^13.0.2 "@polkadot/util-crypto": ^13.0.2 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: e4937563175a57bf098883a9172f8b1026c80690a333025065e106d0284a9705da0f50694cf474449c6105cc693d3131639b93b1d70db2248583adf626df6c01 + checksum: 3614de38333bbebb2919b48ae4c452a8bf66110315b433a05cc38cd5d7ee9c014bae4d23ac64bc8f58858d25a5d3fa18dd612501508192379da5131c4290143c languageName: node linkType: hard -"@polkadot/api@npm:12.2.1, @polkadot/api@npm:^12.2.1": - version: 12.2.1 - resolution: "@polkadot/api@npm:12.2.1" +"@polkadot/api@npm:12.2.2, @polkadot/api@npm:^12.2.2": + version: 12.2.2 + resolution: "@polkadot/api@npm:12.2.2" dependencies: - "@polkadot/api-augment": 12.2.1 - "@polkadot/api-base": 12.2.1 - "@polkadot/api-derive": 12.2.1 + "@polkadot/api-augment": 12.2.2 + "@polkadot/api-base": 12.2.2 + "@polkadot/api-derive": 12.2.2 "@polkadot/keyring": ^13.0.2 - "@polkadot/rpc-augment": 12.2.1 - "@polkadot/rpc-core": 12.2.1 - "@polkadot/rpc-provider": 12.2.1 - "@polkadot/types": 12.2.1 - "@polkadot/types-augment": 12.2.1 - "@polkadot/types-codec": 12.2.1 - "@polkadot/types-create": 12.2.1 - "@polkadot/types-known": 12.2.1 + "@polkadot/rpc-augment": 12.2.2 + "@polkadot/rpc-core": 12.2.2 + "@polkadot/rpc-provider": 12.2.2 + "@polkadot/types": 12.2.2 + "@polkadot/types-augment": 12.2.2 + "@polkadot/types-codec": 12.2.2 + "@polkadot/types-create": 12.2.2 + "@polkadot/types-known": 12.2.2 "@polkadot/util": ^13.0.2 "@polkadot/util-crypto": ^13.0.2 eventemitter3: ^5.0.1 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: 758499b7cce7b8320f30561c976429c02232ed863ffd2f4a7737b11db604ec560d919e327ccec6c95a08ede17bbb4eeaca859f05d45ff64366fa00126887b9d4 + checksum: 43ea694ac5b565f6da72ac20bba0741aff3cbcf228baaa388ab75cee06b4f5f07727fbae7fb8a34cd5830a2777c9aee90dd3cdde913e3be288856f6a6f5abb48 languageName: node linkType: hard @@ -3046,40 +2885,40 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-augment@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/rpc-augment@npm:12.2.1" +"@polkadot/rpc-augment@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/rpc-augment@npm:12.2.2" dependencies: - "@polkadot/rpc-core": 12.2.1 - "@polkadot/types": 12.2.1 - "@polkadot/types-codec": 12.2.1 + "@polkadot/rpc-core": 12.2.2 + "@polkadot/types": 12.2.2 + "@polkadot/types-codec": 12.2.2 "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: 6c135b9f8892fd6ccc89dc3e7d6f16c905fbc4fe254611fe0e9c33b26b48cbdafbbf31d4c6b75916b01dd9ea6aa1e9302446918b9ad719708da16505fc8373c4 + checksum: 16031d9448335dda4e73fb8e28710198a086199567793b1bc6f888333c7501709852d7878c9d025aed3bbd6e38864c3f5cb2ce0d4e621ee8e7fd5f01351fca02 languageName: node linkType: hard -"@polkadot/rpc-core@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/rpc-core@npm:12.2.1" +"@polkadot/rpc-core@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/rpc-core@npm:12.2.2" dependencies: - "@polkadot/rpc-augment": 12.2.1 - "@polkadot/rpc-provider": 12.2.1 - "@polkadot/types": 12.2.1 + "@polkadot/rpc-augment": 12.2.2 + "@polkadot/rpc-provider": 12.2.2 + "@polkadot/types": 12.2.2 "@polkadot/util": ^13.0.2 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: 8cc792752287e772ed892be664cab9bc4b006b9b723aeebab0c5a34da19009e7ffa1738aa7f2949e278ea9fff9b3acfa5131ec1b597796484b5aba7e701dbc53 + checksum: 3f527a750469ad340924ba81cd42663ed528e7189b301f10c9e260deb3d4985f0a892730a783142a363d97df3b1eff9d3e3d1460ffbe77f530358df443da950c languageName: node linkType: hard -"@polkadot/rpc-provider@npm:12.2.1, @polkadot/rpc-provider@npm:^12.2.1": - version: 12.2.1 - resolution: "@polkadot/rpc-provider@npm:12.2.1" +"@polkadot/rpc-provider@npm:12.2.2, @polkadot/rpc-provider@npm:^12.2.2": + version: 12.2.2 + resolution: "@polkadot/rpc-provider@npm:12.2.2" dependencies: "@polkadot/keyring": ^13.0.2 - "@polkadot/types": 12.2.1 - "@polkadot/types-support": 12.2.1 + "@polkadot/types": 12.2.2 + "@polkadot/types-support": 12.2.2 "@polkadot/util": ^13.0.2 "@polkadot/util-crypto": ^13.0.2 "@polkadot/x-fetch": ^13.0.2 @@ -3093,81 +2932,81 @@ __metadata: dependenciesMeta: "@substrate/connect": optional: true - checksum: abf57fce247956fb62d59e34289627fce100053de32103efafbe5fde2238d7ff746d03c02aff6105f7300b91147645fa50a91cf7e82d3f46cbaa4c7296b29bd1 + checksum: 8620645034c153502c1a4d2b9c752476fe237411ddba1e069dab7c36c717291d67db35eeca7d3c17c38020fda7a8addd1d7142b17a072e23cf1add84342bd260 languageName: node linkType: hard -"@polkadot/types-augment@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types-augment@npm:12.2.1" +"@polkadot/types-augment@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types-augment@npm:12.2.2" dependencies: - "@polkadot/types": 12.2.1 - "@polkadot/types-codec": 12.2.1 + "@polkadot/types": 12.2.2 + "@polkadot/types-codec": 12.2.2 "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: 1481ef2051838c659f5d4cc0105343bd67dc9a14f2de9ba44ee32b9679eeb0475ae53721cac69358178f58b57fc8d07d167075886003b0f01d486be3568c9392 + checksum: 5c6e650cb770c94902a0e5b5964f13cfc717171a0b3b62024f0473d8df862c44072b36167860b3c0f439733232e703ce516daf4be93b4a454003c3d10501a687 languageName: node linkType: hard -"@polkadot/types-codec@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types-codec@npm:12.2.1" +"@polkadot/types-codec@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types-codec@npm:12.2.2" dependencies: "@polkadot/util": ^13.0.2 "@polkadot/x-bigint": ^13.0.2 tslib: ^2.6.2 - checksum: 6780dc0ffdd6a954ff6c50161b2dc0bc14840c4c58adcab7aef3d56cfa2bb58a9ee79ee5a972c0c430b5afb34200d2a7fdfa9911cf78d2333998e3ba45456caf + checksum: c61d8f0f07d89e7f74aa59ab9fe8cb6b6a85d287ecd61b905e05595ee38bfc45bcf7f9019246b137b1edc2e8485723e5c382ef10ee481c639c292177d2671f78 languageName: node linkType: hard -"@polkadot/types-create@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types-create@npm:12.2.1" +"@polkadot/types-create@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types-create@npm:12.2.2" dependencies: - "@polkadot/types-codec": 12.2.1 + "@polkadot/types-codec": 12.2.2 "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: c6d0058b70a0d23e50808432dd4243483a299a77cde6fc5ad70bee9dab924b99019c4a8e86ffed3f2e61fafffa7d803d1113cbf102f03c2a4e9110f6c8456e92 + checksum: 9f3c689b80cfe004ecf705294fc527985f63b94f9c0bf3630028db1bef72e0a506d1a8c4872247b9d4094dac57491c34f9cf279c8da2775bb2edc301aa9d388f languageName: node linkType: hard -"@polkadot/types-known@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types-known@npm:12.2.1" +"@polkadot/types-known@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types-known@npm:12.2.2" dependencies: "@polkadot/networks": ^13.0.2 - "@polkadot/types": 12.2.1 - "@polkadot/types-codec": 12.2.1 - "@polkadot/types-create": 12.2.1 + "@polkadot/types": 12.2.2 + "@polkadot/types-codec": 12.2.2 + "@polkadot/types-create": 12.2.2 "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: cb711b3aacb1cee262d91cf28c59740256ba70e00aeff7580bce0c924be33d99fa15816ce1381796f7d1ea981467449f77f37ab39f08d082a740c285932658e8 + checksum: 252d421a794dc9aadafceafc50c4e829cb6dd8defc252d88b3c72bc58cbc980663402158b54bc94440cfe5fe9c97e46d2d481f2ccb9b20fba36d399f402a2fc4 languageName: node linkType: hard -"@polkadot/types-support@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types-support@npm:12.2.1" +"@polkadot/types-support@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types-support@npm:12.2.2" dependencies: "@polkadot/util": ^13.0.2 tslib: ^2.6.2 - checksum: 7dcc139f94dd34a6f58d8ff170d5a5d89eae7ca231a8d13bab7afd5d4a8db18a59165a12c16629df78af1202099536078c37df278eb632b18075ccf3cbbfdeec + checksum: 1d4b78b8acbfe3ac9a2e806bb384b46dca608fc1b2d60383bf4740fa6043b1b0cf22fcc6f99710b3cece6c9b18feed976d2ee7418e4a3a0178ee54a20d8c250e languageName: node linkType: hard -"@polkadot/types@npm:12.2.1": - version: 12.2.1 - resolution: "@polkadot/types@npm:12.2.1" +"@polkadot/types@npm:12.2.2": + version: 12.2.2 + resolution: "@polkadot/types@npm:12.2.2" dependencies: "@polkadot/keyring": ^13.0.2 - "@polkadot/types-augment": 12.2.1 - "@polkadot/types-codec": 12.2.1 - "@polkadot/types-create": 12.2.1 + "@polkadot/types-augment": 12.2.2 + "@polkadot/types-codec": 12.2.2 + "@polkadot/types-create": 12.2.2 "@polkadot/util": ^13.0.2 "@polkadot/util-crypto": ^13.0.2 rxjs: ^7.8.1 tslib: ^2.6.2 - checksum: be5be5d851dd63ac00fd42907d923d929cd6dca96f671284d34b9fabb75e7b987fa6be5cc74ebaae19cc541827e8b7e6f32e5b980cbf3dbb9b7404b1a0773d73 + checksum: 80afaa8eb063896d99bf6528de787eff2c6f8338e524cb0dce94b6ed560ba35173ee750c24c9270c6ea0ac8d74e52ce21add4511b72d3afd660754ff0b023a53 languageName: node linkType: hard @@ -3360,93 +3199,114 @@ __metadata: languageName: node linkType: hard -"@rollup/rollup-android-arm-eabi@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-android-arm-eabi@npm:4.9.5" +"@rollup/rollup-android-arm-eabi@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-android-arm-eabi@npm:4.19.0" conditions: os=android & cpu=arm languageName: node linkType: hard -"@rollup/rollup-android-arm64@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-android-arm64@npm:4.9.5" +"@rollup/rollup-android-arm64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-android-arm64@npm:4.19.0" conditions: os=android & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-arm64@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-darwin-arm64@npm:4.9.5" +"@rollup/rollup-darwin-arm64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-darwin-arm64@npm:4.19.0" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-darwin-x64@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-darwin-x64@npm:4.9.5" +"@rollup/rollup-darwin-x64@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-darwin-x64@npm:4.19.0" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@rollup/rollup-linux-arm-gnueabihf@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.9.5" - conditions: os=linux & cpu=arm +"@rollup/rollup-linux-arm-gnueabihf@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm-gnueabihf@npm:4.19.0" + conditions: os=linux & cpu=arm & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-arm-musleabihf@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm-musleabihf@npm:4.19.0" + conditions: os=linux & cpu=arm & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-arm64-gnu@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.9.5" +"@rollup/rollup-linux-arm64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm64-gnu@npm:4.19.0" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-arm64-musl@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-arm64-musl@npm:4.9.5" +"@rollup/rollup-linux-arm64-musl@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-arm64-musl@npm:4.19.0" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-linux-riscv64-gnu@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.9.5" +"@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-powerpc64le-gnu@npm:4.19.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-riscv64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-riscv64-gnu@npm:4.19.0" conditions: os=linux & cpu=riscv64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-gnu@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-x64-gnu@npm:4.9.5" +"@rollup/rollup-linux-s390x-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-s390x-gnu@npm:4.19.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@rollup/rollup-linux-x64-gnu@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-x64-gnu@npm:4.19.0" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@rollup/rollup-linux-x64-musl@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-linux-x64-musl@npm:4.9.5" +"@rollup/rollup-linux-x64-musl@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-linux-x64-musl@npm:4.19.0" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@rollup/rollup-win32-arm64-msvc@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.9.5" +"@rollup/rollup-win32-arm64-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-arm64-msvc@npm:4.19.0" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@rollup/rollup-win32-ia32-msvc@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.9.5" +"@rollup/rollup-win32-ia32-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-ia32-msvc@npm:4.19.0" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@rollup/rollup-win32-x64-msvc@npm:4.9.5": - version: 4.9.5 - resolution: "@rollup/rollup-win32-x64-msvc@npm:4.9.5" +"@rollup/rollup-win32-x64-msvc@npm:4.19.0": + version: 4.19.0 + resolution: "@rollup/rollup-win32-x64-msvc@npm:4.19.0" conditions: os=win32 & cpu=x64 languageName: node linkType: hard @@ -3496,7 +3356,7 @@ __metadata: version: 0.0.0-use.local resolution: "@sodazone/ocelloids-sdk-contracts@workspace:packages/pallets/contracts" dependencies: - "@polkadot/api-contract": ^12.2.1 + "@polkadot/api-contract": ^12.2.2 "@sodazone/ocelloids-sdk": 1.2.12-dev.0 "@sodazone/ocelloids-sdk-test": 1.2.12-dev.0 languageName: unknown @@ -3506,13 +3366,13 @@ __metadata: version: 0.0.0-use.local resolution: "@sodazone/ocelloids-sdk-examples@workspace:examples" dependencies: - "@polkadot/rpc-provider": ^12.2.1 + "@polkadot/rpc-provider": ^12.2.2 "@sodazone/ocelloids-sdk": 1.2.12-dev.0 - "@substrate/connect": ^1.0.7 + "@substrate/connect": ^1.1.0 graph-data-structure: ^3.5.0 hjson: ^3.2.2 rxjs: ^7.8.1 - tsup: ^8.1.0 + tsup: ^8.2.3 tsx: ^4.16.2 yargs: ^17.7.2 bin: @@ -3532,7 +3392,7 @@ __metadata: version: 0.0.0-use.local resolution: "@sodazone/ocelloids-sdk-test@workspace:packages/test" dependencies: - "@polkadot/api": ^12.2.1 + "@polkadot/api": ^12.2.2 "@polkadot/util": ^13.0.2 cbor-x: ^1.5.9 rxjs: ^7.8.1 @@ -3558,9 +3418,9 @@ __metadata: version: 0.0.0-use.local resolution: "@sodazone/ocelloids-sdk@workspace:packages/core" dependencies: - "@polkadot/api": ^12.2.1 + "@polkadot/api": ^12.2.2 "@sodazone/ocelloids-sdk-test": 1.2.12-dev.0 - "@substrate/connect-known-chains": ^1.1.9 + "@substrate/connect-known-chains": ^1.2.0 mingo: ^6.4.15 rxjs: ^7.8.1 web-worker: 1.3.0 @@ -3574,13 +3434,20 @@ __metadata: languageName: node linkType: hard -"@substrate/connect-known-chains@npm:^1.1.4, @substrate/connect-known-chains@npm:^1.1.9": +"@substrate/connect-known-chains@npm:^1.1.4": version: 1.1.9 resolution: "@substrate/connect-known-chains@npm:1.1.9" checksum: 26e2aaaf770993dbb826f03cb5175e0cc66383ad2a26898d3c4b6493cbd73b02d0c547dcbd1f808f8f0802cc2f84add11028cc565db638be449b0f00b60aa321 languageName: node linkType: hard +"@substrate/connect-known-chains@npm:^1.2.0": + version: 1.2.0 + resolution: "@substrate/connect-known-chains@npm:1.2.0" + checksum: ab7c43fe9d32b371cad425088ef045e4dbe4382fad3fb3cefd13a5e41c71c86c385234f3ba155c4de711190c0660eee9520fdb846da28e8e577544e589024011 + languageName: node + linkType: hard + "@substrate/connect@npm:0.8.10": version: 0.8.10 resolution: "@substrate/connect@npm:0.8.10" @@ -3593,15 +3460,15 @@ __metadata: languageName: node linkType: hard -"@substrate/connect@npm:^1.0.7": - version: 1.0.7 - resolution: "@substrate/connect@npm:1.0.7" +"@substrate/connect@npm:^1.1.0": + version: 1.1.0 + resolution: "@substrate/connect@npm:1.1.0" dependencies: "@substrate/connect-extension-protocol": ^2.0.0 - "@substrate/connect-known-chains": ^1.1.9 - "@substrate/smoldot-discovery": ^0.0.8 + "@substrate/connect-known-chains": ^1.2.0 + "@substrate/smoldot-discovery": ^1.0.0 smoldot: 2.0.29 - checksum: 47d88eb10e96778fab90c8a5703d49dcba83f149ca1ccefc5eddb924ac6d3d8f12387cde800df0876e62779f0685f331407731fe9d20f7e9fd658e96761ebf8b + checksum: 17569304f6c3b3b0411944ed157f5bea8b38c68d8d1676616b212106367985d2844bf1554811a5ae80141062df66fa2349da7d1ac8e320a74e7efdcf80e7af30 languageName: node linkType: hard @@ -3629,14 +3496,12 @@ __metadata: languageName: node linkType: hard -"@substrate/smoldot-discovery@npm:^0.0.8": - version: 0.0.8 - resolution: "@substrate/smoldot-discovery@npm:0.0.8" +"@substrate/smoldot-discovery@npm:^1.0.0": + version: 1.0.0 + resolution: "@substrate/smoldot-discovery@npm:1.0.0" dependencies: "@substrate/discovery": ^0.0.1 - peerDependencies: - "@substrate/light-client-extension-helpers": "*" - checksum: 89eadc6c44862759e16c224105c60eb70120eda6d420b58b32ef4a861699d52e0cda7dde3dfe525d6bbe01e209c6e0598cce8ec19b1ac4299ea2c3b42ab86ab0 + checksum: d987531bda56dbc534d4dede9f778514b8abbc37801eaf36dd3d5b73712661b88ba626d6657a9a7b9cc6898db75cfe292b4d7419c74cf2e26e6494b598d964f7 languageName: node linkType: hard @@ -3647,92 +3512,92 @@ __metadata: languageName: node linkType: hard -"@swc/core-darwin-arm64@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-darwin-arm64@npm:1.6.13" +"@swc/core-darwin-arm64@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-darwin-arm64@npm:1.7.2" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"@swc/core-darwin-x64@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-darwin-x64@npm:1.6.13" +"@swc/core-darwin-x64@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-darwin-x64@npm:1.7.2" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"@swc/core-linux-arm-gnueabihf@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-linux-arm-gnueabihf@npm:1.6.13" +"@swc/core-linux-arm-gnueabihf@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-linux-arm-gnueabihf@npm:1.7.2" conditions: os=linux & cpu=arm languageName: node linkType: hard -"@swc/core-linux-arm64-gnu@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-linux-arm64-gnu@npm:1.6.13" +"@swc/core-linux-arm64-gnu@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-linux-arm64-gnu@npm:1.7.2" conditions: os=linux & cpu=arm64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-arm64-musl@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-linux-arm64-musl@npm:1.6.13" +"@swc/core-linux-arm64-musl@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-linux-arm64-musl@npm:1.7.2" conditions: os=linux & cpu=arm64 & libc=musl languageName: node linkType: hard -"@swc/core-linux-x64-gnu@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-linux-x64-gnu@npm:1.6.13" +"@swc/core-linux-x64-gnu@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-linux-x64-gnu@npm:1.7.2" conditions: os=linux & cpu=x64 & libc=glibc languageName: node linkType: hard -"@swc/core-linux-x64-musl@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-linux-x64-musl@npm:1.6.13" +"@swc/core-linux-x64-musl@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-linux-x64-musl@npm:1.7.2" conditions: os=linux & cpu=x64 & libc=musl languageName: node linkType: hard -"@swc/core-win32-arm64-msvc@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-win32-arm64-msvc@npm:1.6.13" +"@swc/core-win32-arm64-msvc@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-win32-arm64-msvc@npm:1.7.2" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"@swc/core-win32-ia32-msvc@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-win32-ia32-msvc@npm:1.6.13" +"@swc/core-win32-ia32-msvc@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-win32-ia32-msvc@npm:1.7.2" conditions: os=win32 & cpu=ia32 languageName: node linkType: hard -"@swc/core-win32-x64-msvc@npm:1.6.13": - version: 1.6.13 - resolution: "@swc/core-win32-x64-msvc@npm:1.6.13" +"@swc/core-win32-x64-msvc@npm:1.7.2": + version: 1.7.2 + resolution: "@swc/core-win32-x64-msvc@npm:1.7.2" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"@swc/core@npm:^1.6.13": - version: 1.6.13 - resolution: "@swc/core@npm:1.6.13" +"@swc/core@npm:^1.7.2": + version: 1.7.2 + resolution: "@swc/core@npm:1.7.2" dependencies: - "@swc/core-darwin-arm64": 1.6.13 - "@swc/core-darwin-x64": 1.6.13 - "@swc/core-linux-arm-gnueabihf": 1.6.13 - "@swc/core-linux-arm64-gnu": 1.6.13 - "@swc/core-linux-arm64-musl": 1.6.13 - "@swc/core-linux-x64-gnu": 1.6.13 - "@swc/core-linux-x64-musl": 1.6.13 - "@swc/core-win32-arm64-msvc": 1.6.13 - "@swc/core-win32-ia32-msvc": 1.6.13 - "@swc/core-win32-x64-msvc": 1.6.13 + "@swc/core-darwin-arm64": 1.7.2 + "@swc/core-darwin-x64": 1.7.2 + "@swc/core-linux-arm-gnueabihf": 1.7.2 + "@swc/core-linux-arm64-gnu": 1.7.2 + "@swc/core-linux-arm64-musl": 1.7.2 + "@swc/core-linux-x64-gnu": 1.7.2 + "@swc/core-linux-x64-musl": 1.7.2 + "@swc/core-win32-arm64-msvc": 1.7.2 + "@swc/core-win32-ia32-msvc": 1.7.2 + "@swc/core-win32-x64-msvc": 1.7.2 "@swc/counter": ^0.1.3 - "@swc/types": ^0.1.9 + "@swc/types": ^0.1.12 peerDependencies: "@swc/helpers": "*" dependenciesMeta: @@ -3759,7 +3624,7 @@ __metadata: peerDependenciesMeta: "@swc/helpers": optional: true - checksum: 4b2cddfac17e48ec5afc1942a6a39e9ea5af7fe15b4cebbc72f4569bffbea8ddf66ddf3055a931a6d79e713e3991a0ba9f0c764fc88175358084261dadffe277 + checksum: 251da1c8e7d54dc8b1783ad88667dc519cdc33baa92d2f5470ca0cb0e02ec6f132bb3d513c6a99826c41443ff0ee097428f2bef64cc8c05d14b796537acaea75 languageName: node linkType: hard @@ -3783,12 +3648,12 @@ __metadata: languageName: node linkType: hard -"@swc/types@npm:^0.1.9": - version: 0.1.9 - resolution: "@swc/types@npm:0.1.9" +"@swc/types@npm:^0.1.12": + version: 0.1.12 + resolution: "@swc/types@npm:0.1.12" dependencies: "@swc/counter": ^0.1.3 - checksum: 16fcdf331c94c52f6dbf234bd9c294a5479e4b107eb8bce364b46cd5cf86ff7073e371a3a02573e6843b0ec979e6d8912b6f60212ad297aa170a9025e7ebb716 + checksum: cf7f89e46f859864075d7965582baea9c5f98830f45b1046251568c9bdf1ca484b1bf37f6d3c32b7c82ecf8cd5df89d22f05268c391819c44e49911bb1a8e71a languageName: node linkType: hard @@ -3911,12 +3776,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20.14.10": - version: 20.14.10 - resolution: "@types/node@npm:20.14.10" +"@types/node@npm:^20.14.12": + version: 20.14.12 + resolution: "@types/node@npm:20.14.12" dependencies: undici-types: ~5.26.4 - checksum: 2f397d393de8cddb126e0b7999402ea450215ac69d49666ddef4f730a73325054499ce7345f86095e7b935c55b2e02139f3b8b9afc72fb978ed29edf6bb956b0 + checksum: 1dd493d9e27da43fc374b17cf4b956dbd1dfe20ecf4749408a1db046c79b5a39261a2aa7a3f59b79fd1b5632b861ba72837779d812e0d3b6cf5b22f1650fe722 languageName: node linkType: hard @@ -4290,18 +4155,18 @@ __metadata: languageName: node linkType: hard -"bundle-require@npm:^4.0.0": - version: 4.0.2 - resolution: "bundle-require@npm:4.0.2" +"bundle-require@npm:^5.0.0": + version: 5.0.0 + resolution: "bundle-require@npm:5.0.0" dependencies: load-tsconfig: ^0.2.3 peerDependencies: - esbuild: ">=0.17" - checksum: 13a78ac0aee0f33614c24f2747167c7faebef6c9d1d5453b464fc85fa164a3a3aab657b2b31b7b5d2a088e4958676fef0454328ff7baddd6bfb03a8ff8d8b928 + esbuild: ">=0.18" + checksum: c5b31e2782546c21649cfc6e4bbdbaa0a41764e0d73b31c95f0a40efe961f83bc5cdc92308ad26aee735cf82b438cf945cc96dfefa16c5d8fc61a7cca67fa3fb languageName: node linkType: hard -"cac@npm:^6.7.12": +"cac@npm:^6.7.14": version: 6.7.14 resolution: "cac@npm:6.7.14" checksum: 45a2496a9443abbe7f52a49b22fbe51b1905eff46e03fd5e6c98e3f85077be3f8949685a1849b1a9cd2bc3e5567dfebcf64f01ce01847baf918f1b37c839791a @@ -4441,9 +4306,9 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:^3.5.1": - version: 3.5.3 - resolution: "chokidar@npm:3.5.3" +"chokidar@npm:^3.6.0": + version: 3.6.0 + resolution: "chokidar@npm:3.6.0" dependencies: anymatch: ~3.1.2 braces: ~3.0.2 @@ -4456,7 +4321,7 @@ __metadata: dependenciesMeta: fsevents: optional: true - checksum: b49fcde40176ba007ff361b198a2d35df60d9bb2a5aab228279eb810feae9294a6b4649ab15981304447afe1e6ffbf4788ad5db77235dc770ab777c6e771980c + checksum: d2f29f499705dcd4f6f3bbed79a9ce2388cf530460122eed3b9c48efeab7a4e28739c6551fd15bec9245c6b9eeca7a32baa64694d64d9b6faeb74ddb8c4a413d languageName: node linkType: hard @@ -4647,6 +4512,18 @@ __metadata: languageName: node linkType: hard +"debug@npm:^4.3.5": + version: 4.3.5 + resolution: "debug@npm:4.3.5" + dependencies: + ms: 2.1.2 + peerDependenciesMeta: + supports-color: + optional: true + checksum: 7c002b51e256257f936dda09eb37167df952758c57badf6bf44bdc40b89a4bcb8e5a0a2e4c7b53f97c69e2970dd5272d33a757378a12c8f8e64ea7bf99e8e86e + languageName: node + linkType: hard + "dedent@npm:^1.0.0": version: 1.5.1 resolution: "dedent@npm:1.5.1" @@ -4784,86 +4661,6 @@ __metadata: languageName: node linkType: hard -"esbuild@npm:^0.21.4": - version: 0.21.4 - resolution: "esbuild@npm:0.21.4" - dependencies: - "@esbuild/aix-ppc64": 0.21.4 - "@esbuild/android-arm": 0.21.4 - "@esbuild/android-arm64": 0.21.4 - "@esbuild/android-x64": 0.21.4 - "@esbuild/darwin-arm64": 0.21.4 - "@esbuild/darwin-x64": 0.21.4 - "@esbuild/freebsd-arm64": 0.21.4 - "@esbuild/freebsd-x64": 0.21.4 - "@esbuild/linux-arm": 0.21.4 - "@esbuild/linux-arm64": 0.21.4 - "@esbuild/linux-ia32": 0.21.4 - "@esbuild/linux-loong64": 0.21.4 - "@esbuild/linux-mips64el": 0.21.4 - "@esbuild/linux-ppc64": 0.21.4 - "@esbuild/linux-riscv64": 0.21.4 - "@esbuild/linux-s390x": 0.21.4 - "@esbuild/linux-x64": 0.21.4 - "@esbuild/netbsd-x64": 0.21.4 - "@esbuild/openbsd-x64": 0.21.4 - "@esbuild/sunos-x64": 0.21.4 - "@esbuild/win32-arm64": 0.21.4 - "@esbuild/win32-ia32": 0.21.4 - "@esbuild/win32-x64": 0.21.4 - dependenciesMeta: - "@esbuild/aix-ppc64": - optional: true - "@esbuild/android-arm": - optional: true - "@esbuild/android-arm64": - optional: true - "@esbuild/android-x64": - optional: true - "@esbuild/darwin-arm64": - optional: true - "@esbuild/darwin-x64": - optional: true - "@esbuild/freebsd-arm64": - optional: true - "@esbuild/freebsd-x64": - optional: true - "@esbuild/linux-arm": - optional: true - "@esbuild/linux-arm64": - optional: true - "@esbuild/linux-ia32": - optional: true - "@esbuild/linux-loong64": - optional: true - "@esbuild/linux-mips64el": - optional: true - "@esbuild/linux-ppc64": - optional: true - "@esbuild/linux-riscv64": - optional: true - "@esbuild/linux-s390x": - optional: true - "@esbuild/linux-x64": - optional: true - "@esbuild/netbsd-x64": - optional: true - "@esbuild/openbsd-x64": - optional: true - "@esbuild/sunos-x64": - optional: true - "@esbuild/win32-arm64": - optional: true - "@esbuild/win32-ia32": - optional: true - "@esbuild/win32-x64": - optional: true - bin: - esbuild: bin/esbuild - checksum: e96ae5f15d9cad72a94d36be3cbf37bd73d5614c6c0cc6398036ee9a9b9327a1eee41a4099e536e52f1280f7d8dc7e86eb8f71d348cac4b526a6234cf8d754ab - languageName: node - linkType: hard - "esbuild@npm:^0.23.0": version: 0.23.0 resolution: "esbuild@npm:0.23.0" @@ -5079,7 +4876,7 @@ __metadata: languageName: node linkType: hard -"execa@npm:^5.0.0": +"execa@npm:^5.0.0, execa@npm:^5.1.1": version: 5.1.1 resolution: "execa@npm:5.1.1" dependencies: @@ -5342,7 +5139,7 @@ __metadata: languageName: node linkType: hard -"globby@npm:^11.0.3": +"globby@npm:^11.1.0": version: 11.1.0 resolution: "globby@npm:11.1.0" dependencies: @@ -6123,7 +5920,7 @@ __metadata: languageName: node linkType: hard -"joycon@npm:^3.0.1": +"joycon@npm:^3.1.1": version: 3.1.1 resolution: "joycon@npm:3.1.1" checksum: 8003c9c3fc79c5c7602b1c7e9f7a2df2e9916f046b0dbad862aa589be78c15734d11beb9fe846f5e06138df22cb2ad29961b6a986ba81c4920ce2b15a7f11067 @@ -6211,10 +6008,10 @@ __metadata: languageName: node linkType: hard -"lilconfig@npm:^3.0.0": - version: 3.0.0 - resolution: "lilconfig@npm:3.0.0" - checksum: a155f1cd24d324ab20dd6974db9ebcf3fb6f2b60175f7c052d917ff8a746b590bc1ee550f6fc3cb1e8716c8b58304e22fe2193febebc0cf16fa86d85e6f896c5 +"lilconfig@npm:^3.1.1": + version: 3.1.2 + resolution: "lilconfig@npm:3.1.2" + checksum: 4e8b83ddd1d0ad722600994e6ba5d858ddca14f0587aa6b9c8185e17548149b5e13d4d583d811e9e9323157fa8c6a527e827739794c7502b59243c58e210b8c3 languageName: node linkType: hard @@ -6825,21 +6622,26 @@ __metadata: languageName: node linkType: hard -"postcss-load-config@npm:^4.0.1": - version: 4.0.2 - resolution: "postcss-load-config@npm:4.0.2" +"postcss-load-config@npm:^6.0.1": + version: 6.0.1 + resolution: "postcss-load-config@npm:6.0.1" dependencies: - lilconfig: ^3.0.0 - yaml: ^2.3.4 + lilconfig: ^3.1.1 peerDependencies: + jiti: ">=1.21.0" postcss: ">=8.0.9" - ts-node: ">=9.0.0" + tsx: ^4.8.1 + yaml: ^2.4.2 peerDependenciesMeta: + jiti: + optional: true postcss: optional: true - ts-node: + tsx: + optional: true + yaml: optional: true - checksum: 7c27dd3801db4eae207a5116fed2db6b1ebb780b40c3dd62a3e57e087093a8e6a14ee17ada729fee903152d6ef4826c6339eb135bee6208e0f3140d7e8090185 + checksum: 701061264cce7646e53e4cecd14aa95432a9bd508f30520a31dfa4c86fe9252d5d8d0204fdbfbddc1559c9b8791556e9c4b92c56070f5fca0a6c60e5ee9ad0fd languageName: node linkType: hard @@ -7075,23 +6877,26 @@ __metadata: languageName: node linkType: hard -"rollup@npm:^4.0.2": - version: 4.9.5 - resolution: "rollup@npm:4.9.5" - dependencies: - "@rollup/rollup-android-arm-eabi": 4.9.5 - "@rollup/rollup-android-arm64": 4.9.5 - "@rollup/rollup-darwin-arm64": 4.9.5 - "@rollup/rollup-darwin-x64": 4.9.5 - "@rollup/rollup-linux-arm-gnueabihf": 4.9.5 - "@rollup/rollup-linux-arm64-gnu": 4.9.5 - "@rollup/rollup-linux-arm64-musl": 4.9.5 - "@rollup/rollup-linux-riscv64-gnu": 4.9.5 - "@rollup/rollup-linux-x64-gnu": 4.9.5 - "@rollup/rollup-linux-x64-musl": 4.9.5 - "@rollup/rollup-win32-arm64-msvc": 4.9.5 - "@rollup/rollup-win32-ia32-msvc": 4.9.5 - "@rollup/rollup-win32-x64-msvc": 4.9.5 +"rollup@npm:^4.19.0": + version: 4.19.0 + resolution: "rollup@npm:4.19.0" + dependencies: + "@rollup/rollup-android-arm-eabi": 4.19.0 + "@rollup/rollup-android-arm64": 4.19.0 + "@rollup/rollup-darwin-arm64": 4.19.0 + "@rollup/rollup-darwin-x64": 4.19.0 + "@rollup/rollup-linux-arm-gnueabihf": 4.19.0 + "@rollup/rollup-linux-arm-musleabihf": 4.19.0 + "@rollup/rollup-linux-arm64-gnu": 4.19.0 + "@rollup/rollup-linux-arm64-musl": 4.19.0 + "@rollup/rollup-linux-powerpc64le-gnu": 4.19.0 + "@rollup/rollup-linux-riscv64-gnu": 4.19.0 + "@rollup/rollup-linux-s390x-gnu": 4.19.0 + "@rollup/rollup-linux-x64-gnu": 4.19.0 + "@rollup/rollup-linux-x64-musl": 4.19.0 + "@rollup/rollup-win32-arm64-msvc": 4.19.0 + "@rollup/rollup-win32-ia32-msvc": 4.19.0 + "@rollup/rollup-win32-x64-msvc": 4.19.0 "@types/estree": 1.0.5 fsevents: ~2.3.2 dependenciesMeta: @@ -7105,12 +6910,18 @@ __metadata: optional: true "@rollup/rollup-linux-arm-gnueabihf": optional: true + "@rollup/rollup-linux-arm-musleabihf": + optional: true "@rollup/rollup-linux-arm64-gnu": optional: true "@rollup/rollup-linux-arm64-musl": optional: true + "@rollup/rollup-linux-powerpc64le-gnu": + optional: true "@rollup/rollup-linux-riscv64-gnu": optional: true + "@rollup/rollup-linux-s390x-gnu": + optional: true "@rollup/rollup-linux-x64-gnu": optional: true "@rollup/rollup-linux-x64-musl": @@ -7125,7 +6936,7 @@ __metadata: optional: true bin: rollup: dist/bin/rollup - checksum: a6bb721f2251a2299e99be2eb58b0949571545809b75571c42baa50e749437aa9ef40f0660644d992e2387ba7f0775271ab9388fe4fbb02c6c3fc5db6a8b9711 + checksum: 9c26087d3971a166a51a8941a05bf35ab770879aca59b7d24b6fa0dabf87239fc66cc7f07a69fdc4af346877f22d63db5de848a255a685ca5011e83381a0a989 languageName: node linkType: hard @@ -7137,15 +6948,15 @@ __metadata: "@babel/preset-env": ^7.24.8 "@babel/preset-typescript": ^7.24.7 "@biomejs/biome": 1.8.3 - "@swc/core": ^1.6.13 + "@swc/core": ^1.7.2 "@swc/jest": ^0.2.36 "@types/jest": ^29.5.12 - "@types/node": ^20.14.10 + "@types/node": ^20.14.12 esbuild: ^0.23.0 jest: ^29.7.0 - tsup: ^8.1.0 - typedoc: ^0.26.4 - typescript: ^5.5.3 + tsup: ^8.2.3 + typedoc: ^0.26.5 + typescript: ^5.5.4 languageName: unknown linkType: soft @@ -7448,7 +7259,7 @@ __metadata: languageName: node linkType: hard -"sucrase@npm:^3.20.3": +"sucrase@npm:^3.35.0": version: 3.35.0 resolution: "sucrase@npm:3.35.0" dependencies: @@ -7598,23 +7409,25 @@ __metadata: languageName: node linkType: hard -"tsup@npm:^8.1.0": - version: 8.1.0 - resolution: "tsup@npm:8.1.0" +"tsup@npm:^8.2.3": + version: 8.2.3 + resolution: "tsup@npm:8.2.3" dependencies: - bundle-require: ^4.0.0 - cac: ^6.7.12 - chokidar: ^3.5.1 - debug: ^4.3.1 - esbuild: ^0.21.4 - execa: ^5.0.0 - globby: ^11.0.3 - joycon: ^3.0.1 - postcss-load-config: ^4.0.1 + bundle-require: ^5.0.0 + cac: ^6.7.14 + chokidar: ^3.6.0 + consola: ^3.2.3 + debug: ^4.3.5 + esbuild: ^0.23.0 + execa: ^5.1.1 + globby: ^11.1.0 + joycon: ^3.1.1 + picocolors: ^1.0.1 + postcss-load-config: ^6.0.1 resolve-from: ^5.0.0 - rollup: ^4.0.2 + rollup: ^4.19.0 source-map: 0.8.0-beta.0 - sucrase: ^3.20.3 + sucrase: ^3.35.0 tree-kill: ^1.2.2 peerDependencies: "@microsoft/api-extractor": ^7.36.0 @@ -7633,7 +7446,7 @@ __metadata: bin: tsup: dist/cli-default.js tsup-node: dist/cli-node.js - checksum: 15b759e01313f62edbf6900de547ba2942e15c49b3b699bafe0e544530072a548c0e52799861c2ff7322a1c2454dd013ace55695d5e95e8987e6003f28e9b0c0 + checksum: 432b1a51ae804429c48d52aed9d61c3867d3209bf13928607282a5c8664fe55193e18f76be62bd0908a4978eb894930f9429145b7c482ade3513f3c7a71d0977 languageName: node linkType: hard @@ -7667,9 +7480,9 @@ __metadata: languageName: node linkType: hard -"typedoc@npm:^0.26.4": - version: 0.26.4 - resolution: "typedoc@npm:0.26.4" +"typedoc@npm:^0.26.5": + version: 0.26.5 + resolution: "typedoc@npm:0.26.5" dependencies: lunr: ^2.3.9 markdown-it: ^14.1.0 @@ -7680,27 +7493,27 @@ __metadata: typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x bin: typedoc: bin/typedoc - checksum: 0307b58665b3f3c3335677a802d4a4b46895ab9b3a28e83f5c291186e634235e3f049877e593edf8bfdf0e46ea71736c1ffaef23786b51d71d9d8a0024922152 + checksum: 0587096c2b91536249d3aa9cc5e83a43086e318006ddeadc3c21c424d10a934b6bc19c56fda682d16a75f8133eb2730f54adace79996adeec89188fe331594c3 languageName: node linkType: hard -"typescript@npm:^5.5.3": - version: 5.5.3 - resolution: "typescript@npm:5.5.3" +"typescript@npm:^5.5.4": + version: 5.5.4 + resolution: "typescript@npm:5.5.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 4b4f14313484d5c86064d04ba892544801fa551f5cf72719b540b498056fec7fc192d0bbdb2ba1448e759b1548769956da9e43e7c16781e8d8856787b0575004 + checksum: b309040f3a1cd91c68a5a58af6b9fdd4e849b8c42d837b2c2e73f9a4f96a98c4f1ed398a9aab576ee0a4748f5690cf594e6b99dbe61de7839da748c41e6d6ca8 languageName: node linkType: hard -"typescript@patch:typescript@^5.5.3#~builtin": - version: 5.5.3 - resolution: "typescript@patch:typescript@npm%3A5.5.3#~builtin::version=5.5.3&hash=5da071" +"typescript@patch:typescript@^5.5.4#~builtin": + version: 5.5.4 + resolution: "typescript@patch:typescript@npm%3A5.5.4#~builtin::version=5.5.4&hash=5da071" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 6853be4607706cc1ad2f16047cf1cd72d39f79acd5f9716e1d23bc0e462c7f59be7458fe58a21665e7657a05433d7ab8419d093a5a4bd5f3a33f879b35d2769b + checksum: fc52962f31a5bcb716d4213bef516885e4f01f30cea797a831205fc9ef12b405a40561c40eae3127ab85ba1548e7df49df2bcdee6b84a94bfbe3a0d7eff16b14 languageName: node linkType: hard @@ -7944,13 +7757,6 @@ __metadata: languageName: node linkType: hard -"yaml@npm:^2.3.4": - version: 2.3.4 - resolution: "yaml@npm:2.3.4" - checksum: e6d1dae1c6383bcc8ba11796eef3b8c02d5082911c6723efeeb5ba50fc8e881df18d645e64de68e421b577296000bea9c75d6d9097c2f6699da3ae0406c030d8 - languageName: node - linkType: hard - "yaml@npm:^2.4.5": version: 2.4.5 resolution: "yaml@npm:2.4.5"