@bitgo-beta/abstract-substrate 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.
Files changed (49) hide show
  1. package/.eslintignore +5 -0
  2. package/.mocharc.yml +8 -0
  3. package/CHANGELOG.md +234 -0
  4. package/LICENSE +191 -0
  5. package/README.md +1 -0
  6. package/dist/src/abstractSubstrateCoin.d.ts +95 -0
  7. package/dist/src/abstractSubstrateCoin.d.ts.map +1 -0
  8. package/dist/src/abstractSubstrateCoin.js +435 -0
  9. package/dist/src/index.d.ts +3 -0
  10. package/dist/src/index.d.ts.map +1 -0
  11. package/dist/src/index.js +21 -0
  12. package/dist/src/lib/constants.d.ts +2 -0
  13. package/dist/src/lib/constants.d.ts.map +1 -0
  14. package/dist/src/lib/constants.js +5 -0
  15. package/dist/src/lib/errors.d.ts +8 -0
  16. package/dist/src/lib/errors.d.ts.map +1 -0
  17. package/dist/src/lib/errors.js +19 -0
  18. package/dist/src/lib/iface.d.ts +250 -0
  19. package/dist/src/lib/iface.d.ts.map +1 -0
  20. package/dist/src/lib/iface.js +83 -0
  21. package/dist/src/lib/index.d.ts +12 -0
  22. package/dist/src/lib/index.d.ts.map +1 -0
  23. package/dist/src/lib/index.js +61 -0
  24. package/dist/src/lib/keyPair.d.ts +31 -0
  25. package/dist/src/lib/keyPair.d.ts.map +1 -0
  26. package/dist/src/lib/keyPair.js +110 -0
  27. package/dist/src/lib/nativeTransferBuilder.d.ts +61 -0
  28. package/dist/src/lib/nativeTransferBuilder.d.ts.map +1 -0
  29. package/dist/src/lib/nativeTransferBuilder.js +150 -0
  30. package/dist/src/lib/singletonRegistry.d.ts +8 -0
  31. package/dist/src/lib/singletonRegistry.d.ts.map +1 -0
  32. package/dist/src/lib/singletonRegistry.js +20 -0
  33. package/dist/src/lib/transaction.d.ts +74 -0
  34. package/dist/src/lib/transaction.d.ts.map +1 -0
  35. package/dist/src/lib/transaction.js +553 -0
  36. package/dist/src/lib/transactionBuilder.d.ts +121 -0
  37. package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
  38. package/dist/src/lib/transactionBuilder.js +334 -0
  39. package/dist/src/lib/transferBuilder.d.ts +6 -0
  40. package/dist/src/lib/transferBuilder.d.ts.map +1 -0
  41. package/dist/src/lib/transferBuilder.js +11 -0
  42. package/dist/src/lib/txnSchema.d.ts +12 -0
  43. package/dist/src/lib/txnSchema.d.ts.map +1 -0
  44. package/dist/src/lib/txnSchema.js +71 -0
  45. package/dist/src/lib/utils.d.ts +139 -0
  46. package/dist/src/lib/utils.d.ts.map +1 -0
  47. package/dist/src/lib/utils.js +281 -0
  48. package/dist/tsconfig.tsbuildinfo +1 -0
  49. package/package.json +60 -0
