@bitgo-beta/sdk-coin-polyx 1.0.1-beta.33 → 1.0.1-beta.331

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 (83) hide show
  1. package/.mocharc.yml +1 -1
  2. package/CHANGELOG.md +141 -0
  3. package/dist/src/index.d.ts +1 -0
  4. package/dist/src/index.d.ts.map +1 -1
  5. package/dist/src/index.js +2 -1
  6. package/dist/src/lib/baseBuilder.d.ts +24 -0
  7. package/dist/src/lib/baseBuilder.d.ts.map +1 -0
  8. package/dist/src/lib/baseBuilder.js +31 -0
  9. package/dist/src/lib/batchStakingBuilder.d.ts +79 -0
  10. package/dist/src/lib/batchStakingBuilder.d.ts.map +1 -0
  11. package/dist/src/lib/batchStakingBuilder.js +299 -0
  12. package/dist/src/lib/batchUnstakingBuilder.d.ts +39 -0
  13. package/dist/src/lib/batchUnstakingBuilder.d.ts.map +1 -0
  14. package/dist/src/lib/batchUnstakingBuilder.js +127 -0
  15. package/dist/src/lib/bondExtraBuilder.d.ts +37 -0
  16. package/dist/src/lib/bondExtraBuilder.d.ts.map +1 -0
  17. package/dist/src/lib/bondExtraBuilder.js +101 -0
  18. package/dist/src/lib/constants.d.ts +12 -0
  19. package/dist/src/lib/constants.d.ts.map +1 -0
  20. package/dist/src/lib/constants.js +15 -0
  21. package/dist/src/lib/iface.d.ts +125 -3
  22. package/dist/src/lib/iface.d.ts.map +1 -1
  23. package/dist/src/lib/iface.js +36 -1
  24. package/dist/src/lib/index.d.ts +15 -7
  25. package/dist/src/lib/index.d.ts.map +1 -1
  26. package/dist/src/lib/index.js +42 -36
  27. package/dist/src/lib/preApproveAssetBuilder.d.ts +33 -0
  28. package/dist/src/lib/preApproveAssetBuilder.d.ts.map +1 -0
  29. package/dist/src/lib/preApproveAssetBuilder.js +77 -0
  30. package/dist/src/lib/registerDidWithCDDBuilder.d.ts +34 -0
  31. package/dist/src/lib/registerDidWithCDDBuilder.d.ts.map +1 -0
  32. package/dist/src/lib/registerDidWithCDDBuilder.js +83 -0
  33. package/dist/src/lib/tokenTransferBuilder.d.ts +58 -0
  34. package/dist/src/lib/tokenTransferBuilder.d.ts.map +1 -0
  35. package/dist/src/lib/tokenTransferBuilder.js +159 -0
  36. package/dist/src/lib/transaction.d.ts +18 -4
  37. package/dist/src/lib/transaction.d.ts.map +1 -1
  38. package/dist/src/lib/transaction.js +136 -8
  39. package/dist/src/lib/transactionBuilderFactory.d.ts +27 -5
  40. package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
  41. package/dist/src/lib/transactionBuilderFactory.js +112 -8
  42. package/dist/src/lib/transferBuilder.d.ts +51 -3
  43. package/dist/src/lib/transferBuilder.d.ts.map +1 -1
  44. package/dist/src/lib/transferBuilder.js +109 -3
  45. package/dist/src/lib/txnSchema.d.ts +49 -0
  46. package/dist/src/lib/txnSchema.d.ts.map +1 -0
  47. package/dist/src/lib/txnSchema.js +145 -0
  48. package/dist/src/lib/unbondBuilder.d.ts +37 -0
  49. package/dist/src/lib/unbondBuilder.d.ts.map +1 -0
  50. package/dist/src/lib/unbondBuilder.js +98 -0
  51. package/dist/src/lib/utils.d.ts +15 -14
  52. package/dist/src/lib/utils.d.ts.map +1 -1
  53. package/dist/src/lib/utils.js +40 -23
  54. package/dist/src/lib/withdrawUnbondedBuilder.d.ts +35 -0
  55. package/dist/src/lib/withdrawUnbondedBuilder.d.ts.map +1 -0
  56. package/dist/src/lib/withdrawUnbondedBuilder.js +89 -0
  57. package/dist/src/polyx.d.ts +50 -9
  58. package/dist/src/polyx.d.ts.map +1 -1
  59. package/dist/src/polyx.js +270 -16
  60. package/dist/src/polyxToken.d.ts +20 -0
  61. package/dist/src/polyxToken.d.ts.map +1 -0
  62. package/dist/src/polyxToken.js +55 -0
  63. package/dist/src/register.d.ts.map +1 -1
  64. package/dist/src/register.js +5 -1
  65. package/dist/src/resources/index.d.ts +3 -0
  66. package/dist/src/resources/index.d.ts.map +1 -0
  67. package/dist/src/resources/index.js +19 -0
  68. package/dist/src/resources/mainnet.d.ts +13 -0
  69. package/dist/src/resources/mainnet.d.ts.map +1 -0
  70. package/dist/src/resources/mainnet.js +16 -0
  71. package/dist/src/resources/testnet.d.ts +13 -0
  72. package/dist/src/resources/testnet.d.ts.map +1 -0
  73. package/dist/src/resources/testnet.js +16 -0
  74. package/dist/src/tpolyx.d.ts +7 -0
  75. package/dist/src/tpolyx.d.ts.map +1 -1
  76. package/dist/src/tpolyx.js +11 -1
  77. package/package.json +15 -9
  78. package/dist/src/lib/keyPair.d.ts +0 -12
  79. package/dist/src/lib/keyPair.d.ts.map +0 -1
  80. package/dist/src/lib/keyPair.js +0 -24
  81. package/dist/src/lib/transactionBuilder.d.ts +0 -43
  82. package/dist/src/lib/transactionBuilder.d.ts.map +0 -1
  83. package/dist/src/lib/transactionBuilder.js +0 -78
