diff --git a/.gitignore b/.gitignore index 41de8882..baa1e066 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ node_modules -.yarn +.yarn/* +!.yarn/patches .nx/cache .nx/workspace-data .DS_Store diff --git a/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch b/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch new file mode 100644 index 00000000..ceb3bdc7 --- /dev/null +++ b/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch @@ -0,0 +1,98 @@ +diff --git a/dist/index.d.mts b/dist/index.d.mts +index e0f9bb0c3068ca6fa0672be77d03173eb429eb7f..a1b5f19a70513e724bfc3d9f9c80bce4f87342ab 100644 +--- a/dist/index.d.mts ++++ b/dist/index.d.mts +@@ -129,7 +129,7 @@ declare const compatibilityHelper: (runtimeApi: RuntimeApi, getDescriptorChecksu + }; + type CompatibilityHelper = ReturnType; + +-interface ConstantEntry { ++export interface ConstantEntry { + /** + * Constants are simple key-value structures found in the runtime metadata. + * +@@ -215,7 +215,7 @@ type CallOptions$1 = Partial<{ + signal: AbortSignal; + }>; + type WithCallOptions$1> = Args["length"] extends 0 ? [options?: CallOptions$1] : [...args: Args, options?: CallOptions$1]; +-interface RuntimeCall, Payload> { ++export interface RuntimeCall, Payload> { + /** + * Get `Payload` (Promise-based) for the runtime call. + * +@@ -248,7 +248,7 @@ type WithCallOptions> = [ + options?: CallOptions + ]; + type PossibleParents> = A extends [...infer Left, any] ? Left | PossibleParents : []; +-type StorageEntryWithoutKeys = { ++export type StorageEntryWithoutKeys = { + /** + * `isCompatible` enables you to check whether or not the call you're trying + * to make is compatible with the descriptors you generated on dev time. +@@ -269,7 +269,7 @@ type StorageEntryWithoutKeys = { + */ + watchValue: (bestOrFinalized?: "best" | "finalized") => Observable; + }; +-type StorageEntryWithKeys, Payload> = { ++export type StorageEntryWithKeys, Payload> = { + /** + * `isCompatible` enables you to check whether or not the call you're trying + * to make is compatible with the descriptors you generated on dev time. +@@ -321,7 +321,7 @@ type StorageEntryWithKeys, Payload> = { + value: NonNullable; + }>>; + }; +-type StorageEntry, Payload> = Args extends [] ? StorageEntryWithoutKeys : StorageEntryWithKeys; ++export type StorageEntry, Payload> = Args extends [] ? StorageEntryWithoutKeys : StorageEntryWithKeys; + + type TxEvent = TxSigned | TxBroadcasted | TxBestBlocksState | TxFinalized; + type TxBroadcastEvent = TxSigned | TxBroadcasted | TxBestBlocksState | TxFinalized; +diff --git a/dist/index.d.ts b/dist/index.d.ts +index e0f9bb0c3068ca6fa0672be77d03173eb429eb7f..a1b5f19a70513e724bfc3d9f9c80bce4f87342ab 100644 +--- a/dist/index.d.ts ++++ b/dist/index.d.ts +@@ -129,7 +129,7 @@ declare const compatibilityHelper: (runtimeApi: RuntimeApi, getDescriptorChecksu + }; + type CompatibilityHelper = ReturnType; + +-interface ConstantEntry { ++export interface ConstantEntry { + /** + * Constants are simple key-value structures found in the runtime metadata. + * +@@ -215,7 +215,7 @@ type CallOptions$1 = Partial<{ + signal: AbortSignal; + }>; + type WithCallOptions$1> = Args["length"] extends 0 ? [options?: CallOptions$1] : [...args: Args, options?: CallOptions$1]; +-interface RuntimeCall, Payload> { ++export interface RuntimeCall, Payload> { + /** + * Get `Payload` (Promise-based) for the runtime call. + * +@@ -248,7 +248,7 @@ type WithCallOptions> = [ + options?: CallOptions + ]; + type PossibleParents> = A extends [...infer Left, any] ? Left | PossibleParents : []; +-type StorageEntryWithoutKeys = { ++export type StorageEntryWithoutKeys = { + /** + * `isCompatible` enables you to check whether or not the call you're trying + * to make is compatible with the descriptors you generated on dev time. +@@ -269,7 +269,7 @@ type StorageEntryWithoutKeys = { + */ + watchValue: (bestOrFinalized?: "best" | "finalized") => Observable; + }; +-type StorageEntryWithKeys, Payload> = { ++export type StorageEntryWithKeys, Payload> = { + /** + * `isCompatible` enables you to check whether or not the call you're trying + * to make is compatible with the descriptors you generated on dev time. +@@ -321,7 +321,7 @@ type StorageEntryWithKeys, Payload> = { + value: NonNullable; + }>>; + }; +-type StorageEntry, Payload> = Args extends [] ? StorageEntryWithoutKeys : StorageEntryWithKeys; ++export type StorageEntry, Payload> = Args extends [] ? StorageEntryWithoutKeys : StorageEntryWithKeys; + + type TxEvent = TxSigned | TxBroadcasted | TxBestBlocksState | TxFinalized; + type TxBroadcastEvent = TxSigned | TxBroadcasted | TxBestBlocksState | TxFinalized; diff --git a/apps/example/package.json b/apps/example/package.json index f30976e8..0c5cbb3a 100644 --- a/apps/example/package.json +++ b/apps/example/package.json @@ -13,7 +13,7 @@ "dependencies": { "@reactive-dot/react": "workspace:^", "date-fns": "^3.6.0", - "polkadot-api": "^0.8.0", + "polkadot-api": "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/packages/core/package.json b/packages/core/package.json index 59f1156c..82bb30c8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -27,7 +27,7 @@ "@tsconfig/recommended": "^1.0.6", "@tsconfig/strictest": "^2.0.5", "eslint": "^9.4.0", - "polkadot-api": "^0.8.0", + "polkadot-api": "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch", "typescript": "^5.4.5" }, "peerDependencies": { diff --git a/packages/react/package.json b/packages/react/package.json index 9e459556..14be3227 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -26,7 +26,7 @@ "@tsconfig/strictest": "^2.0.5", "@types/react": "^18.3.3", "eslint": "^9.4.0", - "polkadot-api": "^0.8.0", + "polkadot-api": "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch", "react": "^18.3.1", "typescript": "^5.4.5" } diff --git a/packages/types/package.json b/packages/types/package.json index 2888be3f..983e8a51 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -21,7 +21,7 @@ "@tsconfig/recommended": "^1.0.6", "@tsconfig/strictest": "^2.0.5", "eslint": "^9.4.0", - "polkadot-api": "^0.8.0", + "polkadot-api": "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch", "typescript": "^5.4.5" } } diff --git a/yarn.lock b/yarn.lock index b3671d51..4b9534ed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3351,7 +3351,7 @@ __metadata: "@tsconfig/recommended": "npm:^1.0.6" "@tsconfig/strictest": "npm:^2.0.5" eslint: "npm:^9.4.0" - polkadot-api: "npm:^0.8.0" + polkadot-api: "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch" typescript: "npm:^5.4.5" peerDependencies: polkadot-api: ^0.8.0 @@ -3408,7 +3408,7 @@ __metadata: "@vitejs/plugin-react": "npm:^4.2.1" date-fns: "npm:^3.6.0" eslint: "npm:^9.4.0" - polkadot-api: "npm:^0.8.0" + polkadot-api: "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch" react: "npm:^18.3.1" react-dom: "npm:^18.3.1" typescript: "npm:^5.4.5" @@ -3428,7 +3428,7 @@ __metadata: eslint: "npm:^9.4.0" jotai: "npm:^2.8.3" jotai-scope: "npm:^0.6.0" - polkadot-api: "npm:^0.8.0" + polkadot-api: "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch" react: "npm:^18.3.1" typescript: "npm:^5.4.5" languageName: unknown @@ -3442,7 +3442,7 @@ __metadata: "@tsconfig/recommended": "npm:^1.0.6" "@tsconfig/strictest": "npm:^2.0.5" eslint: "npm:^9.4.0" - polkadot-api: "npm:^0.8.0" + polkadot-api: "patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch" typescript: "npm:^5.4.5" languageName: unknown linkType: soft @@ -12000,7 +12000,7 @@ __metadata: languageName: node linkType: hard -"polkadot-api@npm:^0.8.0": +"polkadot-api@npm:0.8.0": version: 0.8.0 resolution: "polkadot-api@npm:0.8.0" dependencies: @@ -12028,6 +12028,34 @@ __metadata: languageName: node linkType: hard +"polkadot-api@patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch": + version: 0.8.0 + resolution: "polkadot-api@patch:polkadot-api@npm%3A0.8.0#~/.yarn/patches/polkadot-api-npm-0.8.0-ef17b11e20.patch::version=0.8.0&hash=a53a35" + dependencies: + "@polkadot-api/cli": "npm:0.5.0" + "@polkadot-api/json-rpc-provider": "npm:0.0.1" + "@polkadot-api/known-chains": "npm:0.1.5" + "@polkadot-api/logs-provider": "npm:0.0.2" + "@polkadot-api/metadata-builders": "npm:0.3.0" + "@polkadot-api/observable-client": "npm:0.3.0" + "@polkadot-api/pjs-signer": "npm:0.2.0" + "@polkadot-api/polkadot-signer": "npm:0.0.1" + "@polkadot-api/signer": "npm:0.0.1" + "@polkadot-api/sm-provider": "npm:0.1.0" + "@polkadot-api/smoldot": "npm:0.2.4" + "@polkadot-api/substrate-bindings": "npm:0.5.0" + "@polkadot-api/substrate-client": "npm:0.1.2" + "@polkadot-api/utils": "npm:0.1.0" + "@polkadot-api/ws-provider": "npm:0.1.0" + peerDependencies: + rxjs: ">=7.8.0" + bin: + papi: bin/cli.mjs + polkadot-api: bin/cli.mjs + checksum: 10c0/a322bbffbdb4a7cc23edc7138b638ef0b53aa1e98d1a821981a00ed1cdb2e0faf1b1d3c7f4e28b0ee035e27d0fd87f4cfb5d22bb038ae5fa1eb35b394d6f736a + languageName: node + linkType: hard + "possible-typed-array-names@npm:^1.0.0": version: 1.0.0 resolution: "possible-typed-array-names@npm:1.0.0"