diff --git a/.changeset/lovely-owls-hammer.md b/.changeset/lovely-owls-hammer.md new file mode 100644 index 000000000..0ade71cb9 --- /dev/null +++ b/.changeset/lovely-owls-hammer.md @@ -0,0 +1,14 @@ +--- +"@substrate/connect": minor +"@substrate/connect-discovery": minor +"@substrate/connect-extension-protocol": minor +"@substrate/connect-known-chains": minor +"@substrate/discovery": minor +"@substrate/light-client-extension-helpers": minor +"@substrate/smoldot-discovery": minor +"@substrate/smoldot-discovery-connector": minor +"@substrate/extension": minor +"@substrate/wallet-template": minor +--- + +chore: catalog and upgrade papi dependencies diff --git a/examples/light-client-dapp/package.json b/examples/light-client-dapp/package.json index 2b87f84a4..e1e269e79 100644 --- a/examples/light-client-dapp/package.json +++ b/examples/light-client-dapp/package.json @@ -11,17 +11,17 @@ }, "dependencies": { "@picocss/pico": "^2.0.6", - "@polkadot-api/metadata-builders": "~0.5.0", - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/substrate-bindings": "~0.6.3", - "@polkadot-api/substrate-client": "~0.2.1", - "@polkadot-api/utils": "~0.1.1", + "@polkadot-api/metadata-builders": "catalog:polkadot-api", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/substrate-bindings": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", + "@polkadot-api/utils": "catalog:polkadot-api", "@polkadot-labs/hdkd-helpers": "^0.0.8", "@substrate/connect-known-chains": "workspace:^", "@zag-js/react": "^0.48.0", "@zag-js/select": "^0.48.0", "@zag-js/toast": "^0.48.0", - "polkadot-api": "^1.0.0", + "polkadot-api": "catalog:polkadot-api", "react": "^18.3.1", "react-dom": "^18.2.0", "rxjs": "^7.8.1", diff --git a/examples/light-client-extension-helpers-dapp/package.json b/examples/light-client-extension-helpers-dapp/package.json index 91475a0c3..e8098a457 100644 --- a/examples/light-client-extension-helpers-dapp/package.json +++ b/examples/light-client-extension-helpers-dapp/package.json @@ -11,8 +11,8 @@ }, "dependencies": { "@picocss/pico": "^2.0.6", - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/substrate-client": "~0.2.1", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", "@substrate/connect-known-chains": "workspace:*", "@substrate/light-client-extension-helpers": "workspace:*", "react": "^18.3.1", diff --git a/examples/light-client-extension-helpers-extension/package.json b/examples/light-client-extension-helpers-extension/package.json index 83c6d4c7a..bedbb1ec4 100644 --- a/examples/light-client-extension-helpers-extension/package.json +++ b/examples/light-client-extension-helpers-extension/package.json @@ -15,8 +15,8 @@ "playwright:chromium": "playwright test --project=chromium" }, "dependencies": { - "@polkadot-api/substrate-client": "~0.2.1", - "@substrate/light-client-extension-helpers": "workspace:*", + "@polkadot-api/substrate-client": "catalog:polkadot-api", + "@substrate/light-client-extension-helpers": "workspace:^", "smoldot": "2.0.30" }, "devDependencies": { diff --git a/packages/light-client-extension-helpers/package.json b/packages/light-client-extension-helpers/package.json index 276b58d30..3910b8774 100644 --- a/packages/light-client-extension-helpers/package.json +++ b/packages/light-client-extension-helpers/package.json @@ -205,8 +205,8 @@ }, "devDependencies": { "typescript": "catalog:", - "@polkadot-api/json-rpc-provider": "~0.0.3", - "@polkadot-api/polkadot-signer": "~0.1.3", + "@polkadot-api/json-rpc-provider": "catalog:polkadot-api", + "@polkadot-api/polkadot-signer": "catalog:polkadot-api", "@types/chrome": "^0.0.270", "smoldot": "2.0.30", "vitest": "^2.0.5" @@ -225,15 +225,15 @@ } }, "dependencies": { - "@polkadot-api/codegen": "~0.8.0", - "@polkadot-api/json-rpc-provider-proxy": "~0.2.0", - "@polkadot-api/metadata-builders": "~0.5.0", - "@polkadot-api/metadata-compatibility": "~0.1.2", - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/signer": "~0.1.4", - "@polkadot-api/substrate-bindings": "~0.6.3", - "@polkadot-api/substrate-client": "~0.2.1", - "@polkadot-api/utils": "~0.1.1", + "@polkadot-api/codegen": "catalog:polkadot-api", + "@polkadot-api/json-rpc-provider-proxy": "catalog:polkadot-api", + "@polkadot-api/metadata-builders": "catalog:polkadot-api", + "@polkadot-api/metadata-compatibility": "catalog:polkadot-api", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/signer": "catalog:polkadot-api", + "@polkadot-api/substrate-bindings": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", + "@polkadot-api/utils": "catalog:polkadot-api", "@substrate/connect-extension-protocol": "workspace:^", "@substrate/connect-known-chains": "workspace:^", "rxjs": "^7.8.1" diff --git a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/compatibility.ts b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/compatibility.ts index ef4306aa8..4a5feb6c9 100644 --- a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/compatibility.ts +++ b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/compatibility.ts @@ -19,15 +19,24 @@ import { Tuple, Vector } from "@polkadot-api/substrate-bindings" import { Observable, combineLatest, filter, firstValueFrom, map } from "rxjs" import type { ChainDefinition } from "./descriptors.js" +export class RuntimeToken { + private constructor() {} + + // @ts-ignore + protected _runtime(value: D) {} +} + export class CompatibilityToken { private constructor() {} // @ts-ignore - protected _phantom(value: D) {} + protected _compatibility(value: D) {} } -interface CompatibilityTokenApi { +interface RuntimeTokenApi { runtime: () => RuntimeContext +} +interface CompatibilityTokenApi extends RuntimeTokenApi { typedefNodes: TypedefNode[] getPalletEntryPoint: ( opType: OpType, @@ -40,14 +49,18 @@ const compatibilityTokenApi = new WeakMap< CompatibilityToken, CompatibilityTokenApi >() -export const getCompatibilityApi = (token: CompatibilityToken) => - compatibilityTokenApi.get(token)! +const runtimeTokenApi = new WeakMap() +export const getCompatibilityApi = ( + token: RuntimeToken | CompatibilityToken, +): RuntimeTokenApi | CompatibilityTokenApi => + token instanceof RuntimeToken + ? runtimeTokenApi.get(token)! + : compatibilityTokenApi.get(token)! export const enum OpType { Storage = "storage", Tx = "tx", Event = "events", - Error = "errors", Const = "constants", } @@ -91,6 +104,29 @@ export const createCompatibilityToken = ( return promise } +export const createRuntimeToken = ( + chainHead: ReturnType["chainHead$"]>, +): Promise> => { + const awaitedRuntime = new Promise<() => RuntimeContext>(async (resolve) => { + const loadedRuntime$ = chainHead.runtime$.pipe(filter((v) => v != null)) + + let latest = await firstValueFrom(loadedRuntime$) + loadedRuntime$.subscribe((v) => (latest = v)) + + resolve(() => latest) + }) + + const promise = awaitedRuntime.then((runtime) => { + const token = new (RuntimeToken as any)() + runtimeTokenApi.set(token, { + runtime, + }) + return token + }) + + return promise +} + // metadataRaw -> cache const metadataCache = new WeakMap< Uint8Array, @@ -111,7 +147,7 @@ const getMetadataCache = (ctx: RuntimeContext) => { return metadataCache.get(ctx.metadataRaw)! } export const compatibilityHelper = ( - descriptors: Promise, + descriptors: Promise, getDescriptorEntryPoint: (descriptorApi: CompatibilityTokenApi) => EntryPoint, getRuntimeEntryPoint: (ctx: RuntimeContext) => EntryPoint, ) => { @@ -121,7 +157,7 @@ export const compatibilityHelper = ( } function getCompatibilityLevels( - descriptors: CompatibilityToken, + descriptors: CompatibilityToken | RuntimeToken, /** * The `Runtime` of runtimeWithDescriptors already has a RuntimeContext, * which is the runtime of the finalized block. @@ -130,6 +166,12 @@ export const compatibilityHelper = ( */ ctx?: RuntimeContext, ) { + if (descriptors instanceof RuntimeToken) { + return { + args: CompatibilityLevel.Identical, + values: CompatibilityLevel.Identical, + } + } const compatibilityApi = compatibilityTokenApi.get(descriptors)! ctx ||= compatibilityApi.runtime() const descriptorEntryPoint = getDescriptorEntryPoint(compatibilityApi) @@ -164,17 +206,18 @@ export const compatibilityHelper = ( (chainHead: ChainHead$, mapper: (x: T) => string) => ( source$: Observable, - ): Observable<[T, CompatibilityToken, RuntimeContext]> => + ): Observable<[T, CompatibilityToken | RuntimeToken, RuntimeContext]> => combineLatest([ source$.pipe(chainHead.withRuntime(mapper)), waitDescriptors(), ]).pipe(map(([[x, ctx], descriptors]) => [x, descriptors, ctx])) const argsAreCompatible = ( - descriptors: CompatibilityToken, + descriptors: CompatibilityToken | RuntimeToken, ctx: RuntimeContext, args: unknown, ) => { + if (descriptors instanceof RuntimeToken) return true const levels = getCompatibilityLevels(descriptors, ctx) if (levels.args === CompatibilityLevel.Incompatible) return false if (levels.args > CompatibilityLevel.Partial) return true @@ -190,10 +233,11 @@ export const compatibilityHelper = ( ) } const valuesAreCompatible = ( - descriptors: CompatibilityToken, + descriptors: CompatibilityToken | RuntimeToken, ctx: RuntimeContext, values: unknown, ) => { + if (descriptors instanceof RuntimeToken) return true const level = getCompatibilityLevels(descriptors, ctx).values if (level === CompatibilityLevel.Incompatible) return false if (level > CompatibilityLevel.Partial) return true @@ -229,13 +273,16 @@ export const minCompatLevel = (levels: { }) => Math.min(levels.args, levels.values) const withOptionalToken = - ( - compatibilityToken: Promise>, + ( + compatibilityToken: Promise | RuntimeToken>, fn: (...args: A) => T, ): WithOptionalRuntime => (...args: any): any => { const lastElement = args.at(-1) - if (lastElement instanceof CompatibilityToken) { + if ( + lastElement instanceof CompatibilityToken || + lastElement instanceof RuntimeToken + ) { return fn(...args) } return compatibilityToken.then((token) => (fn as any)(...args, token)) @@ -249,7 +296,7 @@ export type WithOptionalRuntime = { /** * Returns the result synchronously with the loaded runtime. */ - (...args: [...A, runtime: CompatibilityToken]): T + (...args: [...A, runtime: CompatibilityToken | RuntimeToken]): T } export interface CompatibilityFunctions { diff --git a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/descriptors.ts b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/descriptors.ts index eb44c52ef..7f96ea7f1 100644 --- a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/descriptors.ts +++ b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/descriptors.ts @@ -34,7 +34,7 @@ export type ApisTypedef< T extends DescriptorEntry>, > = T -export { DescriptorValues } +export type { DescriptorValues } export type ChainDefinition = { descriptors: Promise & { diff --git a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/submit-fns.ts b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/submit-fns.ts index ecfeaf401..a85ccdf79 100644 --- a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/submit-fns.ts +++ b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/submit-fns.ts @@ -58,16 +58,17 @@ const computeState = ( const computeNextState = () => { let current: string = pinnedBlocks.best let analyzed: AnalyzedBlock | undefined = analyzedBlocks.get(current) + let analyzedNumber = pinnedBlocks.blocks.get(current)!.number while (!analyzed) { const block = pinnedBlocks.blocks.get(current) if (!block) break analyzed = analyzedBlocks.get((current = block.parent)) + analyzedNumber-- } if (!analyzed) return // this shouldn't happen, though - const analyzedNumber = pinnedBlocks.blocks.get(analyzed.hash)!.number const isFinalized = analyzedNumber <= pinnedBlocks.blocks.get(pinnedBlocks.finalized)!.number @@ -219,7 +220,10 @@ export const submit$ = ( const at$ = chainHead.pinnedBlocks$.pipe( take(1), - map((blocks) => blocks.blocks.get(at!)?.hash ?? blocks.finalized), + map((blocks) => { + const block = blocks.blocks.get(at!) + return block && !block.unpinned ? block.hash : blocks.finalized + }), ) const validate$: Observable = at$.pipe( diff --git a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/tx.ts b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/tx.ts index 02de2c1fc..23253bdb0 100644 --- a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/tx.ts +++ b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/tx.ts @@ -7,17 +7,15 @@ import { getPolkadotSigner } from "@polkadot-api/signer" import { AccountId, Binary, + type Decoder, Enum, type SS58String, - Tuple, - compact, - u128, u32, - u8, } from "@polkadot-api/substrate-bindings" import { fromHex, mergeUint8, toHex } from "@polkadot-api/utils" import { Observable, + combineLatest, firstValueFrom, map, mergeMap, @@ -29,10 +27,12 @@ import { type CompatibilityHelper, CompatibilityToken, getCompatibilityApi, + RuntimeToken, } from "./compatibility.js" import { createTx } from "./create-tx.js" import { InvalidTxError, submit, submit$ } from "./submit-fns.js" import type { + PaymentInfo, TxCall, TxEntry, TxObservable, @@ -48,8 +48,6 @@ import { export { submit, submit$, InvalidTxError } const accountIdEnc = AccountId().enc -const queryInfoRawDec = Tuple(compact, compact, u8, u128).dec -const queryInfoDec = (input: string): bigint => queryInfoRawDec(input)[3] const fakeSignature = new Uint8Array(64) const getFakeSignature = () => fakeSignature @@ -71,18 +69,25 @@ export const createTxEntry = < argsAreCompatible, getRuntimeTypedef, }: CompatibilityHelper, + checkCompatibility: boolean, ): TxEntry => { const fn = (arg?: Arg): any => { const getCallDataWithContext = ( - runtime: CompatibilityToken, + runtime: CompatibilityToken | RuntimeToken, arg: any, txOptions: Partial<{ asset: any }> = {}, ) => { const ctx = getCompatibilityApi(runtime).runtime() - if (!argsAreCompatible(runtime, ctx, arg)) + const { dynamicBuilder, assetId, lookup } = ctx + let codecs + try { + codecs = dynamicBuilder.buildCall(pallet, name) + } catch { + throw new Error(`Runtime entry Tx(${pallet}.${name}) not found`) + } + if (checkCompatibility && !argsAreCompatible(runtime, ctx, arg)) throw new Error(`Incompatible runtime entry Tx(${pallet}.${name})`) - const { dynamicBuilder, assetId, lookup } = ctx let returnOptions = txOptions if (txOptions.asset) { if ( @@ -100,7 +105,7 @@ export const createTxEntry = < } } - const { location, codec } = dynamicBuilder.buildCall(pallet, name) + const { location, codec } = codecs return { callData: Binary.fromBytes( mergeUint8(new Uint8Array(location), codec.enc(arg)), @@ -115,12 +120,12 @@ export const createTxEntry = < ) const getEncodedData: TxCall = ( - compatibilityToken?: CompatibilityToken, + token?: CompatibilityToken | RuntimeToken, ): any => { - if (!compatibilityToken) + if (!token) return firstValueFrom(getCallData$(arg).pipe(map((x) => x.callData))) - return getCallDataWithContext(compatibilityToken, arg).callData + return getCallDataWithContext(token, arg).callData } const sign$ = ( @@ -176,7 +181,7 @@ export const createTxEntry = < ), ) - const getEstimatedFees = async ( + const getPaymentInfo = async ( from: Uint8Array | SS58String, _options?: any, ) => { @@ -188,14 +193,35 @@ export const createTxEntry = < const encoded = fromHex(await sign(fakeSigner, _options)) const args = toHex(mergeUint8(encoded, u32.enc(encoded.length))) + const decoder$: Observable> = chainHead + .getRuntimeContext$(null) + .pipe( + map( + ({ dynamicBuilder: { buildRuntimeCall } }) => + buildRuntimeCall("TransactionPaymentApi", "query_info").value[1], + ), + ) + + const call$ = chainHead.call$( + null, + "TransactionPaymentApi_query_info", + args, + ) + return firstValueFrom( - chainHead - .call$(null, "TransactionPaymentApi_query_info", args) - .pipe(map(queryInfoDec)), + combineLatest([call$, decoder$]).pipe( + map(([result, decoder]) => decoder(result)), + ), ) } + const getEstimatedFees = async ( + from: Uint8Array | SS58String, + _options?: any, + ) => (await getPaymentInfo(from, _options)).partial_fee + return { + getPaymentInfo, getEstimatedFees, decodedCall: { type: pallet, diff --git a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/types.ts b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/types.ts index 018817cab..c8f7d4e6c 100644 --- a/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/types.ts +++ b/packages/light-client-extension-helpers/src/tx-helper/polkadot-api/tx-helper/types.ts @@ -1,6 +1,7 @@ import { type CompatibilityFunctions, CompatibilityToken, + RuntimeToken, } from "./compatibility.js" import type { SystemEvent } from "@polkadot-api/observable-client" import type { PolkadotSigner } from "@polkadot-api/polkadot-signer" @@ -56,10 +57,16 @@ export type TxEventsPayload = { } & ( | { ok: true + /** + * Dispatch Error found at `System.ExtrinsicFailed` event. + */ dispatchError?: undefined } | { ok: false + /** + * Dispatch Error found at `System.ExtrinsicFailed` event. + */ dispatchError: { type: string value: unknown @@ -71,6 +78,7 @@ export type TxFinalized = { type: "finalized" txHash: HexString } & TxEventsPayload +export type TxFinalizedPayload = { txHash: HexString } & TxEventsPayload export type TxOptions = Partial< void extends Asset @@ -119,7 +127,6 @@ export type TxOptions = Partial< } > -export type TxFinalizedPayload = Omit export type TxPromise = ( from: PolkadotSigner, txOptions?: TxOptions, @@ -147,12 +154,42 @@ export interface TxCall { (compatibilityToken: CompatibilityToken): Binary } +export interface UnsafeTxCall { + /** + * SCALE-encoded callData of the transaction. + * + * @returns Promise resolving in the encoded data. + */ + (): Promise + /** + * SCALE-encoded callData of the transaction. + * + * @param runtimeToken Token from got with `await typedApi.runtimeToken` + * @returns Synchronously returns encoded data. + */ + (runtimeToken: RuntimeToken): Binary +} + export type TxSignFn = ( from: PolkadotSigner, txOptions?: TxOptions, ) => Promise -export type Transaction< +export type PaymentInfo = { + weight: { + ref_time: bigint + proof_size: bigint + } + class: Enum<{ + Normal: undefined + Operational: undefined + Mandatory: undefined + }> + partial_fee: bigint +} + +export type InnerTransaction< + Unsafe, Arg extends {} | undefined, Pallet extends string, Name extends string, @@ -193,7 +230,7 @@ export type Transaction< /** * SCALE-encoded callData of the transaction. */ - getEncodedData: TxCall + getEncodedData: Unsafe extends true ? UnsafeTxCall : TxCall /** * Estimate fees against the latest known `finalizedBlock` * @@ -205,6 +242,19 @@ export type Transaction< from: Uint8Array | SS58String, txOptions?: TxOptions, ) => Promise + /** + * Payment info against the latest known `finalizedBlock` + * + * @param from Public key or address from the potencial sender. + * @param txOptions Optionally pass any number of txOptions. + * @returns PaymentInfo for the given transaction (weight, estimated fees + * and class). + */ + getPaymentInfo: ( + from: Uint8Array | SS58String, + txOptions?: TxOptions, + ) => Promise + /** * PAPI way of expressing an extrinsic with arguments. * It's useful to pass as a parameter to extrinsics that accept calls. @@ -212,21 +262,113 @@ export type Transaction< decodedCall: Enum<{ [P in Pallet]: Enum<{ [N in Name]: Arg }> }> } -export interface TxEntry< +export type Transaction< + Arg extends {} | undefined, + Pallet extends string, + Name extends string, + Asset, +> = InnerTransaction + +export type UnsafeTransaction< + Arg extends {} | undefined, + Pallet extends string, + Name extends string, + Asset, +> = InnerTransaction + +export type InnerTxEntry< + Unsafe, D, Arg extends {} | undefined, Pallet extends string, Name extends string, Asset, -> extends CompatibilityFunctions { - /** - * Synchronously create the transaction object ready to sign, submit, estimate - * fees, etc. - * - * @param args All parameters required by the transaction. - * @returns Transaction object. - */ - ( - ...args: Arg extends undefined ? [] : [data: Arg] - ): Transaction -} +> = Unsafe extends true + ? { + /** + * Synchronously create the transaction object ready to sign, submit, + * estimate fees, etc. + * + * @param args All parameters required by the transaction. + * @returns Transaction object. + */ + ( + ...args: Arg extends undefined ? [] : [data: Arg] + ): UnsafeTransaction + } + : { + /** + * Synchronously create the transaction object ready to sign, submit, + * estimate fees, etc. + * + * @param args All parameters required by the transaction. + * @returns Transaction object. + */ + ( + ...args: Arg extends undefined ? [] : [data: Arg] + ): Transaction + } & CompatibilityFunctions + +export type TxEntry< + D, + Arg extends {} | undefined, + Pallet extends string, + Name extends string, + Asset, +> = InnerTxEntry + +export type UnsafeTxEntry< + D, + Arg extends {} | undefined, + Pallet extends string, + Name extends string, + Asset, +> = InnerTxEntry + +export type TxFromBinary = Unsafe extends true + ? { + /** + * Asynchronously create the transaction object from a binary call data + * ready to sign, submit, estimate fees, etc. + * + * @param callData SCALE-encoded call data. + * @returns Transaction object. + */ + (callData: Binary): Promise> + /** + * Synchronously create the transaction object from a binary call data + * ready to sign, submit, estimate fees, etc. + * + * @param callData SCALE-encoded call data. + * @param runtimeToken Token from got with `await + * typedApi.runtimeToken` + * @returns Transaction object. + */ + ( + callData: Binary, + runtimeToken: RuntimeToken, + ): UnsafeTransaction + } + : { + /** + * Asynchronously create the transaction object from a binary call data + * ready to sign, submit, estimate fees, etc. + * + * @param callData SCALE-encoded call data. + * @returns Transaction object. + */ + (callData: Binary): Promise> + /** + * Synchronously create the transaction object from a binary call data + * ready to sign, submit, estimate fees, etc. + * + * @param callData SCALE-encoded call data. + * @param compatibilityToken Token from got with `await + * typedApi.compatibilityToken` + * @returns Transaction object. + */ + ( + callData: Binary, + compatibilityToken: CompatibilityToken, + ): Transaction + } diff --git a/packages/light-client-extension-helpers/tsconfig.json b/packages/light-client-extension-helpers/tsconfig.json index b440be114..534f15bd9 100644 --- a/packages/light-client-extension-helpers/tsconfig.json +++ b/packages/light-client-extension-helpers/tsconfig.json @@ -1,4 +1,7 @@ { "extends": "../../tsconfig.base", + "compilerOptions": { + "noUncheckedIndexedAccess": false + }, "include": ["src", "tests"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e0d0830bf..b012f9101 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -9,6 +9,46 @@ catalogs: typescript: specifier: 5.6.2 version: 5.6.2 + polkadot-api: + '@polkadot-api/codegen': + specifier: ~0.12.3 + version: 0.12.3 + '@polkadot-api/json-rpc-provider': + specifier: ~0.0.4 + version: 0.0.4 + '@polkadot-api/json-rpc-provider-proxy': + specifier: ~0.2.3 + version: 0.2.3 + '@polkadot-api/metadata-builders': + specifier: ~0.8.1 + version: 0.8.1 + '@polkadot-api/metadata-compatibility': + specifier: ~0.1.8 + version: 0.1.8 + '@polkadot-api/observable-client': + specifier: ~0.5.8 + version: 0.5.8 + '@polkadot-api/polkadot-signer': + specifier: ~0.1.6 + version: 0.1.6 + '@polkadot-api/signer': + specifier: ~0.1.7 + version: 0.1.7 + '@polkadot-api/substrate-bindings': + specifier: ~0.9.1 + version: 0.9.1 + '@polkadot-api/substrate-client': + specifier: ~0.2.2 + version: 0.2.2 + '@polkadot-api/utils': + specifier: ~0.1.2 + version: 0.1.2 + '@polkadot-api/view-builder': + specifier: ~0.3.8 + version: 0.3.8 + polkadot-api: + specifier: ^1.4.1 + version: 1.4.1 overrides: '@substrate/connect': workspace:^ @@ -112,20 +152,20 @@ importers: specifier: ^2.0.6 version: 2.0.6 '@polkadot-api/metadata-builders': - specifier: ~0.5.0 - version: 0.5.0 + specifier: catalog:polkadot-api + version: 0.8.1 '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/substrate-bindings': - specifier: ~0.6.3 - version: 0.6.3 + specifier: catalog:polkadot-api + version: 0.9.1 '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@polkadot-api/utils': - specifier: ~0.1.1 - version: 0.1.1 + specifier: catalog:polkadot-api + version: 0.1.2 '@polkadot-labs/hdkd-helpers': specifier: ^0.0.8 version: 0.0.8 @@ -142,8 +182,8 @@ importers: specifier: ^0.48.0 version: 0.48.0 polkadot-api: - specifier: ^1.0.0 - version: 1.0.0(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(rxjs@7.8.1)(smoldot@2.0.30) + specifier: catalog:polkadot-api + version: 1.4.1(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(rxjs@7.8.1)(smoldot@2.0.30) react: specifier: ^18.3.1 version: 18.3.1 @@ -200,11 +240,11 @@ importers: specifier: ^2.0.6 version: 2.0.6 '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@substrate/connect-known-chains': specifier: workspace:* version: link:../../packages/connect-known-chains @@ -258,10 +298,10 @@ importers: examples/light-client-extension-helpers-extension: dependencies: '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@substrate/light-client-extension-helpers': - specifier: workspace:* + specifier: workspace:^ version: link:../../packages/light-client-extension-helpers smoldot: specifier: 2.0.30 @@ -550,32 +590,32 @@ importers: packages/light-client-extension-helpers: dependencies: '@polkadot-api/codegen': - specifier: ~0.8.0 - version: 0.8.0 + specifier: catalog:polkadot-api + version: 0.12.3 '@polkadot-api/json-rpc-provider-proxy': - specifier: ~0.2.0 - version: 0.2.0 + specifier: catalog:polkadot-api + version: 0.2.3 '@polkadot-api/metadata-builders': - specifier: ~0.5.0 - version: 0.5.0 + specifier: catalog:polkadot-api + version: 0.8.1 '@polkadot-api/metadata-compatibility': - specifier: ~0.1.2 - version: 0.1.2 + specifier: catalog:polkadot-api + version: 0.1.8 '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/signer': - specifier: ~0.1.4 - version: 0.1.4 + specifier: catalog:polkadot-api + version: 0.1.7 '@polkadot-api/substrate-bindings': - specifier: ~0.6.3 - version: 0.6.3 + specifier: catalog:polkadot-api + version: 0.9.1 '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@polkadot-api/utils': - specifier: ~0.1.1 - version: 0.1.1 + specifier: catalog:polkadot-api + version: 0.1.2 '@substrate/connect-extension-protocol': specifier: workspace:^ version: link:../connect-extension-protocol @@ -587,11 +627,11 @@ importers: version: 7.8.1 devDependencies: '@polkadot-api/json-rpc-provider': - specifier: ~0.0.3 - version: 0.0.3 + specifier: catalog:polkadot-api + version: 0.0.4 '@polkadot-api/polkadot-signer': - specifier: ~0.1.3 - version: 0.1.3 + specifier: catalog:polkadot-api + version: 0.1.6 '@types/chrome': specifier: ^0.0.270 version: 0.0.270 @@ -719,14 +759,14 @@ importers: projects/demo: dependencies: '@polkadot-api/json-rpc-provider-proxy': - specifier: ~0.2.0 - version: 0.2.0 + specifier: catalog:polkadot-api + version: 0.2.3 '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@substrate/connect': specifier: workspace:^ version: link:../../packages/connect @@ -756,11 +796,11 @@ importers: projects/extension: dependencies: '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@react-rxjs/core': specifier: ^0.10.7 version: 0.10.7(react@18.3.1)(rxjs@7.8.1) @@ -841,35 +881,35 @@ importers: specifier: ^1.4.0 version: 1.4.0 '@polkadot-api/codegen': - specifier: ~0.8.0 - version: 0.8.0 + specifier: catalog:polkadot-api + version: 0.12.3 '@polkadot-api/json-rpc-provider': - specifier: ~0.0.3 - version: 0.0.3 + specifier: catalog:polkadot-api + version: 0.0.4 '@polkadot-api/metadata-builders': - specifier: ~0.5.0 - version: 0.5.0 + specifier: catalog:polkadot-api + version: 0.8.1 '@polkadot-api/observable-client': - specifier: ~0.5.2 - version: 0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) + specifier: catalog:polkadot-api + version: 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) '@polkadot-api/polkadot-signer': - specifier: ~0.1.3 - version: 0.1.3 + specifier: catalog:polkadot-api + version: 0.1.6 '@polkadot-api/signer': - specifier: ~0.1.4 - version: 0.1.4 + specifier: catalog:polkadot-api + version: 0.1.7 '@polkadot-api/substrate-bindings': - specifier: ~0.6.3 - version: 0.6.3 + specifier: catalog:polkadot-api + version: 0.9.1 '@polkadot-api/substrate-client': - specifier: ~0.2.1 - version: 0.2.1 + specifier: catalog:polkadot-api + version: 0.2.2 '@polkadot-api/utils': - specifier: ~0.1.1 - version: 0.1.1 + specifier: catalog:polkadot-api + version: 0.1.2 '@polkadot-api/view-builder': - specifier: ~0.3.2 - version: 0.3.2 + specifier: catalog:polkadot-api + version: 0.3.8 '@polkadot-labs/hdkd': specifier: ^0.0.6 version: 0.0.6 @@ -2601,92 +2641,74 @@ packages: resolution: {integrity: sha512-UA91GwWPhFExt3IizW6bOeY/pQ0BkuNwKjk9iQW9KqxluGCrg4VenZ0/L+2Y0+ZOtme72EVvg6v0zo3AMQRCeA==} engines: {node: '>=12'} - '@polkadot-api/cli@0.7.4': - resolution: {integrity: sha512-B1rVc4lLCXXQZIjTfJTmbkOKn65RsAzSDhseR1UPY9nsLqlMiWwUpQMuzzlHBzyWHekgzWIUgkjk0VxbjM1zLg==} + '@polkadot-api/cli@0.9.5': + resolution: {integrity: sha512-hRH7WhzWZLDfvLY74mD9hAaIvxwrdM290HpB11WUzeViJK+++M+SPwBmNzm57fyaSEmuHT8zbBShJJBRjoPh5Q==} hasBin: true - '@polkadot-api/codegen@0.8.0': - resolution: {integrity: sha512-njwzK3i69sMNx0gbnb6WqYZBde/qnMBv5nR8299civ44JraifCtqqFGReQ7LPnb4NOArXbbqcwYfUnG5Ih2yZA==} - - '@polkadot-api/json-rpc-provider-proxy@0.2.0': - resolution: {integrity: sha512-0jtKSl2Zw2v5OJFMp30KXhpcKpwAj2FpMtHTMn4FDwcudL2Y1efiAJ9Zoc3Bk70OVWSovUHdU2WTBUVL/efw4Q==} - - '@polkadot-api/json-rpc-provider@0.0.2': - resolution: {integrity: sha512-VWKs5iRDDEvaHwQ1M8eQbhCauPBp4ETFgaRCHmZIz7uPrWSxDCKqofruLZoNVM8QhVk6hjIo2kxm7yXpTqWigw==} + '@polkadot-api/codegen@0.12.3': + resolution: {integrity: sha512-/SiDo/nsse9h+9NZ32GzHbErQRDMKfn7qmxImMl5dFnibcTA6S55RyL1Hq2fz5bC9097uFJDIB0ZPJGxyQXFww==} - '@polkadot-api/json-rpc-provider@0.0.3': - resolution: {integrity: sha512-493nHN9RnLxNPMxQ3oekEFnRomAqWWh3j88FhANoPu5iINBG73l4ccB9QBPVs3JWXq4SwfLVmb6L15ryM69g/g==} + '@polkadot-api/json-rpc-provider-proxy@0.2.3': + resolution: {integrity: sha512-dukH94xmV2MUYNZZFhGhnaE1WIjVOPlNpcuzYQRdKYLj3zZJnkA6PHPNHiHd4N8XaCTjaDF3GcBTi6MZ0wtbhg==} - '@polkadot-api/known-chains@0.4.0': - resolution: {integrity: sha512-TW3pwl+MmdIjCb3xIdAbp9YhVY0ygDWkxAKxF/r5szDWqB3zNXoQpgQUc5NqChv9CDbLD3yCeWNV7fmSCjtzVA==} + '@polkadot-api/json-rpc-provider@0.0.4': + resolution: {integrity: sha512-9cDijLIxzHOBuq6yHqpqjJ9jBmXrctjc1OFqU+tQrS96adQze3mTIH6DTgfb/0LMrqxzxffz1HQGrIlEH00WrA==} - '@polkadot-api/logs-provider@0.0.3': - resolution: {integrity: sha512-va++/efBvcC0LuYrq1HZvtAwoyxyMsvA+ecLqwxo/lMymJFOQXV+bIgbMd7z+nNbUtGplCJVDFR5EK0EhxfKxQ==} + '@polkadot-api/known-chains@0.5.4': + resolution: {integrity: sha512-+yaMuoHRxPgAsf+K1pxrRzO5/d9PM/J6VDdEznGC7xwI5BzrS4EyfYrhbT/Fz/u3ovt0sLPxAySeDf6UHKJqDQ==} - '@polkadot-api/metadata-builders@0.5.0': - resolution: {integrity: sha512-hHAEYziHsaf7GFOyrrSrToBtBekEMYSCc0GTU3iZ7vnGHdT8wv0vdo90iHU2lL4Di1sUZJz6Vc+ZUJACf2aeVg==} + '@polkadot-api/logs-provider@0.0.6': + resolution: {integrity: sha512-4WgHlvy+xee1ADaaVf6+MlK/+jGMtsMgAzvbQOJZnP4PfQuagoTqaeayk8HYKxXGphogLlPbD06tANxcb+nvAg==} - '@polkadot-api/metadata-builders@0.6.0': - resolution: {integrity: sha512-Q+7oinRbGuWDaj1Xl4PYGcQMy/RIhPErHgDbqR2rFSDt1vjhd6l1XMBWq2uKpwHS4ZNWEvy3r6/I1QbDTLIj2w==} + '@polkadot-api/metadata-builders@0.8.1': + resolution: {integrity: sha512-LFBDJHRK1NsorocgZ35YSbQl1YWJUZx810bXODsUjiPktYILuMH5ayE3wFLus6zCYf6lsVonyha7aPg9Iokfug==} - '@polkadot-api/metadata-compatibility@0.1.2': - resolution: {integrity: sha512-oT2rxjmjGV7mnmAGe+FzNFVtT6oZMHJkaX1Gr00bQobKeK3pcO+jEDt7XwWYHcSXOI5psgVJUb6BQxIzlNDTZg==} + '@polkadot-api/metadata-compatibility@0.1.8': + resolution: {integrity: sha512-mmpK67einWIh7I+EaF5/tlTKkLxjDNlFkUEC06NYWM7o4MTT85vKdQ/4KEAH4U6LSyPPdGFzRz416AEdNV6teA==} - '@polkadot-api/observable-client@0.5.1': - resolution: {integrity: sha512-lNm+saHPKHzjCU67esWs2eHHAV5q1r3CY+UL+8v20Gfb0lnQ9UcEqlxCAL9kTw1sujz6fBTlI0WO9R+i1xcg7A==} + '@polkadot-api/observable-client@0.5.8': + resolution: {integrity: sha512-u8pfivjc9xFp8vhDV3or0+iZV53OWvEj0XzZeoMK7T1knidK2gcqgrpPaZMX5dI0ugaJIT0RoIuHSPQURhGUMw==} peerDependencies: - '@polkadot-api/substrate-client': 0.2.1 + '@polkadot-api/substrate-client': 0.2.2 rxjs: '>=7.8.0' - '@polkadot-api/observable-client@0.5.2': - resolution: {integrity: sha512-E1hRi2YkcOAHXpXT4HpzowjZoctrhuM/8rbuDQju+Xin/PbXpnzol5UOMyToXdyZM4vKa4tc89PJB0TkoANLbA==} - peerDependencies: - '@polkadot-api/substrate-client': 0.2.1 - rxjs: '>=7.8.0' - - '@polkadot-api/pjs-signer@0.4.0': - resolution: {integrity: sha512-BSje/Rw5jjZwXgNoQQagE+rzuwcIZB2h3Q+xojyjExLx9iiei1Rvj1oHUGA+LPmIPeXac0guL13Sss4D4cpl+A==} - - '@polkadot-api/polkadot-sdk-compat@2.0.0': - resolution: {integrity: sha512-rxBDZyFLSH5kCe2TSUm3qSenVqoj3kx+djUYH3Cj0H032Lra/VOh4E9WLkGiPhF1fZsROGO2JQS2KFRXZovlkw==} - - '@polkadot-api/polkadot-signer@0.1.3': - resolution: {integrity: sha512-nRBtFUV0rfwZr6n1T9oNIz39tPm+ZinCj6VwsZ9DNGPQKsgLNq3EXqLVXXB7n1hCI44gJ2XTVc5WTt2MDaEPGQ==} + '@polkadot-api/pjs-signer@0.4.4': + resolution: {integrity: sha512-rIMeCB9ZVagVR7NchmnXbhKJSoPAbejredBmqovWFV3uVGGQa0uk5Iv9MiUWS/hVO7RHi8rhxm2CmFy9ZJxQCA==} - '@polkadot-api/polkadot-signer@0.1.4': - resolution: {integrity: sha512-s7YfsE2wtt5J0+x+C4Ey/aRdmsZxp85SXay4614nJeHRndLVrGVMXby/BeZ6JchbyeyYg2+urmtfCvqMDiSS7g==} + '@polkadot-api/polkadot-sdk-compat@2.2.2': + resolution: {integrity: sha512-G4f06uttjtQIEKjXGTl81EjWjPXEwYvA1qJtny9L8O+NwirnbDRkdh5iKiZNtS7exMkv97VRT83SqDkOvdEMxg==} - '@polkadot-api/signer@0.1.3': - resolution: {integrity: sha512-KcLObDYDkOr+JNv1km1ddxUhkNZHlLK8Gzjgc9g9XlZiurx6Ylhho7bbAHFWXGstp67uklUMeqzVRDEh+c6k+A==} + '@polkadot-api/polkadot-signer@0.1.6': + resolution: {integrity: sha512-X7ghAa4r7doETtjAPTb50IpfGtrBmy3BJM5WCfNKa1saK04VFY9w+vDn+hwEcM4p0PcDHt66Ts74hzvHq54d9A==} - '@polkadot-api/signer@0.1.4': - resolution: {integrity: sha512-XfQM/20W/pWxIHLHZbvZHGZEIT+uZceGjprEJ/iEUcFMxDPf8HA7cWfS24GsCEqU9GrjRd/igqZkA6LR+aLoGA==} + '@polkadot-api/signer@0.1.7': + resolution: {integrity: sha512-B+XtUtoI/PUlmtbDQWhvaiTO6OqgwZT1wnqhL+G57oyI81E/O7vkGiVxs38fpxlyL+ZnmGEItnUG5RBtE0ZgcQ==} - '@polkadot-api/sm-provider@0.1.1': - resolution: {integrity: sha512-55eA6cl4iDuEhO49tztDvWmFKRx9tGsNT16FbaoPMY4sEZ3yHWKbPf3Tjm4Set7huNELEVzjbBCnS0AoVkj9FA==} + '@polkadot-api/sm-provider@0.1.3': + resolution: {integrity: sha512-/Sj6fPlUtu7BVEOeIxjflrO28G564fxM3JDjQZcv1V3hrAb22/p6I/toWej0zSZ6mEAXLjCIEWje14b/lyZmkw==} peerDependencies: smoldot: 2.0.30 - '@polkadot-api/smoldot@0.3.1': - resolution: {integrity: sha512-vItdy2GvaiCMW24qaG6zzv+vgaF4z9V1zq2STqukthrL0wep7iTfSYoZyaa2EiVl9LMra02KB0Ug7WyOyMtC6g==} + '@polkadot-api/smoldot@0.3.3': + resolution: {integrity: sha512-9sXrC1lOJskb+SWQdBYoDtGXgC8fR2mPmMUVA7Lwky45903SUo61aAGiWb8Jh7BB6+Tfxhy3gll9fhj2mRiJKA==} - '@polkadot-api/substrate-bindings@0.6.3': - resolution: {integrity: sha512-Z/9B5Rhr478YgFLpo32sr8cY/zUeHj9DZnxX76OTJM+Kiq2rXfyYAONr8vAleJXxP7y1mUDBeII4nS9+uBbFXA==} + '@polkadot-api/substrate-bindings@0.9.1': + resolution: {integrity: sha512-w53luQgfArKypETRHz4y3PSuuLh0pq7hOzqfmTQ5rWgH0R0BgZ+mnMVKphG9XujPskcXpaKzeHxpsB6MsVkeqg==} - '@polkadot-api/substrate-client@0.2.1': - resolution: {integrity: sha512-YyHn0JzqY75PHs6Y/fEMsMYTH6s4QWpGFqR+O14Qu7reo++a0sTl+pHfXDF16CIq4aGlQJ5wJGHtzWpgnW+INA==} + '@polkadot-api/substrate-client@0.2.2': + resolution: {integrity: sha512-gs3cIVqAFcQ6QWQ1lWklv0ExFJ519fnv21+UHcbTLpgMO9Lza2MLqOkwQUKvs4oC7+fA+y5nfPV7GC4IwuBDNA==} - '@polkadot-api/utils@0.1.1': - resolution: {integrity: sha512-ho1ORL5jEO96Zl72r/j1YTyX8wfXRD+XXrS8OR2LWdBR24MZqHO96xMboTcFehWK919iMKWAb9rCPNs2NiFS3Q==} + '@polkadot-api/utils@0.1.2': + resolution: {integrity: sha512-yhs5k2a8N1SBJcz7EthZoazzLQUkZxbf+0271Xzu42C5AEM9K9uFLbsB+ojzHEM72O5X8lPtSwGKNmS7WQyDyg==} - '@polkadot-api/view-builder@0.3.2': - resolution: {integrity: sha512-bK4Mm0ZrDRXcDn+NJOXtT3XI0fGLspfwWvpM1A6aHAmOtoQSR+XjyOL0fPAnwBBtrpA4VIgboLYLJoLOt3tuxA==} + '@polkadot-api/view-builder@0.3.8': + resolution: {integrity: sha512-Ie/yM00RDeYb/2t+lg+mL3AYTD+dAV37oPKC9+1KIqxIj3iRq+6sJmOtU03AfgyXu58lRQWG1+yo9gSVqEeCGw==} '@polkadot-api/wasm-executor@0.1.1': resolution: {integrity: sha512-OuxbAkSRNLtJtsWDzKx7TEYlRXI2ApT9LcEFckaAr6E4aKLQ5TgbDDXWUvwl4A3AnjoUQx7ltYcsb8qR8UpMAg==} - '@polkadot-api/ws-provider@0.2.0': - resolution: {integrity: sha512-R4B+tUR1H9j6AH2p4Dvv5+aV4/DC/TpKOqB1C5ON2Qvlc0TrH7x4HrZLn82Kq7iwUtnxkrU6esze2UgDGoVKPw==} + '@polkadot-api/ws-provider@0.3.1': + resolution: {integrity: sha512-1f0Sgaurk5lN691xvEY/c4NinnxbjvF/D/uSsEUhOKZDIL4RhWhWwE8qCuCQ4PTvBohTXQCfjwaxzKMMbn8cWw==} '@polkadot-labs/hdkd-helpers@0.0.6': resolution: {integrity: sha512-Gbyf1+aQERjOVWmfCEbnuW0VYvv3pFfjBJOISeGmmAiC6tlH9zCUht/STCCEduyA6ShnjSFXELBX2H1A2D72Sw==} @@ -7788,8 +7810,8 @@ packages: resolution: {integrity: sha512-OLS/0XeUAcE8a2fdwemNja+udKgXNnY6yKVIXqAD2zVRx1KvY6Ato/rZ2vdzbxqYwPW0u6SCNC/bAMPNzpzxbw==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - polkadot-api@1.0.0: - resolution: {integrity: sha512-CF8G+q16IA0kHcvjfm4syhccKa8l/WwcBgk1vVbf/yjqh/CX81KNWGJMbOlqWa+xTeh6PPZz0HAPLzBZaZNkxA==} + polkadot-api@1.4.1: + resolution: {integrity: sha512-fG3r/bqFETZPc4/fBpHO6zhD3ksWcfdHfw/MfX7yW39SaP0RVEltStIShO8I4jvvAvOh3kZEts28xTBbRvFSBg==} hasBin: true peerDependencies: rxjs: '>=7.8.0' @@ -8927,10 +8949,6 @@ packages: resolution: {integrity: sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==} engines: {node: '>=14.16'} - type-fest@4.20.0: - resolution: {integrity: sha512-MBh+PHUHHisjXf4tlx0CFWoMdjx8zCMLJHOjnV1prABYZFHqtFOyauCIK2/7w4oIfwkF8iNhLtnJEfVY2vn3iw==} - engines: {node: '>=16'} - type-fest@4.24.0: resolution: {integrity: sha512-spAaHzc6qre0TlZQQ2aA/nGMe+2Z/wyGk5Z+Ru2VUfdNwT6kWO6TjevOlpebsATEG1EIQ2sOiDszud3lO5mt/Q==} engines: {node: '>=16'} @@ -11139,24 +11157,22 @@ snapshots: '@pnpm/network.ca-file': 1.0.2 config-chain: 1.1.13 - '@polkadot-api/cli@0.7.4(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(smoldot@2.0.30)': + '@polkadot-api/cli@0.9.5(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(smoldot@2.0.30)': dependencies: '@commander-js/extra-typings': 12.1.0(commander@12.1.0) - '@polkadot-api/codegen': 0.8.0 - '@polkadot-api/json-rpc-provider': 0.0.3 - '@polkadot-api/json-rpc-provider-proxy': 0.2.0 - '@polkadot-api/known-chains': 0.4.0 - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/metadata-compatibility': 0.1.2 - '@polkadot-api/observable-client': 0.5.1(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) - '@polkadot-api/polkadot-sdk-compat': 2.0.0 - '@polkadot-api/sm-provider': 0.1.1(smoldot@2.0.30) - '@polkadot-api/smoldot': 0.3.1 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/substrate-client': 0.2.1 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/codegen': 0.12.3 + '@polkadot-api/json-rpc-provider': 0.0.4 + '@polkadot-api/known-chains': 0.5.4 + '@polkadot-api/metadata-compatibility': 0.1.8 + '@polkadot-api/observable-client': 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) + '@polkadot-api/polkadot-sdk-compat': 2.2.2 + '@polkadot-api/sm-provider': 0.1.3(smoldot@2.0.30) + '@polkadot-api/smoldot': 0.3.3 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/substrate-client': 0.2.2 + '@polkadot-api/utils': 0.1.2 '@polkadot-api/wasm-executor': 0.1.1 - '@polkadot-api/ws-provider': 0.2.0 + '@polkadot-api/ws-provider': 0.3.1 '@types/node': 22.3.0 commander: 12.1.0 execa: 9.3.1 @@ -11164,12 +11180,10 @@ snapshots: ora: 8.0.1 read-pkg: 9.0.1 rxjs: 7.8.1 - scale-ts: 1.6.0 tsc-prog: 2.3.0(typescript@5.6.2) tsup: 8.2.4(@swc/core@1.5.27(@swc/helpers@0.5.11))(jiti@1.21.6)(postcss@8.4.44)(typescript@5.6.2)(yaml@2.5.1) typescript: 5.6.2 write-package: 7.1.0 - ws: 8.18.0 transitivePeerDependencies: - '@microsoft/api-extractor' - '@swc/core' @@ -11182,96 +11196,67 @@ snapshots: - utf-8-validate - yaml - '@polkadot-api/codegen@0.8.0': + '@polkadot-api/codegen@0.12.3': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/metadata-compatibility': 0.1.2 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/metadata-compatibility': 0.1.8 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/utils': 0.1.2 - '@polkadot-api/json-rpc-provider-proxy@0.2.0': {} + '@polkadot-api/json-rpc-provider-proxy@0.2.3': {} - '@polkadot-api/json-rpc-provider@0.0.2': {} + '@polkadot-api/json-rpc-provider@0.0.4': {} - '@polkadot-api/json-rpc-provider@0.0.3': {} + '@polkadot-api/known-chains@0.5.4': {} - '@polkadot-api/known-chains@0.4.0': {} - - '@polkadot-api/logs-provider@0.0.3': - dependencies: - '@polkadot-api/json-rpc-provider': 0.0.2 - - '@polkadot-api/metadata-builders@0.5.0': + '@polkadot-api/logs-provider@0.0.6': dependencies: - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/json-rpc-provider': 0.0.4 - '@polkadot-api/metadata-builders@0.6.0': + '@polkadot-api/metadata-builders@0.8.1': dependencies: - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/utils': 0.1.2 - '@polkadot-api/metadata-compatibility@0.1.2': + '@polkadot-api/metadata-compatibility@0.1.8': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/substrate-bindings': 0.9.1 - '@polkadot-api/observable-client@0.5.1(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1)': + '@polkadot-api/observable-client@0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1)': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/metadata-compatibility': 0.1.2 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/substrate-client': 0.2.1 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/substrate-client': 0.2.2 + '@polkadot-api/utils': 0.1.2 rxjs: 7.8.1 - '@polkadot-api/observable-client@0.5.2(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1)': + '@polkadot-api/pjs-signer@0.4.4': dependencies: - '@polkadot-api/metadata-builders': 0.6.0 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/substrate-client': 0.2.1 - '@polkadot-api/utils': 0.1.1 - rxjs: 7.8.1 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/polkadot-signer': 0.1.6 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/utils': 0.1.2 - '@polkadot-api/pjs-signer@0.4.0': + '@polkadot-api/polkadot-sdk-compat@2.2.2': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/polkadot-signer': 0.1.3 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/json-rpc-provider': 0.0.4 - '@polkadot-api/polkadot-sdk-compat@2.0.0': - dependencies: - '@polkadot-api/json-rpc-provider': 0.0.3 + '@polkadot-api/polkadot-signer@0.1.6': {} - '@polkadot-api/polkadot-signer@0.1.3': + '@polkadot-api/signer@0.1.7': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/polkadot-signer': 0.1.6 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/utils': 0.1.2 - '@polkadot-api/polkadot-signer@0.1.4': {} - - '@polkadot-api/signer@0.1.3': - dependencies: - '@polkadot-api/polkadot-signer': 0.1.3 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 - - '@polkadot-api/signer@0.1.4': + '@polkadot-api/sm-provider@0.1.3(smoldot@2.0.30)': dependencies: - '@polkadot-api/polkadot-signer': 0.1.4 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 - - '@polkadot-api/sm-provider@0.1.1(smoldot@2.0.30)': - dependencies: - '@polkadot-api/json-rpc-provider': 0.0.2 - '@polkadot-api/json-rpc-provider-proxy': 0.2.0 + '@polkadot-api/json-rpc-provider': 0.0.4 + '@polkadot-api/json-rpc-provider-proxy': 0.2.3 smoldot: 2.0.30 - '@polkadot-api/smoldot@0.3.1': + '@polkadot-api/smoldot@0.3.3': dependencies: '@types/node': 22.3.0 smoldot: 2.0.30 @@ -11279,32 +11264,32 @@ snapshots: - bufferutil - utf-8-validate - '@polkadot-api/substrate-bindings@0.6.3': + '@polkadot-api/substrate-bindings@0.9.1': dependencies: - '@noble/hashes': 1.4.0 - '@polkadot-api/utils': 0.1.1 - '@scure/base': 1.1.7 + '@noble/hashes': 1.5.0 + '@polkadot-api/utils': 0.1.2 + '@scure/base': 1.1.9 scale-ts: 1.6.0 - '@polkadot-api/substrate-client@0.2.1': + '@polkadot-api/substrate-client@0.2.2': dependencies: - '@polkadot-api/json-rpc-provider': 0.0.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/json-rpc-provider': 0.0.4 + '@polkadot-api/utils': 0.1.2 - '@polkadot-api/utils@0.1.1': {} + '@polkadot-api/utils@0.1.2': {} - '@polkadot-api/view-builder@0.3.2': + '@polkadot-api/view-builder@0.3.8': dependencies: - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/utils': 0.1.1 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/utils': 0.1.2 '@polkadot-api/wasm-executor@0.1.1': {} - '@polkadot-api/ws-provider@0.2.0': + '@polkadot-api/ws-provider@0.3.1': dependencies: - '@polkadot-api/json-rpc-provider': 0.0.3 - '@polkadot-api/json-rpc-provider-proxy': 0.2.0 + '@polkadot-api/json-rpc-provider': 0.0.4 + '@polkadot-api/json-rpc-provider-proxy': 0.2.3 ws: 8.18.0 transitivePeerDependencies: - bufferutil @@ -17264,7 +17249,7 @@ snapshots: dependencies: '@babel/code-frame': 7.24.7 index-to-position: 0.1.2 - type-fest: 4.20.0 + type-fest: 4.24.0 parse-ms@4.0.0: {} @@ -17377,25 +17362,25 @@ snapshots: polite-json@5.0.0: {} - polkadot-api@1.0.0(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(rxjs@7.8.1)(smoldot@2.0.30): - dependencies: - '@polkadot-api/cli': 0.7.4(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(smoldot@2.0.30) - '@polkadot-api/json-rpc-provider': 0.0.3 - '@polkadot-api/known-chains': 0.4.0 - '@polkadot-api/logs-provider': 0.0.3 - '@polkadot-api/metadata-builders': 0.5.0 - '@polkadot-api/metadata-compatibility': 0.1.2 - '@polkadot-api/observable-client': 0.5.1(@polkadot-api/substrate-client@0.2.1)(rxjs@7.8.1) - '@polkadot-api/pjs-signer': 0.4.0 - '@polkadot-api/polkadot-sdk-compat': 2.0.0 - '@polkadot-api/polkadot-signer': 0.1.3 - '@polkadot-api/signer': 0.1.3 - '@polkadot-api/sm-provider': 0.1.1(smoldot@2.0.30) - '@polkadot-api/smoldot': 0.3.1 - '@polkadot-api/substrate-bindings': 0.6.3 - '@polkadot-api/substrate-client': 0.2.1 - '@polkadot-api/utils': 0.1.1 - '@polkadot-api/ws-provider': 0.2.0 + polkadot-api@1.4.1(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(rxjs@7.8.1)(smoldot@2.0.30): + dependencies: + '@polkadot-api/cli': 0.9.5(@swc/core@1.5.27(@swc/helpers@0.5.11))(postcss@8.4.44)(smoldot@2.0.30) + '@polkadot-api/json-rpc-provider': 0.0.4 + '@polkadot-api/known-chains': 0.5.4 + '@polkadot-api/logs-provider': 0.0.6 + '@polkadot-api/metadata-builders': 0.8.1 + '@polkadot-api/metadata-compatibility': 0.1.8 + '@polkadot-api/observable-client': 0.5.8(@polkadot-api/substrate-client@0.2.2)(rxjs@7.8.1) + '@polkadot-api/pjs-signer': 0.4.4 + '@polkadot-api/polkadot-sdk-compat': 2.2.2 + '@polkadot-api/polkadot-signer': 0.1.6 + '@polkadot-api/signer': 0.1.7 + '@polkadot-api/sm-provider': 0.1.3(smoldot@2.0.30) + '@polkadot-api/smoldot': 0.3.3 + '@polkadot-api/substrate-bindings': 0.9.1 + '@polkadot-api/substrate-client': 0.2.2 + '@polkadot-api/utils': 0.1.2 + '@polkadot-api/ws-provider': 0.3.1 rxjs: 7.8.1 transitivePeerDependencies: - '@microsoft/api-extractor' @@ -17758,7 +17743,7 @@ snapshots: '@types/normalize-package-data': 2.4.4 normalize-package-data: 6.0.1 parse-json: 8.1.0 - type-fest: 4.20.0 + type-fest: 4.24.0 unicorn-magic: 0.1.0 read-yaml-file@1.1.0: @@ -18614,8 +18599,6 @@ snapshots: type-fest@3.13.1: {} - type-fest@4.20.0: {} - type-fest@4.24.0: {} typed-array-buffer@1.0.2: diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index af53b999f..0adddeffd 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -6,3 +6,19 @@ packages: catalog: typescript: "5.6.2" + +catalogs: + polkadot-api: + "polkadot-api": "^1.4.1" + "@polkadot-api/codegen": "~0.12.3" + "@polkadot-api/metadata-builders": "~0.8.1" + "@polkadot-api/observable-client": "~0.5.8" + "@polkadot-api/substrate-bindings": "~0.9.1" + "@polkadot-api/substrate-client": "~0.2.2" + "@polkadot-api/json-rpc-provider": "~0.0.4" + "@polkadot-api/polkadot-signer": "~0.1.6" + "@polkadot-api/utils": "~0.1.2" + "@polkadot-api/json-rpc-provider-proxy": "~0.2.3" + "@polkadot-api/metadata-compatibility": "~0.1.8" + "@polkadot-api/signer": "~0.1.7" + "@polkadot-api/view-builder": "~0.3.8" diff --git a/projects/demo/package.json b/projects/demo/package.json index a7229df84..a3598f42c 100644 --- a/projects/demo/package.json +++ b/projects/demo/package.json @@ -19,9 +19,9 @@ "lint": "eslint . --ext .ts,.tsx" }, "dependencies": { - "@polkadot-api/json-rpc-provider-proxy": "~0.2.0", - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/substrate-client": "~0.2.1", + "@polkadot-api/json-rpc-provider-proxy": "catalog:polkadot-api", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", "@substrate/connect": "workspace:*", "@substrate/connect-known-chains": "workspace:*", "rxjs": "^7.8.1" diff --git a/projects/extension/package.json b/projects/extension/package.json index 9d17bf6ec..7717ec3dc 100644 --- a/projects/extension/package.json +++ b/projects/extension/package.json @@ -49,8 +49,8 @@ "web-ext": "^8.2.0" }, "dependencies": { - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/substrate-client": "~0.2.1", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", "@react-rxjs/core": "^0.10.7", "@react-rxjs/utils": "^0.9.7", "@substrate/connect-extension-protocol": "workspace:*", diff --git a/projects/wallet-template/package.json b/projects/wallet-template/package.json index 30a382198..006560045 100644 --- a/projects/wallet-template/package.json +++ b/projects/wallet-template/package.json @@ -57,16 +57,16 @@ "@hookform/resolvers": "^3.9.0", "@noble/ciphers": "^1.0.0", "@noble/hashes": "^1.4.0", - "@polkadot-api/codegen": "~0.8.0", - "@polkadot-api/json-rpc-provider": "~0.0.3", - "@polkadot-api/metadata-builders": "~0.5.0", - "@polkadot-api/observable-client": "~0.5.2", - "@polkadot-api/polkadot-signer": "~0.1.3", - "@polkadot-api/signer": "~0.1.4", - "@polkadot-api/substrate-bindings": "~0.6.3", - "@polkadot-api/substrate-client": "~0.2.1", - "@polkadot-api/utils": "~0.1.1", - "@polkadot-api/view-builder": "~0.3.2", + "@polkadot-api/codegen": "catalog:polkadot-api", + "@polkadot-api/json-rpc-provider": "catalog:polkadot-api", + "@polkadot-api/metadata-builders": "catalog:polkadot-api", + "@polkadot-api/observable-client": "catalog:polkadot-api", + "@polkadot-api/polkadot-signer": "catalog:polkadot-api", + "@polkadot-api/signer": "catalog:polkadot-api", + "@polkadot-api/substrate-bindings": "catalog:polkadot-api", + "@polkadot-api/substrate-client": "catalog:polkadot-api", + "@polkadot-api/utils": "catalog:polkadot-api", + "@polkadot-api/view-builder": "catalog:polkadot-api", "@polkadot-labs/hdkd": "^0.0.6", "@polkadot-labs/hdkd-helpers": "^0.0.8", "@polkadot-labs/schnorrkel-wasm": "^0.0.5",