@bitgo-beta/sdk-coin-polyx 0.0.0-semantic-release-managed
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.
- package/.eslintignore +4 -0
- package/.mocharc.yml +8 -0
- package/CHANGELOG.md +159 -0
- package/LICENSE +191 -0
- package/README.md +30 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +22 -0
- package/dist/src/lib/baseBuilder.d.ts +24 -0
- package/dist/src/lib/baseBuilder.d.ts.map +1 -0
- package/dist/src/lib/baseBuilder.js +31 -0
- package/dist/src/lib/batchStakingBuilder.d.ts +79 -0
- package/dist/src/lib/batchStakingBuilder.d.ts.map +1 -0
- package/dist/src/lib/batchStakingBuilder.js +299 -0
- package/dist/src/lib/batchUnstakingBuilder.d.ts +39 -0
- package/dist/src/lib/batchUnstakingBuilder.d.ts.map +1 -0
- package/dist/src/lib/batchUnstakingBuilder.js +127 -0
- package/dist/src/lib/bondExtraBuilder.d.ts +37 -0
- package/dist/src/lib/bondExtraBuilder.d.ts.map +1 -0
- package/dist/src/lib/bondExtraBuilder.js +101 -0
- package/dist/src/lib/constants.d.ts +12 -0
- package/dist/src/lib/constants.d.ts.map +1 -0
- package/dist/src/lib/constants.js +15 -0
- package/dist/src/lib/iface.d.ts +130 -0
- package/dist/src/lib/iface.d.ts.map +1 -0
- package/dist/src/lib/iface.js +38 -0
- package/dist/src/lib/index.d.ts +17 -0
- package/dist/src/lib/index.d.ts.map +1 -0
- package/dist/src/lib/index.js +57 -0
- package/dist/src/lib/preApproveAssetBuilder.d.ts +33 -0
- package/dist/src/lib/preApproveAssetBuilder.d.ts.map +1 -0
- package/dist/src/lib/preApproveAssetBuilder.js +77 -0
- package/dist/src/lib/registerDidWithCDDBuilder.d.ts +34 -0
- package/dist/src/lib/registerDidWithCDDBuilder.d.ts.map +1 -0
- package/dist/src/lib/registerDidWithCDDBuilder.js +83 -0
- package/dist/src/lib/tokenTransferBuilder.d.ts +58 -0
- package/dist/src/lib/tokenTransferBuilder.d.ts.map +1 -0
- package/dist/src/lib/tokenTransferBuilder.js +159 -0
- package/dist/src/lib/transaction.d.ts +22 -0
- package/dist/src/lib/transaction.d.ts.map +1 -0
- package/dist/src/lib/transaction.js +145 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts +34 -0
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -0
- package/dist/src/lib/transactionBuilderFactory.js +124 -0
- package/dist/src/lib/transferBuilder.d.ts +56 -0
- package/dist/src/lib/transferBuilder.d.ts.map +1 -0
- package/dist/src/lib/transferBuilder.js +121 -0
- package/dist/src/lib/txnSchema.d.ts +49 -0
- package/dist/src/lib/txnSchema.d.ts.map +1 -0
- package/dist/src/lib/txnSchema.js +145 -0
- package/dist/src/lib/unbondBuilder.d.ts +37 -0
- package/dist/src/lib/unbondBuilder.d.ts.map +1 -0
- package/dist/src/lib/unbondBuilder.js +98 -0
- package/dist/src/lib/utils.d.ts +19 -0
- package/dist/src/lib/utils.d.ts.map +1 -0
- package/dist/src/lib/utils.js +50 -0
- package/dist/src/lib/withdrawUnbondedBuilder.d.ts +35 -0
- package/dist/src/lib/withdrawUnbondedBuilder.d.ts.map +1 -0
- package/dist/src/lib/withdrawUnbondedBuilder.js +89 -0
- package/dist/src/polyx.d.ts +63 -0
- package/dist/src/polyx.d.ts.map +1 -0
- package/dist/src/polyx.js +305 -0
- package/dist/src/polyxToken.d.ts +20 -0
- package/dist/src/polyxToken.d.ts.map +1 -0
- package/dist/src/polyxToken.js +55 -0
- package/dist/src/register.d.ts +3 -0
- package/dist/src/register.d.ts.map +1 -0
- package/dist/src/register.js +15 -0
- package/dist/src/resources/index.d.ts +3 -0
- package/dist/src/resources/index.d.ts.map +1 -0
- package/dist/src/resources/index.js +19 -0
- package/dist/src/resources/mainnet.d.ts +13 -0
- package/dist/src/resources/mainnet.d.ts.map +1 -0
- package/dist/src/resources/mainnet.js +16 -0
- package/dist/src/resources/testnet.d.ts +13 -0
- package/dist/src/resources/testnet.d.ts.map +1 -0
- package/dist/src/resources/testnet.js +16 -0
- package/dist/src/tpolyx.d.ts +24 -0
- package/dist/src/tpolyx.d.ts.map +1 -0
- package/dist/src/tpolyx.js +40 -0
- package/package.json +59 -0
package/.eslintignore
ADDED
package/.mocharc.yml
ADDED
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,159 @@
|
|
|
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.9.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.9.2...@bitgo/sdk-coin-polyx@1.9.3) (2025-09-03)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
9
|
+
|
|
10
|
+
## [1.9.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.9.1...@bitgo/sdk-coin-polyx@1.9.2) (2025-08-30)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
13
|
+
|
|
14
|
+
## [1.9.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.9.0...@bitgo/sdk-coin-polyx@1.9.1) (2025-08-29)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
17
|
+
|
|
18
|
+
# [1.9.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-polyx@1.8.0...@bitgo/sdk-coin-polyx@1.9.0) (2025-08-27)
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
- **sdk-coin-polyx:** add support for token enablement ([894459a](https://github.com/BitGo/BitGoJS/commit/894459a49848a2b111cf850429cbb2f8b90d550f))
|
|
23
|
+
|
|
24
|
+
# [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)
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
- **root:** migrate ts-node -> tsx ([ea180b4](https://github.com/BitGo/BitGoJS/commit/ea180b43001d8e956196bc07b32798e3a7031eeb))
|
|
29
|
+
|
|
30
|
+
## [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)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
33
|
+
|
|
34
|
+
## [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)
|
|
35
|
+
|
|
36
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
37
|
+
|
|
38
|
+
# [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)
|
|
39
|
+
|
|
40
|
+
### Bug Fixes
|
|
41
|
+
|
|
42
|
+
- **sdk-coin-polyx:** add test token and update the tests ([1f8af7d](https://github.com/BitGo/BitGoJS/commit/1f8af7d620b5d603a4e27c15276f518e6ff4f349))
|
|
43
|
+
|
|
44
|
+
### Features
|
|
45
|
+
|
|
46
|
+
- **sdk-coin-polyx:** add token builders ([6860780](https://github.com/BitGo/BitGoJS/commit/68607804efc1191ff396e05f20466526246b7d87))
|
|
47
|
+
|
|
48
|
+
# [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)
|
|
49
|
+
|
|
50
|
+
### Features
|
|
51
|
+
|
|
52
|
+
- add polyxToken skeleton ([c7be0ef](https://github.com/BitGo/BitGoJS/commit/c7be0efb003c720e9da732b627576336c7fc9e52))
|
|
53
|
+
- **sdk-coin-polyx:** add wrw support ([24ec106](https://github.com/BitGo/BitGoJS/commit/24ec106158e0f7330dc61c467b466904fb9e068b))
|
|
54
|
+
|
|
55
|
+
## [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)
|
|
56
|
+
|
|
57
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
58
|
+
|
|
59
|
+
## [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)
|
|
60
|
+
|
|
61
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
62
|
+
|
|
63
|
+
## [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)
|
|
64
|
+
|
|
65
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
66
|
+
|
|
67
|
+
## [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)
|
|
68
|
+
|
|
69
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
70
|
+
|
|
71
|
+
## [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)
|
|
72
|
+
|
|
73
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
74
|
+
|
|
75
|
+
## [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)
|
|
76
|
+
|
|
77
|
+
### Bug Fixes
|
|
78
|
+
|
|
79
|
+
- **sdk-coin-polyx:** add mainnet address format ([4d02932](https://github.com/BitGo/BitGoJS/commit/4d02932045d5d6f02a9127cb189a5e71dc803f38))
|
|
80
|
+
|
|
81
|
+
# [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)
|
|
82
|
+
|
|
83
|
+
### Features
|
|
84
|
+
|
|
85
|
+
- **sdk-coin-polyx:** implement unbond builder ([4d449f7](https://github.com/BitGo/BitGoJS/commit/4d449f71685856a20b47cbf5eb561999b71986e5))
|
|
86
|
+
|
|
87
|
+
## [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)
|
|
88
|
+
|
|
89
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
90
|
+
|
|
91
|
+
## [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)
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
- decoding logic to differentiate b/w stake and unstake batch ([2d82c4e](https://github.com/BitGo/BitGoJS/commit/2d82c4e572c94cb5b770301428c107da22f84448))
|
|
96
|
+
- **sdk-coin-polyx:** add address format for polyx and tpolyx ([7748439](https://github.com/BitGo/BitGoJS/commit/774843999a56b793775f119c0f3a4f6a49d40a73))
|
|
97
|
+
|
|
98
|
+
# [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)
|
|
99
|
+
|
|
100
|
+
### Features
|
|
101
|
+
|
|
102
|
+
- add decoding support for polyx staking related txns ([f680b01](https://github.com/BitGo/BitGoJS/commit/f680b011c6c89b4c3c04ede21f089e8efc1c0ee8))
|
|
103
|
+
|
|
104
|
+
## [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)
|
|
105
|
+
|
|
106
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
107
|
+
|
|
108
|
+
# [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)
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
- add batchStakingBuilder (bond and nominate) and bondExtraBuilder for polyx ([cd29662](https://github.com/BitGo/BitGoJS/commit/cd296620fb013ebd48ec89bb4bcf1bf0433ec7d4))
|
|
113
|
+
- add batchUnstakingBuilder and withdrawUnbondedBuilder ([d86c459](https://github.com/BitGo/BitGoJS/commit/d86c459f1c42c1d5cbf93b7ba408760b617bf328))
|
|
114
|
+
- **root:** support node 22 ([c4ad6af](https://github.com/BitGo/BitGoJS/commit/c4ad6af2e8896221417c303f0f6b84652b493216))
|
|
115
|
+
|
|
116
|
+
# [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)
|
|
117
|
+
|
|
118
|
+
### Bug Fixes
|
|
119
|
+
|
|
120
|
+
- **sdk-coin-polyx:** fix to toJson method in polyx transaction ([8f8ef0b](https://github.com/BitGo/BitGoJS/commit/8f8ef0b8fa420dadb41989465b2380af73466ae0))
|
|
121
|
+
|
|
122
|
+
### Features
|
|
123
|
+
|
|
124
|
+
- rename audit function naming and signature ([1a885ab](https://github.com/BitGo/BitGoJS/commit/1a885ab60d30ca8595e284a728f2ab9d3c09994e))
|
|
125
|
+
|
|
126
|
+
## [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)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
129
|
+
|
|
130
|
+
## [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)
|
|
131
|
+
|
|
132
|
+
### Bug Fixes
|
|
133
|
+
|
|
134
|
+
- **sdk-coin-polyx:** all fixed ([f9c23bc](https://github.com/BitGo/BitGoJS/commit/f9c23bc9a8bc609be5f41a4ffd980138ecb63148))
|
|
135
|
+
- **sdk-coin-polyx:** fix cdd builder ([2461fbf](https://github.com/BitGo/BitGoJS/commit/2461fbfcc76f8f6e7f89302f5e3c4b99097cb97a))
|
|
136
|
+
|
|
137
|
+
# [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)
|
|
138
|
+
|
|
139
|
+
### Features
|
|
140
|
+
|
|
141
|
+
- **sdk-coin-polyx:** add transaction builders ([31c96bb](https://github.com/BitGo/BitGoJS/commit/31c96bbbce60b93e13208e3eab06bd144cfe57e4))
|
|
142
|
+
|
|
143
|
+
## [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)
|
|
144
|
+
|
|
145
|
+
### Bug Fixes
|
|
146
|
+
|
|
147
|
+
- send statics coin to substrate class ([9ed860e](https://github.com/BitGo/BitGoJS/commit/9ed860ed288516959d5723e6119c7701588a41e7))
|
|
148
|
+
|
|
149
|
+
## [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)
|
|
150
|
+
|
|
151
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
152
|
+
|
|
153
|
+
## [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)
|
|
154
|
+
|
|
155
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
|
156
|
+
|
|
157
|
+
## 1.0.1 (2025-04-15)
|
|
158
|
+
|
|
159
|
+
**Note:** Version bump only for package @bitgo/sdk-coin-polyx
|
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2022 BitGo
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# BitGo sdk-coin-polyx
|
|
2
|
+
|
|
3
|
+
SDK coins provide a modular approach to a monolithic architecture. This and all BitGoJS SDK coins allow developers to use only the coins needed for a given project.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
All coins are loaded traditionally through the `bitgo` package. If you are using coins individually, you will be accessing the coin via the `@bitgo/sdk-api` package.
|
|
8
|
+
|
|
9
|
+
In your project install both `@bitgo/sdk-api` and `@bitgo/sdk-coin-polyx`.
|
|
10
|
+
|
|
11
|
+
```shell
|
|
12
|
+
npm i @bitgo/sdk-api @bitgo/sdk-coin-polyx
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of `bitgo`.
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
import { BitGoAPI } from '@bitgo/sdk-api';
|
|
19
|
+
import { Polyx } from '@bitgo/sdk-coin-polyx';
|
|
20
|
+
|
|
21
|
+
const sdk = new BitGoAPI();
|
|
22
|
+
|
|
23
|
+
sdk.register('polyx', Polyx.createInstance);
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Development
|
|
27
|
+
|
|
28
|
+
Most of the coin implementations are derived from `@bitgo/sdk-core`, `@bitgo/statics`, and coin specific packages. These implementations are used to interact with the BitGo API and BitGo platform services.
|
|
29
|
+
|
|
30
|
+
You will notice that the basic version of common class extensions have been provided to you and must be resolved before the package build will succeed. Upon initiation of a given SDK coin, you will need to verify that your coin has been included in the root `tsconfig.packages.json` and that the linting, formatting, and testing succeeds when run both within the coin and from the root of BitGoJS.
|
|
@@ -0,0 +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;AACzB,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./lib"), exports);
|
|
18
|
+
__exportStar(require("./register"), exports);
|
|
19
|
+
__exportStar(require("./polyx"), exports);
|
|
20
|
+
__exportStar(require("./tpolyx"), exports);
|
|
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZUJ1aWxkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2Jhc2VCdWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHVFQUFvRTtBQUNwRSwrQ0FBNEM7QUFLNUMsb0RBQTRCO0FBRTVCOzs7R0FHRztBQUNILE1BQXNCLGdCQUFvRSxTQUFRLHVDQUdqRztJQUNDLFlBQVksV0FBaUM7UUFDM0MsS0FBSyxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ25CLHdFQUF3RTtRQUN4RSxJQUFJLENBQUMsWUFBWSxHQUFHLElBQUkseUJBQVcsQ0FBQyxXQUFXLENBQU0sQ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lvblR5cGUoKTogVHJhbnNhY3Rpb25UeXBlO1xuICBhYnN0cmFjdCB2YWxpZGF0ZURlY29kZWRUcmFuc2FjdGlvbihcbiAgICBkZWNvZGVkVHhuOiBEZWNvZGVkU2lnbmluZ1BheWxvYWQgfCBEZWNvZGVkU2lnbmVkVHgsXG4gICAgcmF3VHJhbnNhY3Rpb24/OiBzdHJpbmdcbiAgKTogdm9pZDtcbn1cbiJdfQ==
|
|
@@ -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,W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