package/.eslintignore ADDED
@@ -0,0 +1,5 @@
1
+ node_modules
2
+ .idea
3
+ public
4
+ dist
5
+ resources
package/.mocharc.yml ADDED
@@ -0,0 +1,8 @@
1
+ require: 'tsx'
2
+ timeout: '60000'
3
+ reporter: 'min'
4
+ reporter-option:
5
+ - 'cdn=true'
6
+ - 'json=false'
7
+ exit: true
8
+ spec: ['test/unit/**/*.ts']
package/CHANGELOG.md ADDED
@@ -0,0 +1,234 @@
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.10.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.10.3...@bitgo/abstract-substrate@1.10.4) (2025-09-03)
7
+
8
+ **Note:** Version bump only for package @bitgo/abstract-substrate
9
+
10
+ ## [1.10.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.10.2...@bitgo/abstract-substrate@1.10.3) (2025-08-30)
11
+
12
+ **Note:** Version bump only for package @bitgo/abstract-substrate
13
+
14
+ ## [1.10.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.10.1...@bitgo/abstract-substrate@1.10.2) (2025-08-29)
15
+
16
+ **Note:** Version bump only for package @bitgo/abstract-substrate
17
+
18
+ ## [1.10.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.10.0...@bitgo/abstract-substrate@1.10.1) (2025-08-27)
19
+
20
+ **Note:** Version bump only for package @bitgo/abstract-substrate
21
+
22
+ # [1.10.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.9.2...@bitgo/abstract-substrate@1.10.0) (2025-08-22)
23
+
24
+ ### Features
25
+
26
+ - **root:** migrate ts-node -> tsx ([ea180b4](https://github.com/BitGo/BitGoJS/commit/ea180b43001d8e956196bc07b32798e3a7031eeb))
27
+
28
+ ## [1.9.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.9.1...@bitgo/abstract-substrate@1.9.2) (2025-08-22)
29
+
30
+ **Note:** Version bump only for package @bitgo/abstract-substrate
31
+
32
+ ## [1.9.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.9.0...@bitgo/abstract-substrate@1.9.1) (2025-08-19)
33
+
34
+ **Note:** Version bump only for package @bitgo/abstract-substrate
35
+
36
+ # [1.9.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.10...@bitgo/abstract-substrate@1.9.0) (2025-08-14)
37
+
38
+ ### Features
39
+
40
+ - **sdk-coin-polyx:** add token builders ([6860780](https://github.com/BitGo/BitGoJS/commit/68607804efc1191ff396e05f20466526246b7d87))
41
+ - **sdk-coin-tao:** add tokenTransferBuilder ([43fc839](https://github.com/BitGo/BitGoJS/commit/43fc839f87e81d2592bcd249b14d7aef815a0927))
42
+
43
+ ## [1.8.10](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.9...@bitgo/abstract-substrate@1.8.10) (2025-08-07)
44
+
45
+ **Note:** Version bump only for package @bitgo/abstract-substrate
46
+
47
+ ## [1.8.9](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.8...@bitgo/abstract-substrate@1.8.9) (2025-07-31)
48
+
49
+ **Note:** Version bump only for package @bitgo/abstract-substrate
50
+
51
+ ## [1.8.8](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.7...@bitgo/abstract-substrate@1.8.8) (2025-07-30)
52
+
53
+ **Note:** Version bump only for package @bitgo/abstract-substrate
54
+
55
+ ## [1.8.7](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.5...@bitgo/abstract-substrate@1.8.7) (2025-07-25)
56
+
57
+ **Note:** Version bump only for package @bitgo/abstract-substrate
58
+
59
+ ## [1.8.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.5...@bitgo/abstract-substrate@1.8.6) (2025-07-23)
60
+
61
+ **Note:** Version bump only for package @bitgo/abstract-substrate
62
+
63
+ ## [1.8.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.4...@bitgo/abstract-substrate@1.8.5) (2025-07-15)
64
+
65
+ **Note:** Version bump only for package @bitgo/abstract-substrate
66
+
67
+ ## [1.8.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.3...@bitgo/abstract-substrate@1.8.4) (2025-07-10)
68
+
69
+ **Note:** Version bump only for package @bitgo/abstract-substrate
70
+
71
+ ## [1.8.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.2...@bitgo/abstract-substrate@1.8.3) (2025-07-03)
72
+
73
+ **Note:** Version bump only for package @bitgo/abstract-substrate
74
+
75
+ ## [1.8.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.1...@bitgo/abstract-substrate@1.8.2) (2025-06-25)
76
+
77
+ **Note:** Version bump only for package @bitgo/abstract-substrate
78
+
79
+ ## [1.8.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.8.0...@bitgo/abstract-substrate@1.8.1) (2025-06-24)
80
+
81
+ **Note:** Version bump only for package @bitgo/abstract-substrate
82
+
83
+ # [1.8.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.7.1...@bitgo/abstract-substrate@1.8.0) (2025-06-18)
84
+
85
+ ### Features
86
+
87
+ - add decoding support for polyx staking related txns ([f680b01](https://github.com/BitGo/BitGoJS/commit/f680b011c6c89b4c3c04ede21f089e8efc1c0ee8))
88
+
89
+ ## [1.7.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.7.0...@bitgo/abstract-substrate@1.7.1) (2025-06-10)
90
+
91
+ **Note:** Version bump only for package @bitgo/abstract-substrate
92
+
93
+ # [1.7.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.6.0...@bitgo/abstract-substrate@1.7.0) (2025-06-05)
94
+
95
+ ### Features
96
+
97
+ - **root:** support node 22 ([c4ad6af](https://github.com/BitGo/BitGoJS/commit/c4ad6af2e8896221417c303f0f6b84652b493216))
98
+
99
+ # [1.6.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.5.2...@bitgo/abstract-substrate@1.6.0) (2025-06-02)
100
+
101
+ ### Bug Fixes
102
+
103
+ - **sdk-coin-polyx:** fix to toJson method in polyx transaction ([8f8ef0b](https://github.com/BitGo/BitGoJS/commit/8f8ef0b8fa420dadb41989465b2380af73466ae0))
104
+
105
+ ### Features
106
+
107
+ - rename audit function naming and signature ([1a885ab](https://github.com/BitGo/BitGoJS/commit/1a885ab60d30ca8595e284a728f2ab9d3c09994e))
108
+ - **root:** add new audit key baseCoin method ([57c1778](https://github.com/BitGo/BitGoJS/commit/57c17784a72ea364f18e3af9dbd83da877827e69))
109
+
110
+ ## [1.5.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.5.1...@bitgo/abstract-substrate@1.5.2) (2025-05-28)
111
+
112
+ **Note:** Version bump only for package @bitgo/abstract-substrate
113
+
114
+ ## [1.5.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.5.0...@bitgo/abstract-substrate@1.5.1) (2025-05-22)
115
+
116
+ ### Bug Fixes
117
+
118
+ - **sdk-coin-polyx:** all fixed ([f9c23bc](https://github.com/BitGo/BitGoJS/commit/f9c23bc9a8bc609be5f41a4ffd980138ecb63148))
119
+ - **sdk-coin-polyx:** fix cdd builder ([2461fbf](https://github.com/BitGo/BitGoJS/commit/2461fbfcc76f8f6e7f89302f5e3c4b99097cb97a))
120
+
121
+ # [1.5.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.9...@bitgo/abstract-substrate@1.5.0) (2025-05-20)
122
+
123
+ ### Features
124
+
125
+ - **sdk-coin-polyx:** add transaction builders ([31c96bb](https://github.com/BitGo/BitGoJS/commit/31c96bbbce60b93e13208e3eab06bd144cfe57e4))
126
+
127
+ ## [1.4.9](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.8...@bitgo/abstract-substrate@1.4.9) (2025-05-07)
128
+
129
+ **Note:** Version bump only for package @bitgo/abstract-substrate
130
+
131
+ ## [1.4.8](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.7...@bitgo/abstract-substrate@1.4.8) (2025-04-29)
132
+
133
+ **Note:** Version bump only for package @bitgo/abstract-substrate
134
+
135
+ ## [1.4.7](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.6...@bitgo/abstract-substrate@1.4.7) (2025-04-25)
136
+
137
+ **Note:** Version bump only for package @bitgo/abstract-substrate
138
+
139
+ ## [1.4.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.5...@bitgo/abstract-substrate@1.4.6) (2025-04-15)
140
+
141
+ **Note:** Version bump only for package @bitgo/abstract-substrate
142
+
143
+ ## [1.4.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.4...@bitgo/abstract-substrate@1.4.5) (2025-04-04)
144
+
145
+ **Note:** Version bump only for package @bitgo/abstract-substrate
146
+
147
+ ## [1.4.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.3...@bitgo/abstract-substrate@1.4.4) (2025-04-02)
148
+
149
+ **Note:** Version bump only for package @bitgo/abstract-substrate
150
+
151
+ ## [1.4.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.2...@bitgo/abstract-substrate@1.4.3) (2025-03-28)
152
+
153
+ **Note:** Version bump only for package @bitgo/abstract-substrate
154
+
155
+ ## [1.4.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.1...@bitgo/abstract-substrate@1.4.2) (2025-03-20)
156
+
157
+ **Note:** Version bump only for package @bitgo/abstract-substrate
158
+
159
+ ## [1.4.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.4.0...@bitgo/abstract-substrate@1.4.1) (2025-03-18)
160
+
161
+ ### Bug Fixes
162
+
163
+ - **sdk-core:** set default multisig if empty ([e2727df](https://github.com/BitGo/BitGoJS/commit/e2727dfc89dd314a607b737e761e5eff824606af))
164
+
165
+ # [1.4.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.3.0...@bitgo/abstract-substrate@1.4.0) (2025-03-06)
166
+
167
+ ### Features
168
+
169
+ - **abstract-substrate:** add wrw for tao ([9f30890](https://github.com/BitGo/BitGoJS/commit/9f3089000330d47696ab057891cd8d1083004a2a))
170
+
171
+ # [1.3.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.5...@bitgo/abstract-substrate@1.3.0) (2025-03-04)
172
+
173
+ ### Bug Fixes
174
+
175
+ - **sdk-coin-tao:** change amount and netuid type to string ([bbb92aa](https://github.com/BitGo/BitGoJS/commit/bbb92aa3e9def1e6260a074761cdf4a38888ebd6))
176
+
177
+ ### Features
178
+
179
+ - **abstract-substrate:** add common types to abstract-substrate ([6298a42](https://github.com/BitGo/BitGoJS/commit/6298a42c0b476e87b3a5e0a3cd5e57cc5c262f50))
180
+ - **abstract-substrate:** add missing methods for TAO stake/unstake ([635854c](https://github.com/BitGo/BitGoJS/commit/635854cbd04f473c20d20820d03d1b82f8d013e9))
181
+
182
+ # [1.2.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.5...@bitgo/abstract-substrate@1.2.0) (2025-02-26)
183
+
184
+ ### Features
185
+
186
+ - **abstract-substrate:** add common types to abstract-substrate ([6298a42](https://github.com/BitGo/BitGoJS/commit/6298a42c0b476e87b3a5e0a3cd5e57cc5c262f50))
187
+ - **abstract-substrate:** add missing methods for TAO stake/unstake ([635854c](https://github.com/BitGo/BitGoJS/commit/635854cbd04f473c20d20820d03d1b82f8d013e9))
188
+
189
+ ## [1.1.6](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.5...@bitgo/abstract-substrate@1.1.6) (2025-02-20)
190
+
191
+ **Note:** Version bump only for package @bitgo/abstract-substrate
192
+
193
+ ## [1.1.5](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.3...@bitgo/abstract-substrate@1.1.5) (2025-02-19)
194
+
195
+ ### Bug Fixes
196
+
197
+ - **abstract-substrate:** fix abstract-substrate implementation ([1c986da](https://github.com/BitGo/BitGoJS/commit/1c986daa817353ca522c0e8e72e67a6dffa00fac))
198
+ - **abstract-substrate:** fix Material specName type ([2971d82](https://github.com/BitGo/BitGoJS/commit/2971d82879879c04190b45454a21f48473d13181))
199
+ - **abstract-substrate:** use correct error for isWalletAddress ([f50c557](https://github.com/BitGo/BitGoJS/commit/f50c557df66a331b30c1a790884ab1d69b635390))
200
+
201
+ ## [1.1.4](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.3...@bitgo/abstract-substrate@1.1.4) (2025-02-11)
202
+
203
+ ### Bug Fixes
204
+
205
+ - **abstract-substrate:** fix abstract-substrate implementation ([1c986da](https://github.com/BitGo/BitGoJS/commit/1c986daa817353ca522c0e8e72e67a6dffa00fac))
206
+ - **abstract-substrate:** fix Material specName type ([2971d82](https://github.com/BitGo/BitGoJS/commit/2971d82879879c04190b45454a21f48473d13181))
207
+
208
+ ## [1.1.3](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.2...@bitgo/abstract-substrate@1.1.3) (2025-02-05)
209
+
210
+ **Note:** Version bump only for package @bitgo/abstract-substrate
211
+
212
+ ## [1.1.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.1...@bitgo/abstract-substrate@1.1.2) (2025-01-28)
213
+
214
+ **Note:** Version bump only for package @bitgo/abstract-substrate
215
+
216
+ ## [1.1.1](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.1.0...@bitgo/abstract-substrate@1.1.1) (2025-01-23)
217
+
218
+ **Note:** Version bump only for package @bitgo/abstract-substrate
219
+
220
+ # [1.1.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.0.2...@bitgo/abstract-substrate@1.1.0) (2025-01-23)
221
+
222
+ ### Features
223
+
224
+ - implement abstract substrate functions ([20d831b](https://github.com/BitGo/BitGoJS/commit/20d831b3be8a2cb987eda6e842b6f1db34067c17))
225
+
226
+ ## [1.0.2](https://github.com/BitGo/BitGoJS/compare/@bitgo/abstract-substrate@1.0.1...@bitgo/abstract-substrate@1.0.2) (2025-01-20)
227
+
228
+ **Note:** Version bump only for package @bitgo/abstract-substrate
229
+
230
+ ## 1.0.1 (2025-01-15)
231
+
232
+ ### Bug Fixes
233
+
234
+ - **abstract-substrate:** fix package.json bitgo libs version ([1ed939b](https://github.com/BitGo/BitGoJS/commit/1ed939b3bbb469b40d0e1759ea229891e765f933))
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 @@
1
+ # BitGo abstract-substrate
@@ -0,0 +1,95 @@
1
+ import { AuditDecryptedKeyParams, BaseCoin, BitGoBase, KeyPair, MPCAlgorithm, MPCConsolidationRecoveryOptions, MPCRecoveryOptions, MPCSweepRecoveryOptions, MPCSweepTxs, MPCTx, MPCTxs, MultisigType, ParsedTransaction, ParseTransactionOptions, SignedTransaction, VerifyAddressOptions, VerifyTransactionOptions } from '@bitgo-beta/sdk-core';
2
+ import { CoinFamily, BaseCoin as StaticsBaseCoin } from '@bitgo-beta/statics';
3
+ import { SignTransactionOptions, VerifiedTransactionParameters, Material } from './lib/iface';
4
+ import { ApiPromise } from '@polkadot/api';
5
+ export declare const DEFAULT_SCAN_FACTOR = 20;
6
+ export declare class SubstrateCoin extends BaseCoin {
7
+ protected readonly _staticsCoin: Readonly<StaticsBaseCoin>;
8
+ readonly MAX_VALIDITY_DURATION = 2400;
9
+ readonly SWEEP_TXN_DURATION = 64;
10
+ protected constructor(bitgo: BitGoBase, staticsCoin?: Readonly<StaticsBaseCoin>);
11
+ /**
12
+ * Creates an instance of TransactionBuilderFactory for the coin specific sdk
13
+ */
14
+ getBuilder(): any;
15
+ /** @inheritDoc **/
16
+ getBaseFactor(): string | number;
17
+ /** @inheritDoc **/
18
+ getChain(): string;
19
+ /** @inheritDoc **/
20
+ getFamily(): CoinFamily;
21
+ /** @inheritDoc **/
22
+ getFullName(): string;
23
+ /** @inheritDoc */
24
+ supportsTss(): boolean;
25
+ /** inherited doc */
26
+ getDefaultMultisigType(): MultisigType;
27
+ /** @inheritDoc **/
28
+ getMPCAlgorithm(): MPCAlgorithm;
29
+ /** @inheritDoc **/
30
+ generateKeyPair(seed?: Buffer): KeyPair;
31
+ /** @inheritDoc **/
32
+ isValidPub(pub: string): boolean;
33
+ /** @inheritDoc **/
34
+ isWalletAddress(params: VerifyAddressOptions): Promise<boolean>;
35
+ /** @inheritDoc **/
36
+ parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction>;
37
+ /** @inheritDoc **/
38
+ verifyTransaction(params: VerifyTransactionOptions): Promise<boolean>;
39
+ /** @inheritDoc **/
40
+ isValidAddress(address: string): boolean;
41
+ verifySignTransactionParams(params: SignTransactionOptions): VerifiedTransactionParameters;
42
+ /** @inheritDoc **/
43
+ signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
44
+ /**
45
+ * Retrieves the address format for the substrate coin.
46
+ *
47
+ * @returns {number} The address format as a number.
48
+ */
49
+ protected getAddressFormat(): number;
50
+ /**
51
+ * Retrieves the maximum validity duration in blocks.
52
+ *
53
+ * This method is intended to be overridden by subclasses to provide the specific
54
+ * maximum validity duration for different types of Substrate-based coins.
55
+ *
56
+ * @returns {number} The maximum validity duration in blocks.
57
+ * @throws {Error} If the method is not implemented by the subclass.
58
+ */
59
+ protected getMaxValidityDurationBlocks(): number;
60
+ protected getAddressFromPublicKey(Pubkey: string): string;
61
+ protected getInitializedNodeAPI(): Promise<ApiPromise>;
62
+ protected getAccountInfo(walletAddr: string): Promise<{
63
+ nonce: number;
64
+ freeBalance: number;
65
+ }>;
66
+ protected getFee(destAddr: string, srcAddr: string, amount: number): Promise<number>;
67
+ protected getHeaderInfo(): Promise<{
68
+ headerNumber: number;
69
+ headerHash: string;
70
+ }>;
71
+ protected getMaterial(): Promise<Material>;
72
+ /**
73
+ * Builds a funds recovery transaction without BitGo
74
+ * @param {MPCRecoveryOptions} params parameters needed to construct and
75
+ * (maybe) sign the transaction
76
+ *
77
+ * @returns {MPCTx} the serialized transaction hex string and index
78
+ * of the address being swept
79
+ */
80
+ recover(params: MPCRecoveryOptions): Promise<MPCTx | MPCSweepTxs>;
81
+ /**
82
+ * Builds native TAO recoveries of receive addresses in batch without BitGo.
83
+ * Funds will be recovered to base address first. You need to initiate another sweep txn after that.
84
+ *
85
+ * @param {MPCConsolidationRecoveryOptions} params - options for consolidation recovery.
86
+ * @param {string} [params.startingScanIndex] - receive address index to start scanning from. default to 1 (inclusive).
87
+ * @param {string} [params.endingScanIndex] - receive address index to end scanning at. default to startingScanIndex + 20 (exclusive).
88
+ */
89
+ recoverConsolidations(params: MPCConsolidationRecoveryOptions): Promise<MPCTxs | MPCSweepTxs>;
90
+ /** inherited doc */
91
+ createBroadcastableSweepTransaction(params: MPCSweepRecoveryOptions): Promise<MPCTxs>;
92
+ /** inherited doc */
93
+ auditDecryptedKey({ publicKey, prv, multiSigType }: AuditDecryptedKeyParams): void;
94
+ }
95
+ //# sourceMappingURL=abstractSubstrateCoin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"abstractSubstrateCoin.d.ts","sourceRoot":"","sources":["../../src/abstractS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