@webb-tools/tangle-substrate-types 0.5.4 → 0.5.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/build/interfaces/augment-api-consts.d.ts +147 -4
  2. package/build/interfaces/augment-api-errors.d.ts +403 -0
  3. package/build/interfaces/augment-api-events.d.ts +543 -2
  4. package/build/interfaces/augment-api-query.d.ts +159 -2
  5. package/build/interfaces/augment-api-tx.d.ts +745 -1
  6. package/build/interfaces/augment-types.d.ts +21 -2
  7. package/build/interfaces/lookup.d.ts +1470 -356
  8. package/build/interfaces/lookup.js +1464 -350
  9. package/build/interfaces/registry.d.ts +61 -1
  10. package/build/interfaces/types-lookup.d.ts +1592 -348
  11. package/build/metadata/static-latest.d.ts +1 -1
  12. package/build/metadata/static-latest.js +1 -1
  13. package/build/package.json +1 -1
  14. package/package.json +4 -4
  15. package/playground.ts +86 -0
  16. package/src/interfaces/augment-api-consts.ts +147 -11
  17. package/src/interfaces/augment-api-errors.ts +403 -0
  18. package/src/interfaces/augment-api-events.ts +321 -30
  19. package/src/interfaces/augment-api-query.ts +150 -87
  20. package/src/interfaces/augment-api-tx.ts +361 -54
  21. package/src/interfaces/augment-types.ts +21 -2
  22. package/src/interfaces/lookup.ts +1465 -351
  23. package/src/interfaces/registry.ts +61 -1
  24. package/src/interfaces/types-lookup.ts +1650 -348
  25. package/src/metadata/metadata.json +1 -1
  26. package/src/metadata/static-latest.ts +1 -1
  27. package/ts-types/playground.d.ts +1 -0
  28. package/ts-types/src/interfaces/augment-api-consts.d.ts +147 -4
  29. package/ts-types/src/interfaces/augment-api-errors.d.ts +403 -0
  30. package/ts-types/src/interfaces/augment-api-events.d.ts +543 -2
  31. package/ts-types/src/interfaces/augment-api-query.d.ts +159 -2
  32. package/ts-types/src/interfaces/augment-api-tx.d.ts +745 -1
  33. package/ts-types/src/interfaces/augment-types.d.ts +21 -2
  34. package/ts-types/src/interfaces/lookup.d.ts +1470 -356
  35. package/ts-types/src/interfaces/registry.d.ts +61 -1
  36. package/ts-types/src/interfaces/types-lookup.d.ts +1592 -348
  37. package/ts-types/src/metadata/static-latest.d.ts +1 -1
  38. package/ts-types/tsconfig.tsbuildinfo +1 -1