package/.mocharc.yml CHANGED
@@ -1,4 +1,4 @@
1
- require: 'ts-node/register'
1
+ require: 'tsx'
2
2
  timeout: '60000'
3
3
  reporter: 'min'
4
4
  reporter-option:
package/CHANGELOG.md CHANGED
@@ -0,0 +1,141 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [1.8.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.7.2...@bitgo/sdk-coin-polyx@1.8.0) (2025-08-22)
7
+
8
+ ### Features
9
+
10
+ - **root:** migrate ts-node -> tsx ([ea180b4](https://github.com/BitGo/BitGoJS/commit/ea180b43001d8e956196bc07b32798e3a7031eeb))
11
+
12
+ ## [1.7.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.7.1...@bitgo/sdk-coin-polyx@1.7.2) (2025-08-22)
13
+
14
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
15
+
16
+ ## [1.7.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.7.0...@bitgo/sdk-coin-polyx@1.7.1) (2025-08-19)
17
+
18
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
19
+
20
+ # [1.7.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.6.0...@bitgo/sdk-coin-polyx@1.7.0) (2025-08-14)
21
+
22
+ ### Bug Fixes
23
+
24
+ - **sdk-coin-polyx:** add test token and update the tests ([1f8af7d](https://github.com/BitGo/BitGoJS/commit/1f8af7d620b5d603a4e27c15276f518e6ff4f349))
25
+
26
+ ### Features
27
+
28
+ - **sdk-coin-polyx:** add token builders ([6860780](https://github.com/BitGo/BitGoJS/commit/68607804efc1191ff396e05f20466526246b7d87))
29
+
30
+ # [1.6.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.6...@bitgo/sdk-coin-polyx@1.6.0) (2025-08-07)
31
+
32
+ ### Features
33
+
34
+ - add polyxToken skeleton ([c7be0ef](https://github.com/BitGo/BitGoJS/commit/c7be0efb003c720e9da732b627576336c7fc9e52))
35
+ - **sdk-coin-polyx:** add wrw support ([24ec106](https://github.com/BitGo/BitGoJS/commit/24ec106158e0f7330dc61c467b466904fb9e068b))
36
+
37
+ ## [1.5.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.5...@bitgo/sdk-coin-polyx@1.5.6) (2025-07-31)
38
+
39
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
40
+
41
+ ## [1.5.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.4...@bitgo/sdk-coin-polyx@1.5.5) (2025-07-30)
42
+
43
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
44
+
45
+ ## [1.5.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.2...@bitgo/sdk-coin-polyx@1.5.4) (2025-07-25)
46
+
47
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
48
+
49
+ ## [1.5.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.2...@bitgo/sdk-coin-polyx@1.5.3) (2025-07-23)
50
+
51
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
52
+
53
+ ## [1.5.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.1...@bitgo/sdk-coin-polyx@1.5.2) (2025-07-15)
54
+
55
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
56
+
57
+ ## [1.5.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.5.0...@bitgo/sdk-coin-polyx@1.5.1) (2025-07-10)
58
+
59
+ ### Bug Fixes
60
+
61
+ - **sdk-coin-polyx:** add mainnet address format ([4d02932](https://github.com/BitGo/BitGoJS/commit/4d02932045d5d6f02a9127cb189a5e71dc803f38))
62
+
63
+ # [1.5.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.4.2...@bitgo/sdk-coin-polyx@1.5.0) (2025-07-03)
64
+
65
+ ### Features
66
+
67
+ - **sdk-coin-polyx:** implement unbond builder ([4d449f7](https://github.com/BitGo/BitGoJS/commit/4d449f71685856a20b47cbf5eb561999b71986e5))
68
+
69
+ ## [1.4.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.4.1...@bitgo/sdk-coin-polyx@1.4.2) (2025-06-25)
70
+
71
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
72
+
73
+ ## [1.4.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.4.0...@bitgo/sdk-coin-polyx@1.4.1) (2025-06-24)
74
+
75
+ ### Bug Fixes
76
+
77
+ - decoding logic to differentiate b/w stake and unstake batch ([2d82c4e](https://github.com/BitGo/BitGoJS/commit/2d82c4e572c94cb5b770301428c107da22f84448))
78
+ - **sdk-coin-polyx:** add address format for polyx and tpolyx ([7748439](https://github.com/BitGo/BitGoJS/commit/774843999a56b793775f119c0f3a4f6a49d40a73))
79
+
80
+ # [1.4.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.3.1...@bitgo/sdk-coin-polyx@1.4.0) (2025-06-18)
81
+
82
+ ### Features
83
+
84
+ - add decoding support for polyx staking related txns ([f680b01](https://github.com/BitGo/BitGoJS/commit/f680b011c6c89b4c3c04ede21f089e8efc1c0ee8))
85
+
86
+ ## [1.3.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.3.0...@bitgo/sdk-coin-polyx@1.3.1) (2025-06-10)
87
+
88
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
89
+
90
+ # [1.3.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.2.0...@bitgo/sdk-coin-polyx@1.3.0) (2025-06-05)
91
+
92
+ ### Features
93
+
94
+ - add batchStakingBuilder (bond and nominate) and bondExtraBuilder for polyx ([cd29662](https://github.com/BitGo/BitGoJS/commit/cd296620fb013ebd48ec89bb4bcf1bf0433ec7d4))
95
+ - add batchUnstakingBuilder and withdrawUnbondedBuilder ([d86c459](https://github.com/BitGo/BitGoJS/commit/d86c459f1c42c1d5cbf93b7ba408760b617bf328))
96
+ - **root:** support node 22 ([c4ad6af](https://github.com/BitGo/BitGoJS/commit/c4ad6af2e8896221417c303f0f6b84652b493216))
97
+
98
+ # [1.2.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.1.2...@bitgo/sdk-coin-polyx@1.2.0) (2025-06-02)
99
+
100
+ ### Bug Fixes
101
+
102
+ - **sdk-coin-polyx:** fix to toJson method in polyx transaction ([8f8ef0b](https://github.com/BitGo/BitGoJS/commit/8f8ef0b8fa420dadb41989465b2380af73466ae0))
103
+
104
+ ### Features
105
+
106
+ - rename audit function naming and signature ([1a885ab](https://github.com/BitGo/BitGoJS/commit/1a885ab60d30ca8595e284a728f2ab9d3c09994e))
107
+
108
+ ## [1.1.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.1.1...@bitgo/sdk-coin-polyx@1.1.2) (2025-05-28)
109
+
110
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
111
+
112
+ ## [1.1.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.1.0...@bitgo/sdk-coin-polyx@1.1.1) (2025-05-22)
113
+
114
+ ### Bug Fixes
115
+
116
+ - **sdk-coin-polyx:** all fixed ([f9c23bc](https://github.com/BitGo/BitGoJS/commit/f9c23bc9a8bc609be5f41a4ffd980138ecb63148))
117
+ - **sdk-coin-polyx:** fix cdd builder ([2461fbf](https://github.com/BitGo/BitGoJS/commit/2461fbfcc76f8f6e7f89302f5e3c4b99097cb97a))
118
+
119
+ # [1.1.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.0.4...@bitgo/sdk-coin-polyx@1.1.0) (2025-05-20)
120
+
121
+ ### Features
122
+
123
+ - **sdk-coin-polyx:** add transaction builders ([31c96bb](https://github.com/BitGo/BitGoJS/commit/31c96bbbce60b93e13208e3eab06bd144cfe57e4))
124
+
125
+ ## [1.0.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.0.3...@bitgo/sdk-coin-polyx@1.0.4) (2025-05-07)
126
+
127
+ ### Bug Fixes
128
+
129
+ - send statics coin to substrate class ([9ed860e](https://github.com/BitGo/BitGoJS/commit/9ed860ed288516959d5723e6119c7701588a41e7))
130
+
131
+ ## [1.0.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.0.2...@bitgo/sdk-coin-polyx@1.0.3) (2025-04-29)
132
+
133
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
134
+
135
+ ## [1.0.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.0.1...@bitgo/sdk-coin-polyx@1.0.2) (2025-04-25)
136
+
137
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
138
+
139
+ ## 1.0.1 (2025-04-15)
140
+
141
+ **Note:** Version bump only for package @bitgo/sdk-coin-polyx
@@ -2,4 +2,5 @@ export * from './lib';
2
2
  export * from './register';
3
3
  export * from './polyx';
4
4
  export * from './tpolyx';
5
+ export * from './polyxToken';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC"}
package/dist/src/index.js CHANGED
@@ -18,4 +18,5 @@ __exportStar(require("./lib"), exports);
18
18
  __exportStar(require("./register"), exports);
19
19
  __exportStar(require("./polyx"), exports);
20
20
  __exportStar(require("./tpolyx"), exports);
21
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHdDQUFzQjtBQUN0Qiw2Q0FBMkI7QUFDM0IsMENBQXdCO0FBQ3hCLDJDQUF5QiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCAqIGZyb20gJy4vbGliJztcbmV4cG9ydCAqIGZyb20gJy4vcmVnaXN0ZXInO1xuZXhwb3J0ICogZnJvbSAnLi9wb2x5eCc7XG5leHBvcnQgKiBmcm9tICcuL3Rwb2x5eCc7XG4iXX0=
21
+ __exportStar(require("./polyxToken"), exports);
22
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLHdDQUFzQjtBQUN0Qiw2Q0FBMkI7QUFDM0IsMENBQXdCO0FBQ3hCLDJDQUF5QjtBQUN6QiwrQ0FBNkIiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgKiBmcm9tICcuL2xpYic7XG5leHBvcnQgKiBmcm9tICcuL3JlZ2lzdGVyJztcbmV4cG9ydCAqIGZyb20gJy4vcG9seXgnO1xuZXhwb3J0ICogZnJvbSAnLi90cG9seXgnO1xuZXhwb3J0ICogZnJvbSAnLi9wb2x5eFRva2VuJztcbiJdfQ==
@@ -0,0 +1,24 @@
1
+ import { TransactionBuilder } from '@bitgo-beta/abstract-substrate';
2
+ import { Transaction } from './transaction';
3
+ import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
4
+ import { TransactionType } from '@bitgo-beta/sdk-core';
5
+ import { DecodedSignedTx, DecodedSigningPayload, UnsignedTransaction } from '@substrate/txwrapper-core';
6
+ import { TxMethod } from './iface';
7
+ /**
8
+ * Base builder class for Polyx transactions
9
+ * Extends the abstract-substrate TransactionBuilder with Polyx-specific functionality
10
+ */
11
+ export declare abstract class PolyxBaseBuilder<M = TxMethod, T extends Transaction = Transaction> extends TransactionBuilder<M, T> {
12
+ constructor(_coinConfig: Readonly<CoinConfig>);
13
+ /**
14
+ * Override the getAddressFormat method to return different values based on network type
15
+ * Returns 12 for mainnet and 42 for testnet
16
+ *
17
+ * @returns {number} The address format to use
18
+ */
19
+ protected getAddressFormat(): number;
20
+ protected abstract buildTransaction(): UnsignedTransaction;
21
+ protected abstract get transactionType(): TransactionType;
22
+ abstract validateDecodedTransaction(decodedTxn: DecodedSigningPayload | DecodedSignedTx, rawTransaction?: string): void;
23
+ }
24
+ //# sourceMappingURL=baseBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/baseBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACxG,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAGnC;;;GAGG;AACH,8BAAsB,gBAAgB,CAAC,CAAC,GAAG,QAAQ,EAAE,CAAC,SAAS,WAAW,GAAG,WAAW,CAAE,SAAQ,kBAAkB,CAClH,CAAC,EACD,CAAC,CACF;gBACa,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;IAM7C;;;;;OAKG;IACH,SAAS,CAAC,gBAAgB,IAAI,MAAM;IAKpC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,IAAI,mBAAmB;IAC1D,SAAS,CAAC,QAAQ,KAAK,eAAe,IAAI,eAAe,CAAC;IAC1D,QAAQ,CAAC,0BAA0B,CACjC,UAAU,EAAE,qBAAqB,GAAG,eAAe,EACnD,cAAc,CAAC,EAAE,MAAM,GACtB,IAAI;CACR"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PolyxBaseBuilder = void 0;
7
+ const abstract_substrate_1 = require("@bitgo-beta/abstract-substrate");
8
+ const transaction_1 = require("./transaction");
9
+ const utils_1 = __importDefault(require("./utils"));
10
+ /**
11
+ * Base builder class for Polyx transactions
12
+ * Extends the abstract-substrate TransactionBuilder with Polyx-specific functionality
13
+ */
14
+ class PolyxBaseBuilder extends abstract_substrate_1.TransactionBuilder {
15
+ constructor(_coinConfig) {
16
+ super(_coinConfig);
17
+ // Override the transaction instance with our PolyX-specific Transaction
18
+ this._transaction = new transaction_1.Transaction(_coinConfig);
19
+ }
20
+ /**
21
+ * Override the getAddressFormat method to return different values based on network type
22
+ * Returns 12 for mainnet and 42 for testnet
23
+ *
24
+ * @returns {number} The address format to use
25
+ */
26
+ getAddressFormat() {
27
+ return utils_1.default.getAddressFormat(this._coinConfig.name);
28
+ }
29
+ }
30
+ exports.PolyxBaseBuilder = PolyxBaseBuilder;
31
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZUJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2Jhc2VCdWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHVFQUFvRTtBQUNwRSwrQ0FBNEM7QUFLNUMsb0RBQTRCO0FBRTVCOzs7R0FHRztBQUNILE1BQXNCLGdCQUFvRSxTQUFRLHVDQUdqRztJQUNDLFlBQVksV0FBaUM7UUFDM0MsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ25CLHdFQUF3RTtRQUN4RSxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUkseUJBQVcsQ0FBQyxXQUFXLENBQU0sQ0FBQztJQUN4RCxDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDTyxnQkFBZ0I7UUFDeEIsT0FBTyxlQUFLLENBQUMsZ0JBQWdCLENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUN2RCxDQUFDO0NBU0Y7QUEzQkQsNENBMkJDIiwic291cmNlc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bmdcbiAgKTogdm9pZDtcbn1cbiJdfQ==
@@ -0,0 +1,79 @@
1
+ import { Transaction } from './transaction';
2
+ import { PolyxBaseBuilder } from './baseBuilder';
3
+ import { DecodedSignedTx, DecodedSigningPayload, UnsignedTransaction } from '@substrate/txwrapper-core';
4
+ import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
5
+ import { BaseAddress, TransactionType } from '@bitgo-beta/sdk-core';
6
+ import { BondArgs, NominateArgs } from './iface';
7
+ export declare class BatchStakingBuilder extends PolyxBaseBuilder {
8
+ protected _amount: string;
9
+ protected _controller: string;
10
+ protected _payee: string | {
11
+ Account: string;
12
+ };
13
+ protected _validators: string[];
14
+ constructor(_coinConfig: Readonly<CoinConfig>);
15
+ protected get transactionType(): TransactionType;
16
+ /**
17
+ * Build a batch transaction that combines bond and nominate operations
18
+ * Both operations are required and always atomic (using batchAll)
19
+ */
20
+ protected buildTransaction(): UnsignedTransaction;
21
+ /**
22
+ * Set the staking amount for bond
23
+ */
24
+ amount(amount: string): this;
25
+ /**
26
+ * Get the staking amount
27
+ */
28
+ getAmount(): string;
29
+ /**
30
+ * Set the controller account for bond
31
+ */
32
+ controller(controller: BaseAddress): this;
33
+ /**
34
+ * Get the controller address
35
+ */
36
+ getController(): string;
37
+ /**
38
+ * Set the rewards destination for bond ('Staked', 'Stash','Controller', or { Account: string })
39
+ */
40
+ payee(payee: string | {
41
+ Account: string;
42
+ }): this;
43
+ /**
44
+ * Get the payee
45
+ */
46
+ getPayee(): string | {
47
+ Account: string;
48
+ };
49
+ /**
50
+ * Set the validators to nominate
51
+ */
52
+ validators(validators: string[]): this;
53
+ /**
54
+ * Get the validators to nominate
55
+ */
56
+ getValidators(): string[];
57
+ /** @inheritdoc */
58
+ validateDecodedTransaction(decodedTxn: DecodedSigningPayload | DecodedSignedTx): void;
59
+ /**
60
+ * Validate bond arguments
61
+ */
62
+ private validateBondArgs;
63
+ /**
64
+ * Validate nominate arguments
65
+ */
66
+ private validateNominateArgs;
67
+ /** @inheritdoc */
68
+ protected fromImplementation(rawTransaction: string): Transaction;
69
+ /** @inheritdoc */
70
+ validateTransaction(tx: Transaction): void;
71
+ /**
72
+ * Validate the builder fields
73
+ */
74
+ private validateFields;
75
+ testValidateFields(): void;
76
+ testValidateBondArgs(args: BondArgs): void;
77
+ testValidateNominateArgs(args: NominateArgs): void;
78
+ }
79
+ //# sourceMappingURL=batchStakingBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"batchStakingBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/batchStakingBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAExG,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAA2B,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG7F,OAAO,EAAa,QAAQ,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAmB5D,qBAAa,mBAAoB,SAAQ,gBAAgB;IAEvD,SAAS,CAAC,OAAO,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,WAAW,EAAE,MAAM,CAAC;IAC9B,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAG/C,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,CAAM;gBAEzB,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;IAK7C,SAAS,KAAK,eAAe,IAAI,eAAe,CAE/C;IAED;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAI,mBAAmB;IA2CjD;;OAEG;IACH,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI;IAM5B;;OAEG;IACH,SA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