@bitgo/account-lib 2.17.2-rc.0.1 → 2.17.2-rc.4
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 +136 -0
- package/dist/package.json +10 -3
- package/dist/resources/dot/index.ts +2 -0
- package/dist/resources/dot/mainnet.ts +2 -0
- package/dist/resources/dot/westend.ts +2 -0
- package/dist/resources/trx/protobuf/tron.js~account-lib_master +31380 -0
- package/dist/src/coin/algo/keyExclusionBuilder.d.ts +9 -0
- package/dist/src/coin/algo/keyExclusionBuilder.d.ts.map +1 -0
- package/dist/src/coin/algo/keyExclusionBuilder.js +83 -0
- 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 +8 -1
- package/dist/src/coin/baseCoin/baseTransaction.d.ts.map +1 -1
- package/dist/src/coin/baseCoin/baseTransaction.js +10 -1
- package/dist/src/coin/baseCoin/baseTransactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/baseCoin/baseTransactionBuilder.js +1 -1
- package/dist/src/coin/baseCoin/iface.d.ts +28 -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/cspr/utils.js +2 -2
- package/dist/src/coin/dot/errors.d.ts +8 -0
- package/dist/src/coin/dot/errors.d.ts.map +1 -0
- package/dist/src/coin/dot/errors.js +40 -0
- package/dist/src/coin/dot/iface.d.ts +153 -0
- package/dist/src/coin/dot/iface.d.ts.map +1 -0
- package/dist/src/coin/dot/iface.js +15 -0
- package/dist/src/coin/dot/index.d.ts +6 -0
- package/dist/src/coin/dot/index.d.ts.map +1 -1
- package/dist/src/coin/dot/index.js +14 -2
- package/dist/src/coin/dot/keyPair.d.ts +15 -2
- package/dist/src/coin/dot/keyPair.d.ts.map +1 -1
- package/dist/src/coin/dot/keyPair.js +41 -6
- package/dist/src/coin/dot/stakingBuilder.d.ts +59 -0
- package/dist/src/coin/dot/stakingBuilder.d.ts.map +1 -0
- package/dist/src/coin/dot/stakingBuilder.js +157 -0
- package/dist/src/coin/dot/transaction.d.ts +31 -3
- package/dist/src/coin/dot/transaction.d.ts.map +1 -1
- package/dist/src/coin/dot/transaction.js +268 -7
- package/dist/src/coin/dot/transactionBuilder.d.ts +105 -9
- package/dist/src/coin/dot/transactionBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilder.js +311 -15
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts +12 -16
- package/dist/src/coin/dot/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/coin/dot/transactionBuilderFactory.js +60 -25
- package/dist/src/coin/dot/transferBuilder.d.ts +62 -4
- package/dist/src/coin/dot/transferBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/transferBuilder.js +158 -44
- package/dist/src/coin/dot/txnSchema.d.ts +10 -0
- package/dist/src/coin/dot/txnSchema.d.ts.map +1 -0
- package/dist/src/coin/dot/txnSchema.js +83 -0
- package/dist/src/coin/dot/unstakeBuilder.d.ts +38 -0
- package/dist/src/coin/dot/unstakeBuilder.d.ts.map +1 -0
- package/dist/src/coin/dot/unstakeBuilder.js +111 -0
- package/dist/src/coin/dot/utils.d.ts +69 -0
- package/dist/src/coin/dot/utils.d.ts.map +1 -1
- package/dist/src/coin/dot/utils.js +144 -4
- package/dist/src/coin/dot/walletInitializationBuilder.d.ts +51 -5
- package/dist/src/coin/dot/walletInitializationBuilder.d.ts.map +1 -1
- package/dist/src/coin/dot/walletInitializationBuilder.js +108 -45
- package/dist/src/coin/sol/constants.d.ts +24 -0
- package/dist/src/coin/sol/constants.d.ts.map +1 -0
- package/dist/src/coin/sol/constants.js +35 -0
- package/dist/src/coin/sol/iface.d.ts +55 -0
- package/dist/src/coin/sol/iface.d.ts.map +1 -0
- package/dist/src/coin/sol/iface.js +3 -0
- package/dist/src/coin/sol/index.d.ts +5 -0
- package/dist/src/coin/sol/index.d.ts.map +1 -0
- package/dist/src/coin/sol/index.js +29 -0
- package/dist/src/coin/sol/instructionParamsFactory.d.ts +12 -0
- package/dist/src/coin/sol/instructionParamsFactory.d.ts.map +1 -0
- package/dist/src/coin/sol/instructionParamsFactory.js +99 -0
- package/dist/src/coin/sol/keyPair.d.ts +45 -0
- package/dist/src/coin/sol/keyPair.d.ts.map +1 -0
- package/dist/src/coin/sol/keyPair.js +128 -0
- package/dist/src/coin/sol/solInstructionFactory.d.ts +10 -0
- package/dist/src/coin/sol/solInstructionFactory.d.ts.map +1 -0
- package/dist/src/coin/sol/solInstructionFactory.js +102 -0
- package/dist/src/coin/sol/transaction.d.ts +52 -0
- package/dist/src/coin/sol/transaction.d.ts.map +1 -0
- package/dist/src/coin/sol/transaction.js +345 -0
- package/dist/src/coin/sol/transactionBuilder.d.ts +96 -0
- package/dist/src/coin/sol/transactionBuilder.d.ts.map +1 -0
- package/dist/src/coin/sol/transactionBuilder.js +316 -0
- package/dist/src/coin/sol/transactionBuilderFactory.d.ts +34 -0
- package/dist/src/coin/sol/transactionBuilderFactory.d.ts.map +1 -0
- package/dist/src/coin/sol/transactionBuilderFactory.js +86 -0
- package/dist/src/coin/sol/transferBuilder.d.ts +26 -0
- package/dist/src/coin/sol/transferBuilder.d.ts.map +1 -0
- package/dist/src/coin/sol/transferBuilder.js +140 -0
- package/dist/src/coin/sol/utils.d.ts +104 -0
- package/dist/src/coin/sol/utils.d.ts.map +1 -0
- package/dist/src/coin/sol/utils.js +244 -0
- package/dist/src/coin/sol/walletInitializationBuilder.d.ts +26 -0
- package/dist/src/coin/sol/walletInitializationBuilder.d.ts.map +1 -0
- package/dist/src/coin/sol/walletInitializationBuilder.js +141 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +10 -2
- package/dist/src/utils/crypto.d.ts +8 -0
- package/dist/src/utils/crypto.d.ts.map +1 -1
- package/dist/src/utils/crypto.js +13 -2
- package/package.json +10 -3
- package/resources/dot/index.ts +2 -0
- package/resources/dot/mainnet.ts +2 -0
- package/resources/dot/westend.ts +2 -0
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { BaseCoin as CoinConfig } from '@bitgo/statics';
|
|
2
|
+
import { Transaction } from './transaction';
|
|
3
|
+
import { TransactionBuilder } from './transactionBuilder';
|
|
4
|
+
export declare class KeyExclusionBuilder extends TransactionBuilder {
|
|
5
|
+
constructor(coinConfig: Readonly<CoinConfig>);
|
|
6
|
+
/** @inheritdoc */
|
|
7
|
+
protected buildImplementation(): Promise<Transaction>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=keyExclusionBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keyExclusionBuilder.d.ts","sourceRoot":"","sources":["../../../../src/coin/algo/keyExclusionBuilder.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAE1D,qBAAa,mBAAoB,SAAQ,kBAAkB;gBAC7C,UAAU,EAAE,QAAQ,CAAC,UAAU,CAAC;IAI5C,kBAAkB;cACF,mBAAmB,IAAI,OAAO,CAAC,WAAW,CAAC;CAkB5D"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.KeyExclusionBuilder = void 0;
|
|
58
|
+
var algosdk_1 = __importDefault(require("algosdk"));
|
|
59
|
+
var transactionBuilder_1 = require("./transactionBuilder");
|
|
60
|
+
var KeyExclusionBuilder = /** @class */ (function (_super) {
|
|
61
|
+
__extends(KeyExclusionBuilder, _super);
|
|
62
|
+
function KeyExclusionBuilder(coinConfig) {
|
|
63
|
+
return _super.call(this, coinConfig) || this;
|
|
64
|
+
}
|
|
65
|
+
/** @inheritdoc */
|
|
66
|
+
KeyExclusionBuilder.prototype.buildImplementation = function () {
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var nonParticipation;
|
|
69
|
+
return __generator(this, function (_a) {
|
|
70
|
+
switch (_a.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
nonParticipation = true;
|
|
73
|
+
this.transaction.setAlgoTransaction(algosdk_1.default.makeKeyRegistrationTxnWithSuggestedParams(this._sender, this._note, undefined, undefined, undefined, undefined, undefined, this.suggestedParams, this._reKeyTo, nonParticipation));
|
|
74
|
+
return [4 /*yield*/, _super.prototype.buildImplementation.call(this)];
|
|
75
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
return KeyExclusionBuilder;
|
|
81
|
+
}(transactionBuilder_1.TransactionBuilder));
|
|
82
|
+
exports.KeyExclusionBuilder = KeyExclusionBuilder;
|
|
83
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5RXhjbHVzaW9uQnVpbGRlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3NyYy9jb2luL2FsZ28va2V5RXhjbHVzaW9uQnVpbGRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFFQSxvREFBOEI7QUFFOUIsMkRBQTBEO0FBRTFEO0lBQXlDLHVDQUFrQjtJQUN6RCw2QkFBWSxVQUFnQztlQUMxQyxrQkFBTSxVQUFVLENBQUM7SUFDbkIsQ0FBQztJQUVELGtCQUFrQjtJQUNGLGlEQUFtQixHQUFuQzs7Ozs7O3dCQUNRLGdCQUFnQixHQUFHLElBQUksQ0FBQzt3QkFDOUIsSUFBSSxDQUFDLFdBQVcsQ0FBQyxrQkFBa0IsQ0FDakMsaUJBQU8sQ0FBQyx5Q0FBeUMsQ0FD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dGlvbj4ge1xuICAgIGNvbnN0IG5vblBhcnRpY2lwYXRpb24gPSB0cnVlO1xuICAgIHRoaXMudHJhbnNhY3Rpb24uc2V0QWxnb1RyYW5zYWN0aW9uKFxuICAgICAgYWxnb3Nkay5tYWtlS2V5UmVnaXN0cmF0aW9uVHhuV2l0aFN1Z2dlc3RlZFBhcmFtcyhcbiAgICAgICAgdGhpcy5fc2VuZGVyLFxuICAgICAgICB0aGlzLl9ub3RlLFxuICAgICAgICB1bmRlZmluZWQsXG4gICAgICAgIHVuZGVmaW5lZCxcbiAgICAgICAgdW5kZWZpbmVkLFxuICAgICAgICB1bmRlZmluZWQsXG4gICAgICAgIHVuZGVmaW5lZCxcbiAgICAgICAgdGhpcy5zdWdnZXN0ZWRQYXJhbXMsXG4gICAgICAgIHRoaXMuX3JlS2V5VG8sXG4gICAgICAgIG5vblBhcnRpY2lwYXRpb24sXG4gICAgICApLFxuICAgICk7XG4gICAgcmV0dXJuIGF3YWl0IHN1cGVyLmJ1aWxkSW1wbGVtZW50YXRpb24oKTtcbiAgfVxufVxuIl19
|
|
@@ -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,M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