@bitgo-beta/sdk-coin-algo 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 (67) hide show
  1. package/.eslintignore +5 -0
  2. package/.mocharc.yml +8 -0
  3. package/CHANGELOG.md +854 -0
  4. package/LICENSE +191 -0
  5. package/README.md +30 -0
  6. package/dist/src/algo.d.ts +291 -0
  7. package/dist/src/algo.d.ts.map +1 -0
  8. package/dist/src/algo.js +637 -0
  9. package/dist/src/algoToken.d.ts +32 -0
  10. package/dist/src/algoToken.d.ts.map +1 -0
  11. package/dist/src/algoToken.js +82 -0
  12. package/dist/src/builder.d.ts +3 -0
  13. package/dist/src/builder.d.ts.map +1 -0
  14. package/dist/src/builder.js +10 -0
  15. package/dist/src/index.d.ts +6 -0
  16. package/dist/src/index.d.ts.map +1 -0
  17. package/dist/src/index.js +45 -0
  18. package/dist/src/lib/assetTransferBuilder.d.ts +42 -0
  19. package/dist/src/lib/assetTransferBuilder.d.ts.map +1 -0
  20. package/dist/src/lib/assetTransferBuilder.js +105 -0
  21. package/dist/src/lib/errors.d.ts +11 -0
  22. package/dist/src/lib/errors.d.ts.map +1 -0
  23. package/dist/src/lib/errors.js +27 -0
  24. package/dist/src/lib/ifaces.d.ts +45 -0
  25. package/dist/src/lib/ifaces.d.ts.map +1 -0
  26. package/dist/src/lib/ifaces.js +3 -0
  27. package/dist/src/lib/index.d.ts +13 -0
  28. package/dist/src/lib/index.d.ts.map +1 -0
  29. package/dist/src/lib/index.js +61 -0
  30. package/dist/src/lib/keyPair.d.ts +25 -0
  31. package/dist/src/lib/keyPair.d.ts.map +1 -0
  32. package/dist/src/lib/keyPair.js +91 -0
  33. package/dist/src/lib/keyRegistrationBuilder.d.ts +104 -0
  34. package/dist/src/lib/keyRegistrationBuilder.d.ts.map +1 -0
  35. package/dist/src/lib/keyRegistrationBuilder.js +240 -0
  36. package/dist/src/lib/seedEncoding.d.ts +25 -0
  37. package/dist/src/lib/seedEncoding.d.ts.map +1 -0
  38. package/dist/src/lib/seedEncoding.js +111 -0
  39. package/dist/src/lib/transaction.d.ts +75 -0
  40. package/dist/src/lib/transaction.d.ts.map +1 -0
  41. package/dist/src/lib/transaction.js +250 -0
  42. package/dist/src/lib/transactionBuilder.d.ts +210 -0
  43. package/dist/src/lib/transactionBuilder.d.ts.map +1 -0
  44. package/dist/src/lib/transactionBuilder.js +389 -0
  45. package/dist/src/lib/transactionBuilderFactory.d.ts +16 -0
  46. package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -0
  47. package/dist/src/lib/transactionBuilderFactory.js +52 -0
  48. package/dist/src/lib/transferBuilder.d.ts +40 -0
  49. package/dist/src/lib/transferBuilder.d.ts.map +1 -0
  50. package/dist/src/lib/transferBuilder.js +89 -0
  51. package/dist/src/lib/txnSchema.d.ts +7 -0
  52. package/dist/src/lib/txnSchema.d.ts.map +1 -0
  53. package/dist/src/lib/txnSchema.js +68 -0
  54. package/dist/src/lib/utils.d.ts +254 -0
  55. package/dist/src/lib/utils.d.ts.map +1 -0
  56. package/dist/src/lib/utils.js +563 -0
  57. package/dist/src/register.d.ts +3 -0
  58. package/dist/src/register.d.ts.map +1 -0
  59. package/dist/src/register.js +15 -0
  60. package/dist/src/seedValidator.d.ts +31 -0
  61. package/dist/src/seedValidator.d.ts.map +1 -0
  62. package/dist/src/seedValidator.js +103 -0
  63. package/dist/src/talgo.d.ts +12 -0
  64. package/dist/src/talgo.d.ts.map +1 -0
  65. package/dist/src/talgo.js +20 -0
  66. package/package.json +63 -0
  67. package/types/index.d.ts +60 -0
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-algo
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-algo`.
10
+
11
+ ```shell
12
+ npm i @bitgo/sdk-api @bitgo/sdk-coin-algo
13
+ ```
14
+
15
+ Next, you will be able to initialize an instance of "bitgo" through `@bitgo/sdk-api` instead of via `bitgo`.
16
+
17
+ ```javascript
18
+ import { BitGoAPI } from '@bitgo/sdk-api';
19
+ import { Algo } from '@bitgo/sdk-coin-algo';
20
+
21
+ const sdk = new BitGoAPI();
22
+
23
+ sdk.register('algo', Algo.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,291 @@
1
+ import { AddressCoinSpecific, BaseBroadcastTransactionOptions, BaseBroadcastTransactionResult, BaseCoin, BitGoBase, KeyPair, ParsedTransaction, ParseTransactionOptions, SignedTransaction, SignTransactionOptions as BaseSignTransactionOptions, TokenManagementType, TransactionExplanation, VerifyAddressOptions, VerifyTransactionOptions, MultisigType, AuditDecryptedKeyParams } from '@bitgo-beta/sdk-core';
2
+ import * as algosdk from 'algosdk';
3
+ import { Buffer } from 'buffer';
4
+ export interface AlgoAddressCoinSpecifics extends AddressCoinSpecific {
5
+ rootAddress: string;
6
+ bitgoKey: string;
7
+ bitgoPubKey?: string;
8
+ addressVersion: number;
9
+ threshold: number;
10
+ }
11
+ export interface VerifyAlgoAddressOptions extends VerifyAddressOptions {
12
+ chain: number;
13
+ index: number;
14
+ coin: string;
15
+ wallet: string;
16
+ coinSpecific: AlgoAddressCoinSpecifics;
17
+ }
18
+ export interface AlgoTransactionExplanation extends TransactionExplanation {
19
+ memo?: string;
20
+ type?: string | number;
21
+ voteKey?: string;
22
+ selectionKey?: string;
23
+ voteFirst?: number;
24
+ voteLast?: number;
25
+ voteKeyDilution?: number;
26
+ tokenId?: number;
27
+ operations?: TransactionOperation[];
28
+ }
29
+ export interface TransactionOperation {
30
+ type: string;
31
+ coin: string;
32
+ }
33
+ export interface SignTransactionOptions extends BaseSignTransactionOptions {
34
+ txPrebuild: TransactionPrebuild;
35
+ prv: string;
36
+ }
37
+ export interface TransactionPrebuild {
38
+ txHex: string;
39
+ halfSigned?: {
40
+ txHex: string;
41
+ };
42
+ txInfo: {
43
+ from: string;
44
+ to: string;
45
+ amount: string;
46
+ fee: number;
47
+ firstRound: number;
48
+ lastRound: number;
49
+ genesisID: string;
50
+ genesisHash: string;
51
+ note?: string;
52
+ };
53
+ keys: string[];
54
+ addressVersion: number;
55
+ }
56
+ export interface FullySignedTransaction {
57
+ txHex: string;
58
+ }
59
+ export interface HalfSignedTransaction {
60
+ halfSigned: {
61
+ txHex: string;
62
+ };
63
+ }
64
+ export interface TransactionFee {
65
+ fee: string;
66
+ }
67
+ export interface ExplainTransactionOptions {
68
+ txHex?: string;
69
+ halfSigned?: {
70
+ txHex: string;
71
+ };
72
+ publicKeys?: string[];
73
+ feeInfo: TransactionFee;
74
+ }
75
+ interface NodeParams {
76
+ token: string;
77
+ baseServer: string;
78
+ port: number;
79
+ }
80
+ export interface VerifiedTransactionParameters {
81
+ txHex: string;
82
+ addressVersion: number;
83
+ signers: string[];
84
+ prv: string;
85
+ isHalfSigned: boolean;
86
+ numberSigners: number;
87
+ }
88
+ export interface RecoveryOptions {
89
+ backupKey: string;
90
+ userKey: string;
91
+ rootAddress: string;
92
+ recoveryDestination: string;
93
+ bitgoKey: string;
94
+ walletPassphrase?: string;
95
+ fee: number;
96
+ firstRound?: number;
97
+ note?: string;
98
+ nodeParams: NodeParams;
99
+ }
100
+ interface RecoveryInfo {
101
+ id: string;
102
+ tx: string;
103
+ coin: string;
104
+ fee: number;
105
+ firstRound: number;
106
+ lastRound: number;
107
+ genesisId: string;
108
+ genesisHash: string;
109
+ note?: string;
110
+ }
111
+ export interface OfflineVaultTxInfo {
112
+ txHex: string;
113
+ userKey: string;
114
+ backupKey: string;
115
+ bitgoKey: string;
116
+ type?: string;
117
+ address: string;
118
+ coin: string;
119
+ feeInfo: number;
120
+ amount: string;
121
+ firstRound: number;
122
+ lastRound: number;
123
+ genesisId: string;
124
+ genesisHash: string;
125
+ note?: string;
126
+ addressVersion: number;
127
+ keys: string[];
128
+ }
129
+ export interface BroadcastTransactionOptions extends BaseBroadcastTransactionOptions {
130
+ nodeParams: NodeParams;
131
+ }
132
+ export declare class Algo extends BaseCoin {
133
+ readonly ENABLE_TOKEN: TokenManagementType;
134
+ readonly DISABLE_TOKEN: TokenManagementType;
135
+ constructor(bitgo: BitGoBase);
136
+ static createInstance(bitgo: BitGoBase): BaseCoin;
137
+ getChain(): string;
138
+ getBaseChain(): string;
139
+ getFamily(): string;
140
+ getFullName(): string;
141
+ getBaseFactor(): number | string;
142
+ /**
143
+ * Flag for sending value of 0
144
+ * @returns {boolean} True if okay to send 0 value, false otherwise
145
+ */
146
+ valuelessTransferAllowed(): boolean;
147
+ /**
148
+ * Algorand supports account consolidations. These are transfers from the receive addresses
149
+ * to the main address.
150
+ */
151
+ allowsAccountConsolidations(): boolean;
152
+ /** inheritdoc */
153
+ deriveKeyWithSeed(): {
154
+ derivationPath: string;
155
+ key: string;
156
+ };
157
+ /** inheritdoc */
158
+ generateKeyPair(seed?: Buffer): KeyPair;
159
+ /** inheritdoc */
160
+ generateRootKeyPair(seed?: Buffer): KeyPair;
161
+ /**
162
+ * Return boolean indicating whether input is valid public key for the coin.
163
+ *
164
+ * @param {String} pub the pub to be checked
165
+ * @returns {Boolean} is it valid?
166
+ */
167
+ isValidPub(pub: string): boolean;
168
+ /**
169
+ * Return boolean indicating whether input is valid seed for the coin
170
+ * In Algorand, when the private key is encoded as base32 string only the first 32 bytes are taken,
171
+ * so the encoded value is actually the seed
172
+ *
173
+ * @param {String} prv the prv to be checked
174
+ * @returns {Boolean} is it valid?
175
+ */
176
+ isValidPrv(prv: string): boolean;
177
+ /**
178
+ * Return boolean indicating whether input is valid public key for the coin
179
+ *
180
+ * @param {String} address the pub to be checked
181
+ * @returns {Boolean} is it valid?
182
+ */
183
+ isValidAddress(address: string): boolean;
184
+ /**
185
+ * Sign message with private key
186
+ *
187
+ * @param key
188
+ * @param message
189
+ */
190
+ signMessage(key: KeyPair, message: string | Buffer): Promise<Buffer>;
191
+ /**
192
+ * Specifies what key we will need for signing` - Algorand needs the backup, bitgo pubs.
193
+ */
194
+ keyIdsForSigning(): number[];
195
+ getTokenNameById(tokenId: number | string): string;
196
+ /**
197
+ * Explain/parse transaction
198
+ * @param params
199
+ */
200
+ explainTransaction(params: ExplainTransactionOptions): Promise<AlgoTransactionExplanation | undefined>;
201
+ /**
202
+ * returns if a tx is a token tx
203
+ * @param type {string} - tx type
204
+ * @returns true if it's a token tx
205
+ */
206
+ isTokenTx(type: string): boolean;
207
+ /**
208
+ * Check if a seed is a valid stellar seed
209
+ *
210
+ * @param {String} seed the seed to check
211
+ * @returns {Boolean} true if the input is a Stellar seed
212
+ */
213
+ isStellarSeed(seed: string): boolean;
214
+ /**
215
+ * Convert a stellar seed to an algo seed
216
+ *
217
+ * @param {String} seed the seed to convert
218
+ * @returns {Boolean | null} seed in algo encoding
219
+ */
220
+ convertFromStellarSeed(seed: string): string | null;
221
+ verifySignTransactionParams(params: SignTransactionOptions): VerifiedTransactionParameters;
222
+ /**
223
+ * Assemble keychain and half-sign prebuilt transaction
224
+ *
225
+ * @param params
226
+ * @param params.txPrebuild {TransactionPrebuild} prebuild object returned by platform
227
+ * @param params.prv {String} user prv
228
+ * @returns {Promise<SignedTransaction>}
229
+ */
230
+ signTransaction(params: SignTransactionOptions): Promise<SignedTransaction>;
231
+ parseTransaction(params: ParseTransactionOptions): Promise<ParsedTransaction>;
232
+ /**
233
+ * Check if address can be used to send funds.
234
+ *
235
+ * @param params.address address to validate
236
+ * @param params.keychains public keys to generate the wallet
237
+ */
238
+ isWalletAddress(params: VerifyAlgoAddressOptions): Promise<boolean>;
239
+ verifyTransaction(params: VerifyTransactionOptions): Promise<boolean>;
240
+ decodeTx(txn: Buffer): unknown;
241
+ getAddressFromPublicKey(pubKey: Uint8Array): string;
242
+ supportsDeriveKeyWithSeed(): boolean;
243
+ /** inherited doc */
244
+ getDefaultMultisigType(): MultisigType;
245
+ /**
246
+ * Gets config for how token enablements work for this coin
247
+ * @returns
248
+ * requiresTokenEnablement: True if tokens need to be enabled for this coin
249
+ * supportsMultipleTokenEnablements: True if multiple tokens can be enabled in one transaction
250
+ */
251
+ getTokenEnablementConfig(): {
252
+ requiresTokenEnablement: boolean;
253
+ supportsMultipleTokenEnablements: boolean;
254
+ };
255
+ /**
256
+ * Gets the balance of the root address in base units of algo
257
+ * Eg. If balance is 1 Algo, this returns 1*10^6
258
+ * @param rootAddress
259
+ * @param client
260
+ */
261
+ getAccountBalance(rootAddress: string, client: algosdk.Algodv2): Promise<number>;
262
+ /**
263
+ * Returns the Algo client for the given token, baseServer and port
264
+ * Used to interact with the Algo network
265
+ */
266
+ getClient(token: string, baseServer: string, port: number): algosdk.Algodv2;
267
+ recover(params: RecoveryOptions): Promise<RecoveryInfo | OfflineVaultTxInfo>;
268
+ /**
269
+ * Accepts a fully signed serialized base64 transaction and broadcasts it on the network.
270
+ * Uses the external node provided by the client
271
+ * @param serializedSignedTransaction
272
+ * @param nodeParams
273
+ */
274
+ broadcastTransaction({ serializedSignedTransaction, nodeParams, }: BroadcastTransactionOptions): Promise<BaseBroadcastTransactionResult>;
275
+ /**
276
+ * Stellar and Algorand both use keys on the ed25519 curve, but use different encodings.
277
+ * As the HSM doesn't have explicit support to create Algorand addresses, we use the Stellar
278
+ * keys and re-encode them to the Algorand encoding.
279
+ *
280
+ * This method should only be used when creating Algorand custodial wallets reusing Stellar keys.
281
+ *
282
+ * @param {string} addressOrPubKey a Stellar pubkey or Algorand address
283
+ * @return {*}
284
+ */
285
+ private stellarAddressToAlgoAddress;
286
+ private getBuilder;
287
+ /** @inheritDoc */
288
+ auditDecryptedKey({ publicKey, prv, multiSigType }: AuditDecryptedKeyParams): void;
289
+ }
290
+ export {};
291
+ //# sourceMappingURL=algo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