@@ -1 +1 @@
1
- {"name":"@webb-tools/tangle-substrate-types","version":"0.5.4","description":"Polkadot.js type definitions required for interacting with Webb's tangle network","main":"./index.js","types":"./index.d.ts","typings":"./index.d.ts","author":"Webb Developers <drew@webb.tools>","license":"Apache-2.0","type":"commonjs","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"repository":"https://github.com/webb-tools/tangle.git","bugs":{"url":"https://github.com/webb-tools/tangle/issues"},"homepage":"https://github.com/webb-tools/tangle","dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/plugin-proposal-numeric-separator":"^7.18.6","@babel/plugin-proposal-optional-chaining":"^7.20.7","@babel/plugin-syntax-bigint":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.23.3","@babel/plugin-syntax-import-meta":"^7.10.4","@babel/plugin-syntax-top-level-await":"^7.14.5","@babel/plugin-transform-regenerator":"^7.23.3","@babel/plugin-transform-runtime":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-react":"^7.23.3","@babel/preset-typescript":"^7.23.3","@babel/register":"^7.23.7","@babel/runtime":"^7.24.0","@open-web3/orml-types":"^2.0.1","@polkadot/api-derive":"10.12.2","@polkadot/dev":"^0.78.11","@polkadot/typegen":"10.12.2","@polkadot/types":"10.12.2","babel-jest":"^29.7.0","babel-plugin-module-extension-resolver":"^1.0.0","babel-plugin-module-resolver":"^5.0.0","babel-plugin-styled-components":"^2.1.4","ecpair":"^2.1.0","elliptic":"^6.5.5","fs-extra":"^11.2.0","glob2base":"^0.0.12","minimatch":"^9.0.3","mkdirp":"^3.0.1","tiny-secp256k1":"^2.2.3"},"devDependencies":{"@types/websocket":"^1.0.10","rimraf":"5.0.5","ts-node":"10.9.2","tsconfig-paths":"^4.2.0","typescript":"5.4.2","websocket":"^1.0.34"},"scripts":{"build":"node ./scripts/build.js","build:interfaces":"yarn build:interfaces:defs && yarn build:interfaces:chain && rm ./src/interfaces/index.ts && rm ./src/interfaces/types.ts","build:interfaces:defs":"npx ts-node node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --package @webb-tools/tangle-substrate-types --endpoint ./src/metadata/metadata.json","build:interfaces:chain":"npx ts-node node_modules/.bin/polkadot-types-from-chain --endpoint ./src/metadata/metadata.json --output ./src/interfaces","clean":"rm -rf build && rm -rf ts-types","publish-types":"node ./scripts/publish-types.js","update:metadata":"npx ts-node ./scripts/updateMetadata.ts"}}
1
+ {"name":"@webb-tools/tangle-substrate-types","version":"0.5.8","description":"Polkadot.js type definitions required for interacting with Webb's tangle network","main":"./index.js","types":"./index.d.ts","typings":"./index.d.ts","author":"Webb Developers <drew@webb.tools>","license":"Apache-2.0","type":"commonjs","publishConfig":{"access":"public","registry":"https://registry.npmjs.org"},"repository":"https://github.com/webb-tools/tangle.git","bugs":{"url":"https://github.com/webb-tools/tangle/issues"},"homepage":"https://github.com/webb-tools/tangle","dependencies":{"@babel/cli":"^7.23.9","@babel/core":"^7.24.0","@babel/plugin-proposal-nullish-coalescing-operator":"^7.18.6","@babel/plugin-proposal-numeric-separator":"^7.18.6","@babel/plugin-proposal-optional-chaining":"^7.20.7","@babel/plugin-syntax-bigint":"^7.8.3","@babel/plugin-syntax-dynamic-import":"^7.8.3","@babel/plugin-syntax-import-assertions":"^7.23.3","@babel/plugin-syntax-import-meta":"^7.10.4","@babel/plugin-syntax-top-level-await":"^7.14.5","@babel/plugin-transform-regenerator":"^7.23.3","@babel/plugin-transform-runtime":"^7.24.0","@babel/preset-env":"^7.24.0","@babel/preset-react":"^7.23.3","@babel/preset-typescript":"^7.23.3","@babel/register":"^7.23.7","@babel/runtime":"^7.24.0","@open-web3/orml-types":"^2.0.1","@polkadot/api":"^11.0.2","@polkadot/dev":"^0.78.11","@polkadot/typegen":"^11.0.2","@polkadot/types":"^11.0.2","babel-jest":"^29.7.0","babel-plugin-module-extension-resolver":"^1.0.0","babel-plugin-module-resolver":"^5.0.0","babel-plugin-styled-components":"^2.1.4","ecpair":"^2.1.0","elliptic":"^6.5.5","fs-extra":"^11.2.0","glob2base":"^0.0.12","minimatch":"^9.0.3","mkdirp":"^3.0.1","tiny-secp256k1":"^2.2.3"},"devDependencies":{"@types/websocket":"^1.0.10","rimraf":"5.0.5","ts-node":"10.9.2","tsconfig-paths":"^4.2.0","typescript":"5.4.2","websocket":"^1.0.34"},"scripts":{"build":"node ./scripts/build.js","build:interfaces":"yarn build:interfaces:defs && yarn build:interfaces:chain && rm ./src/interfaces/index.ts && rm ./src/interfaces/types.ts","build:interfaces:defs":"npx ts-node node_modules/.bin/polkadot-types-from-defs --input ./src/interfaces --package @webb-tools/tangle-substrate-types --endpoint ./src/metadata/metadata.json","build:interfaces:chain":"npx ts-node node_modules/.bin/polkadot-types-from-chain --endpoint ./src/metadata/metadata.json --output ./src/interfaces","clean":"rm -rf build && rm -rf ts-types","publish-types":"node ./scripts/publish-types.js","update:metadata":"npx ts-node ./scripts/updateMetadata.ts"}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webb-tools/tangle-substrate-types",
3
- "version": "0.5.4",
3
+ "version": "0.5.8",
4
4
  "description": "Polkadot.js type definitions required for interacting with Webb's tangle network",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -36,10 +36,10 @@
36
36
  "@babel/register": "^7.23.7",
37
37
  "@babel/runtime": "^7.24.0",
38
38
  "@open-web3/orml-types": "^2.0.1",
39
- "@polkadot/api-derive": "10.12.2",
39
+ "@polkadot/api": "^11.0.2",
40
40
  "@polkadot/dev": "^0.78.11",
41
- "@polkadot/typegen": "10.12.2",
42
- "@polkadot/types": "10.12.2",
41
+ "@polkadot/typegen": "^11.0.2",
42
+ "@polkadot/types": "^11.0.2",
43
43
  "babel-jest": "^29.7.0",
44
44
  "babel-plugin-module-extension-resolver": "^1.0.0",
45
45
  "babel-plugin-module-resolver": "^5.0.0",
package/playground.ts ADDED
@@ -0,0 +1,86 @@
1
+ import { ApiPromise, WsProvider } from "@polkadot/api";
2
+ import { Keyring } from "@polkadot/keyring";
3
+ import { u128 } from "@polkadot/types";
4
+ (async () => {
5
+ const provider = new WsProvider('ws://127.0.0.1:9944');
6
+ const api = await ApiPromise.create({ provider });
7
+
8
+ await api.isReady;
9
+ const registry = api.registry;
10
+
11
+ const sr25519Keyring = new Keyring({ type: 'sr25519' });
12
+
13
+ const ALICE = sr25519Keyring.addFromUri('//Alice');
14
+ const BOB = sr25519Keyring.addFromUri('//Bob');
15
+ const CHARLIE = sr25519Keyring.addFromUri('//Charlie');
16
+ const creatingProfileTx = api.tx.roles.createProfile({
17
+ Shared: {
18
+ records: [
19
+ {
20
+ role: {
21
+ Tss: {
22
+ DfnsCGGMP21Secp256k1: {},
23
+ },
24
+ },
25
+ },
26
+ ],
27
+ amount: new u128(registry, 100_000_000_000_000),
28
+ },
29
+ //@ts-ignore
30
+ }, null);
31
+
32
+ for (const signer of [ALICE, BOB, CHARLIE]) {
33
+ await new Promise(async (resolve) => {
34
+ console.log('Creating profile for:', signer.address);
35
+ const unsub = await creatingProfileTx.signAndSend(signer, async ({ events = [], status }) => {
36
+ if (status.isInBlock) {
37
+ console.log(
38
+ '[creatingProfileTx] Included at block hash',
39
+ status.asInBlock.toHex()
40
+ );
41
+ console.log('[creatingProfileTx] Events:');
42
+ events.forEach(({ event: { data, method, section } }) => {
43
+ console.log(`\t${section}.${method}:: ${data}`);
44
+ });
45
+ unsub();
46
+ resolve(void 0);
47
+ }
48
+ });
49
+ });
50
+ }
51
+
52
+ const submittingJobTx = api.tx.jobs.submitJob({
53
+ expiry: 100_000_000,
54
+ ttl: 100_000_000,
55
+ jobType: {
56
+ DkgtssPhaseOne: {
57
+ participants: [ALICE.address, BOB.address, CHARLIE.address],
58
+ threshold: 2,
59
+ permittedCaller: null,
60
+ roleType: {
61
+ DfnsCGGMP21Secp256k1: {},
62
+ },
63
+ },
64
+ },
65
+ });
66
+
67
+ // Sign and send the transaction and wait for it to be included.
68
+ await new Promise(async (resolve) => {
69
+ const unsub = await submittingJobTx.signAndSend(ALICE, async ({ events = [], status }) => {
70
+ if (status.isFinalized) {
71
+ console.log(
72
+ '[submittingJobTx] Included at block hash',
73
+ status.asFinalized.toHex()
74
+ );
75
+ console.log('[submittingJobTx] Events:');
76
+ events.forEach(({ event: { data, method, section } }) => {
77
+ console.log(`\t${section}.${method}:: ${data}`);
78
+ });
79
+ unsub();
80
+ resolve(void 0);
81
+ }
82
+ });
83
+ });
84
+
85
+ process.exit(0);
86
+ })();
@@ -6,22 +6,53 @@
6
6
  import '@polkadot/api-base/types/consts';
7
7
 
8
8
  import type { ApiTypes, AugmentedConst } from '@polkadot/api-base/types';
9
- import type { Bytes, Option, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
10
- import type { Codec } from '@polkadot/types-codec/types';
11
- import type { Perbill, Permill } from '@polkadot/types/interfaces/runtime';
12
- import {
13
- FrameSupportPalletId,
14
- FrameSystemLimitsBlockLength,
15
- FrameSystemLimitsBlockWeights,
16
- SpVersionRuntimeVersion,
17
- SpWeightsRuntimeDbWeight,
18
- SpWeightsWeightV2Weight,
19
- } from '@polkadot/types/lookup'
9
+ import type { BTreeMap, Bytes, Option, U256, U8aFixed, Vec, bool, u128, u16, u32, u64, u8 } from '@polkadot/types-codec';
10
+ import type { Codec, ITuple } from '@polkadot/types-codec/types';
11
+ import type { AccountId32, H160, Perbill, Permill } from '@polkadot/types/interfaces/runtime';
12
+ import { SpWeightsWeightV2Weight, FrameSupportPalletId, StagingXcmV4AssetAssetId, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpWeightsRuntimeDbWeight, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
20
13
 
21
14
  export type __AugmentedConst<ApiType extends ApiTypes> = AugmentedConst<ApiType>;
22
15
 
23
16
  declare module '@polkadot/api-base/types/consts' {
24
17
  interface AugmentedConsts<ApiType extends ApiTypes> {
18
+ assets: {
19
+ /**
20
+ * The amount of funds that must be reserved when creating a new approval.
21
+ **/
22
+ approvalDeposit: u128 & AugmentedConst<ApiType>;
23
+ /**
24
+ * The amount of funds that must be reserved for a non-provider asset account to be
25
+ * maintained.
26
+ **/
27
+ assetAccountDeposit: u128 & AugmentedConst<ApiType>;
28
+ /**
29
+ * The basic amount of funds that must be reserved for an asset.
30
+ **/
31
+ assetDeposit: u128 & AugmentedConst<ApiType>;
32
+ /**
33
+ * The basic amount of funds that must be reserved when adding metadata to your asset.
34
+ **/
35
+ metadataDepositBase: u128 & AugmentedConst<ApiType>;
36
+ /**
37
+ * The additional funds that must be reserved for the number of bytes you store in your
38
+ * metadata.
39
+ **/
40
+ metadataDepositPerByte: u128 & AugmentedConst<ApiType>;
41
+ /**
42
+ * Max number of items to destroy per `destroy_accounts` and `destroy_approvals` call.
43
+ *
44
+ * Must be configured to result in a weight that makes each call fit in a block.
45
+ **/
46
+ removeItemsLimit: u32 & AugmentedConst<ApiType>;
47
+ /**
48
+ * The maximum length of a name or symbol stored on-chain.
49
+ **/
50
+ stringLimit: u32 & AugmentedConst<ApiType>;
51
+ /**
52
+ * Generic const
53
+ **/
54
+ [key: string]: Codec;
55
+ };
25
56
  babe: {
26
57
  /**
27
58
  * The amount of time, in slots, that each epoch should last.
@@ -512,6 +543,40 @@ declare module '@polkadot/api-base/types/consts' {
512
543
  **/
513
544
  [key: string]: Codec;
514
545
  };
546
+ multiAssetDelegation: {
547
+ /**
548
+ * The duration for which the bond is locked.
549
+ **/
550
+ bondDuration: u32 & AugmentedConst<ApiType>;
551
+ /**
552
+ * Number of rounds that delegation bond less requests must wait before being executable.
553
+ **/
554
+ delegationBondLessDelay: u32 & AugmentedConst<ApiType>;
555
+ /**
556
+ * Number of rounds that delegators remain bonded before the exit request is executable.
557
+ **/
558
+ leaveDelegatorsDelay: u32 & AugmentedConst<ApiType>;
559
+ /**
560
+ * Number of rounds that operators remain bonded before the exit request is executable.
561
+ **/
562
+ leaveOperatorsDelay: u32 & AugmentedConst<ApiType>;
563
+ /**
564
+ * The minimum amount of bond required for a delegate.
565
+ **/
566
+ minDelegateAmount: u128 & AugmentedConst<ApiType>;
567
+ /**
568
+ * The minimum amount of bond required for an operator.
569
+ **/
570
+ minOperatorBondAmount: u128 & AugmentedConst<ApiType>;
571
+ /**
572
+ * Number of rounds operator requests to decrease self-bond must wait to be executable.
573
+ **/
574
+ operatorBondLessDelay: u32 & AugmentedConst<ApiType>;
575
+ /**
576
+ * Generic const
577
+ **/
578
+ [key: string]: Codec;
579
+ };
515
580
  multisig: {
516
581
  /**
517
582
  * The base amount of currency needed to reserve for creating a multisig execution or to
@@ -566,6 +631,49 @@ declare module '@polkadot/api-base/types/consts' {
566
631
  **/
567
632
  [key: string]: Codec;
568
633
  };
634
+ proxy: {
635
+ /**
636
+ * The base amount of currency needed to reserve for creating an announcement.
637
+ *
638
+ * This is held when a new storage item holding a `Balance` is created (typically 16
639
+ * bytes).
640
+ **/
641
+ announcementDepositBase: u128 & AugmentedConst<ApiType>;
642
+ /**
643
+ * The amount of currency needed per announcement made.
644
+ *
645
+ * This is held for adding an `AccountId`, `Hash` and `BlockNumber` (typically 68 bytes)
646
+ * into a pre-existing storage value.
647
+ **/
648
+ announcementDepositFactor: u128 & AugmentedConst<ApiType>;
649
+ /**
650
+ * The maximum amount of time-delayed announcements that are allowed to be pending.
651
+ **/
652
+ maxPending: u32 & AugmentedConst<ApiType>;
653
+ /**
654
+ * The maximum amount of proxies allowed for a single account.
655
+ **/
656
+ maxProxies: u32 & AugmentedConst<ApiType>;
657
+ /**
658
+ * The base amount of currency needed to reserve for creating a proxy.
659
+ *
660
+ * This is held for an additional storage item whose value size is
661
+ * `sizeof(Balance)` bytes and whose key size is `sizeof(AccountId)` bytes.
662
+ **/
663
+ proxyDepositBase: u128 & AugmentedConst<ApiType>;
664
+ /**
665
+ * The amount of currency needed per proxy added.
666
+ *
667
+ * This is held for adding 32 bytes plus an instance of `ProxyType` more into a
668
+ * pre-existing storage value. Thus, when configuring `ProxyDepositFactor` one should take
669
+ * into account `32 + proxy_type.encode().len()` bytes of data.
670
+ **/
671
+ proxyDepositFactor: u128 & AugmentedConst<ApiType>;
672
+ /**
673
+ * Generic const
674
+ **/
675
+ [key: string]: Codec;
676
+ };
569
677
  roles: {
570
678
  /**
571
679
  * Max roles per account.
@@ -665,6 +773,34 @@ declare module '@polkadot/api-base/types/consts' {
665
773
  **/
666
774
  [key: string]: Codec;
667
775
  };
776
+ sygmaBridge: {
777
+ /**
778
+ * EIP712 Verifying contract address
779
+ * This is used in EIP712 typed data domain
780
+ **/
781
+ destVerifyingContractAddress: H160 & AugmentedConst<ApiType>;
782
+ /**
783
+ * Pallet ChainID
784
+ * This is used in EIP712 typed data domain
785
+ **/
786
+ eip712ChainID: U256 & AugmentedConst<ApiType>;
787
+ /**
788
+ * Fee reserve account
789
+ **/
790
+ feeReserveAccount: AccountId32 & AugmentedConst<ApiType>;
791
+ /**
792
+ * AssetId and ResourceId pairs
793
+ **/
794
+ resourcePairs: Vec<ITuple<[StagingXcmV4AssetAssetId, U8aFixed]>> & AugmentedConst<ApiType>;
795
+ /**
796
+ * Bridge transfer reserve accounts mapping with designated assets
797
+ **/
798
+ transferReserveAccounts: BTreeMap<StagingXcmV4AssetAssetId, AccountId32> & AugmentedConst<ApiType>;
799
+ /**
800
+ * Generic const
801
+ **/
802
+ [key: string]: Codec;
803
+ };
668
804
  system: {
669
805
  /**
670
806
  * Maximum number of block number to block hash mappings to keep (oldest pruned first).