@bitgo/account-lib 2.17.2-rc.2 → 2.17.2-rc.6
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/dist/browser/bitgo-account-lib.min.js +1 -1
- package/dist/browser/bitgo-account-lib.min.js.LICENSE.txt +6 -0
- package/dist/package.json +7 -7
- package/dist/src/coin/algo/utils.d.ts +39 -22
- package/dist/src/coin/algo/utils.d.ts.map +1 -1
- package/dist/src/coin/algo/utils.js +88 -73
- package/dist/src/coin/baseCoin/baseTransaction.d.ts +6 -0
- package/dist/src/coin/baseCoin/baseTransaction.d.ts.map +1 -1
- package/dist/src/coin/baseCoin/baseTransaction.js +8 -1
- package/dist/src/coin/baseCoin/iface.d.ts +37 -0
- package/dist/src/coin/baseCoin/iface.d.ts.map +1 -1
- package/dist/src/coin/baseCoin/iface.js +1 -1
- package/dist/src/coin/dot/iface.d.ts +12 -12
- package/dist/src/coin/dot/iface.d.ts.map +1 -1
- package/dist/src/coin/dot/iface.js +1 -1
- package/dist/src/coin/dot/index.d.ts +1 -0
- package/dist/src/coin/dot/index.d.ts.map +1 -1
- package/dist/src/coin/dot/index.js +4 -2
- package/dist/src/coin/dot/stakingBuilder.d.ts +2 -2
- package/dist/src/coin/dot/stakingBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/stakingBuilder.js +2 -7
- package/dist/src/coin/dot/transaction.d.ts +7 -1
- package/dist/src/coin/dot/transaction.d.ts.map +1 -1
- package/dist/src/coin/dot/transaction.js +79 -3
- package/dist/src/coin/dot/transactionBuilder.d.ts +6 -3
- package/dist/src/coin/dot/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilder.js +11 -9
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts +0 -1
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilderFactory.js +4 -4
- package/dist/src/coin/dot/transferBuilder.d.ts +2 -2
- package/dist/src/coin/dot/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transferBuilder.js +6 -9
- package/dist/src/coin/dot/txnSchema.d.ts.map +1 -1
- package/dist/src/coin/dot/txnSchema.js +1 -2
- package/dist/src/coin/dot/unstakeBuilder.d.ts +4 -4
- package/dist/src/coin/dot/unstakeBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/unstakeBuilder.js +4 -9
- package/dist/src/coin/dot/utils.d.ts.map +1 -1
- package/dist/src/coin/dot/utils.js +9 -2
- package/dist/src/coin/dot/walletInitializationBuilder.d.ts +2 -2
- package/dist/src/coin/dot/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/walletInitializationBuilder.js +2 -7
- package/dist/src/coin/hbar/utils.js +2 -2
- package/dist/src/coin/sol/iface.d.ts +9 -0
- package/dist/src/coin/sol/iface.d.ts.map +1 -1
- package/dist/src/coin/sol/iface.js +1 -1
- package/dist/src/coin/sol/transaction.d.ts +10 -2
- package/dist/src/coin/sol/transaction.d.ts.map +1 -1
- package/dist/src/coin/sol/transaction.js +122 -6
- package/dist/src/coin/sol/transactionBuilder.d.ts +3 -1
- package/dist/src/coin/sol/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/sol/transactionBuilder.js +9 -7
- package/package.json +7 -7
|
@@ -223,6 +223,12 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
223
223
|
|
|
224
224
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
225
225
|
|
|
226
|
+
/*! micro-base - MIT License (c) 2021 Paul Miller (paulmillr.com) */
|
|
227
|
+
|
|
228
|
+
/*! noble-hashes - MIT License (c) 2021 Paul Miller (paulmillr.com) */
|
|
229
|
+
|
|
230
|
+
/*! noble-secp256k1 - MIT License (c) Paul Miller (paulmillr.com) */
|
|
231
|
+
|
|
226
232
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
227
233
|
|
|
228
234
|
/**
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bitgo/account-lib",
|
|
3
|
-
"version": "2.17.2-rc.
|
|
3
|
+
"version": "2.17.2-rc.6",
|
|
4
4
|
"description": "BitGo's account library functions",
|
|
5
5
|
"main": "./dist/src/index.js",
|
|
6
6
|
"types": "./dist/src/index.d.ts",
|
|
@@ -36,19 +36,19 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@bitgo/blake2b": "^3.0.1",
|
|
38
38
|
"@bitgo/bls": "^0.1.0",
|
|
39
|
-
"@bitgo/statics": "^6.15.1-rc.
|
|
39
|
+
"@bitgo/statics": "^6.15.1-rc.6",
|
|
40
40
|
"@celo/contractkit": "^1.2.4",
|
|
41
41
|
"@ethereumjs/common": "^2.4.0",
|
|
42
42
|
"@ethereumjs/tx": "^3.3.0",
|
|
43
43
|
"@hashgraph/sdk": "~2.3.0",
|
|
44
|
-
"@polkadot/api": "^6.
|
|
45
|
-
"@polkadot/keyring": "^
|
|
44
|
+
"@polkadot/api": "^6.11.1",
|
|
45
|
+
"@polkadot/keyring": "^8.0.5",
|
|
46
46
|
"@solana/web3.js": "^1.30.2",
|
|
47
47
|
"@stablelib/hex": "^1.0.0",
|
|
48
48
|
"@stablelib/sha384": "^1.0.0",
|
|
49
49
|
"@stacks/transactions": "2.0.1",
|
|
50
|
-
"@substrate/txwrapper-core": "^1.2
|
|
51
|
-
"@substrate/txwrapper-polkadot": "^1.2
|
|
50
|
+
"@substrate/txwrapper-core": "^1.3.2",
|
|
51
|
+
"@substrate/txwrapper-polkadot": "^1.3.2",
|
|
52
52
|
"@taquito/local-forging": "6.3.5-beta.0",
|
|
53
53
|
"@taquito/signer": "6.3.5-beta.0",
|
|
54
54
|
"@types/lodash": "^4.14.151",
|
|
@@ -116,5 +116,5 @@
|
|
|
116
116
|
"git add"
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
|
-
"gitHead": "
|
|
119
|
+
"gitHead": "986fc07ca703cb2cf2f09476c656e187230c5946"
|
|
120
120
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import algosdk from 'algosdk';
|
|
3
3
|
import { BaseUtils } from '../baseCoin';
|
|
4
|
-
import {
|
|
4
|
+
import { Address, EncodedTx, Seed } from './ifaces';
|
|
5
5
|
import { KeyPair } from './keyPair';
|
|
6
6
|
export declare class Utils implements BaseUtils {
|
|
7
7
|
/** @inheritdoc */
|
|
@@ -15,10 +15,10 @@ export declare class Utils implements BaseUtils {
|
|
|
15
15
|
/**
|
|
16
16
|
* Returns an hex string of the given buffer
|
|
17
17
|
*
|
|
18
|
-
* @param {
|
|
18
|
+
* @param {Uint8Array} buffer - the buffer to be converted to hex
|
|
19
19
|
* @returns {string} - the hex value
|
|
20
20
|
*/
|
|
21
|
-
toHex(buffer:
|
|
21
|
+
toHex(buffer: Uint8Array): string;
|
|
22
22
|
/** @inheritdoc */
|
|
23
23
|
isValidSignature(signature: string): boolean;
|
|
24
24
|
/** @inheritdoc */
|
|
@@ -55,12 +55,12 @@ export declare class Utils implements BaseUtils {
|
|
|
55
55
|
/**
|
|
56
56
|
* decodeSeed decodes an algo seed
|
|
57
57
|
*
|
|
58
|
-
* Decoding algo seed is
|
|
59
|
-
* Latest version of algo sdk (1.9, at this writing) does not expose explicit method for decoding seed
|
|
60
|
-
*
|
|
58
|
+
* Decoding algo seed is same as decoding address.
|
|
59
|
+
* Latest version of algo sdk (1.9, at this writing) does not expose explicit method for decoding seed.
|
|
60
|
+
* Parameter is decoded and split into seed and checksum.
|
|
61
61
|
*
|
|
62
|
-
* @param {string} seed -
|
|
63
|
-
* @returns {Seed} -
|
|
62
|
+
* @param {string} seed - hex or base64 encoded seed to be validated
|
|
63
|
+
* @returns {Seed} - validated object Seed
|
|
64
64
|
*/
|
|
65
65
|
decodeSeed(seed: string): Seed;
|
|
66
66
|
/**
|
|
@@ -102,6 +102,20 @@ export declare class Utils implements BaseUtils {
|
|
|
102
102
|
* @returns {EncodedTx} The decoded transaction.
|
|
103
103
|
*/
|
|
104
104
|
decodeAlgoTxn(txnBytes: Uint8Array | string): EncodedTx;
|
|
105
|
+
/**
|
|
106
|
+
* Try to decode a signed Algo transaction
|
|
107
|
+
* @param buffer the encoded transaction
|
|
108
|
+
* @returns { EncodedTx } the decoded signed transaction
|
|
109
|
+
* @throws error if it is not a valid encoded signed transaction
|
|
110
|
+
*/
|
|
111
|
+
tryToDecodeSignedTransaction(buffer: Buffer): EncodedTx;
|
|
112
|
+
/**
|
|
113
|
+
* Try to decode an unsigned Algo transaction
|
|
114
|
+
* @param buffer the encoded transaction
|
|
115
|
+
* @returns {EncodedTx} the decoded unsigned transaction
|
|
116
|
+
* @throws error if it is not a valid encoded unsigned transaction
|
|
117
|
+
*/
|
|
118
|
+
tryToDecodeUnsignedTransaction(buffer: Buffer): EncodedTx;
|
|
105
119
|
encodeObj(obj: Record<string | number | symbol, any>): Uint8Array;
|
|
106
120
|
/**
|
|
107
121
|
* decodeObj takes a Uint8Array and returns its javascript obj
|
|
@@ -110,7 +124,7 @@ export declare class Utils implements BaseUtils {
|
|
|
110
124
|
*/
|
|
111
125
|
decodeObj(o: ArrayLike<number>): unknown;
|
|
112
126
|
/**
|
|
113
|
-
* secretKeyToMnemonic
|
|
127
|
+
* secretKeyToMnemonic takes an Algorant secret key and returns the corresponding mnemonic
|
|
114
128
|
*
|
|
115
129
|
* @param sk - Algorant secret key
|
|
116
130
|
* @return Secret key is associated mnemonic
|
|
@@ -146,14 +160,14 @@ export declare class Utils implements BaseUtils {
|
|
|
146
160
|
*/
|
|
147
161
|
protected mnemonicFromSeed(seed: Uint8Array): string;
|
|
148
162
|
/**
|
|
149
|
-
*
|
|
163
|
+
* Validates the key with the stellar-sdk
|
|
150
164
|
*
|
|
151
165
|
* @param publicKey
|
|
152
|
-
* @returns
|
|
166
|
+
* @returns boolean
|
|
153
167
|
*/
|
|
154
168
|
protected isValidEd25519PublicKeyStellar(publicKey: string): boolean;
|
|
155
169
|
/**
|
|
156
|
-
*
|
|
170
|
+
* Decodes the key with the stellar-sdk
|
|
157
171
|
*
|
|
158
172
|
* @param publicKey
|
|
159
173
|
* @returns Buffer
|
|
@@ -167,25 +181,25 @@ export declare class Utils implements BaseUtils {
|
|
|
167
181
|
*/
|
|
168
182
|
convertFromStellarSeed(seed: string): string;
|
|
169
183
|
/**
|
|
170
|
-
*
|
|
184
|
+
* Returns an address encoded with algosdk
|
|
171
185
|
*
|
|
172
186
|
* @param addr
|
|
173
187
|
* @returns string
|
|
174
188
|
*/
|
|
175
|
-
encodeAddress(addr:
|
|
189
|
+
encodeAddress(addr: Uint8Array): string;
|
|
176
190
|
/**
|
|
177
|
-
*
|
|
191
|
+
* Return an address decoded with algosdk
|
|
178
192
|
*
|
|
179
193
|
* @param addr
|
|
180
194
|
* @returns Address
|
|
181
195
|
*/
|
|
182
196
|
decodeAddress(addr: string): Address;
|
|
183
197
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
198
|
+
* Converts an address into an ALGO one
|
|
199
|
+
* If the given data is a Stellar address or public key, it is converted to ALGO address.
|
|
186
200
|
*
|
|
187
|
-
* @param addressOrPubKey
|
|
188
|
-
* @returns address algo string
|
|
201
|
+
* @param addressOrPubKey an ALGO address, or an Stellar address or public key
|
|
202
|
+
* @returns address algo address string
|
|
189
203
|
*/
|
|
190
204
|
stellarAddressToAlgoAddress(addressOrPubKey: string): string;
|
|
191
205
|
/**
|
|
@@ -216,9 +230,12 @@ export declare class Utils implements BaseUtils {
|
|
|
216
230
|
*/
|
|
217
231
|
getMultisigTxID(txBase64: string): string;
|
|
218
232
|
/**
|
|
219
|
-
*
|
|
220
|
-
* @param
|
|
221
|
-
* @
|
|
233
|
+
* Determines if a given transaction data is to enable or disable a token
|
|
234
|
+
* @param amount the amount in transaction
|
|
235
|
+
* @param from the originated address
|
|
236
|
+
* @param to the target address
|
|
237
|
+
* @param closeRemainderTo (optional) address to send remaining units in originated address
|
|
238
|
+
* @returns 'enableToken' or 'disableToken'
|
|
222
239
|
*/
|
|
223
240
|
getTokenTxType(amount: string, from: string, to: string, closeRemainderTo?: string): string;
|
|
224
241
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/coin/algo/utils.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAQ9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/coin/algo/utils.ts"],"names":[],"mappings":";AAAA,OAAO,OAAO,MAAM,SAAS,CAAC;AAQ9B,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAmCpC,qBAAa,KAAM,YAAW,SAAS;IACrC,kBAAkB;IAClB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAIxC,kBAAkB;IAClB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAQ3C,kBAAkB;IAClB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAItC,kBAAkB;IAClB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIvC;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM;IAIjC,kBAAkB;IAClB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI5C,kBAAkB;IAClB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;IAIrC;;;;;;OAMG;IACH,YAAY,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO;IAIzD;;;;;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