@bitgo-beta/sdk-coin-tao 1.0.1-alpha.19 → 1.0.1-alpha.20
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/CHANGELOG.md +11 -0
- package/dist/src/lib/index.d.ts +3 -9
- package/dist/src/lib/index.d.ts.map +1 -1
- package/dist/src/lib/index.js +18 -51
- package/dist/src/lib/transactionBuilderFactory.d.ts +3 -4
- package/dist/src/lib/transactionBuilderFactory.d.ts.map +1 -1
- package/dist/src/lib/transactionBuilderFactory.js +6 -9
- package/dist/src/lib/transferBuilder.d.ts +2 -7
- package/dist/src/lib/transferBuilder.d.ts.map +1 -1
- package/dist/src/lib/transferBuilder.js +8 -3
- package/dist/src/lib/utils.d.ts +4 -264
- package/dist/src/lib/utils.d.ts.map +1 -1
- package/dist/src/lib/utils.js +6 -483
- package/dist/src/resources/index.d.ts +1 -1
- package/dist/src/resources/index.js +2 -2
- package/dist/src/resources/mainnet.d.ts +12 -1
- package/dist/src/resources/mainnet.d.ts.map +1 -1
- package/dist/src/resources/mainnet.js +14 -3
- 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/tao.d.ts +4 -6
- package/dist/src/tao.d.ts.map +1 -1
- package/dist/src/tao.js +7 -85
- package/package.json +8 -19
- package/dist/src/lib/errors.d.ts +0 -8
- package/dist/src/lib/errors.d.ts.map +0 -1
- package/dist/src/lib/errors.js +0 -19
- package/dist/src/lib/iface.d.ts +0 -337
- package/dist/src/lib/iface.d.ts.map +0 -1
- package/dist/src/lib/iface.js +0 -128
- package/dist/src/lib/iface_utils.d.ts +0 -59
- package/dist/src/lib/iface_utils.d.ts.map +0 -1
- package/dist/src/lib/iface_utils.js +0 -92
- package/dist/src/lib/keyPair.d.ts +0 -38
- package/dist/src/lib/keyPair.d.ts.map +0 -1
- package/dist/src/lib/keyPair.js +0 -117
- package/dist/src/lib/nativeTransferBuilder.d.ts +0 -84
- package/dist/src/lib/nativeTransferBuilder.d.ts.map +0 -1
- package/dist/src/lib/nativeTransferBuilder.js +0 -219
- package/dist/src/lib/singletonRegistry.d.ts +0 -7
- package/dist/src/lib/singletonRegistry.d.ts.map +0 -1
- package/dist/src/lib/singletonRegistry.js +0 -20
- package/dist/src/lib/transaction.d.ts +0 -83
- package/dist/src/lib/transaction.d.ts.map +0 -1
- package/dist/src/lib/transaction.js +0 -610
- package/dist/src/lib/transactionBuilder.d.ts +0 -131
- package/dist/src/lib/transactionBuilder.d.ts.map +0 -1
- package/dist/src/lib/transactionBuilder.js +0 -351
- package/dist/src/lib/txnSchema.d.ts +0 -15
- package/dist/src/lib/txnSchema.d.ts.map +0 -1
- package/dist/src/lib/txnSchema.js +0 -117
- package/dist/src/resources/westend.d.ts +0 -2
- package/dist/src/resources/westend.d.ts.map +0 -1
- package/dist/src/resources/westend.js +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.3.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-tao@1.2.0...@bitgo/sdk-coin-tao@1.3.0) (2025-02-11)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **abstract-substrate:** fix abstract-substrate implementation ([1c986da](https://github.com/BitGo/BitGoJS/commit/1c986daa817353ca522c0e8e72e67a6dffa00fac))
|
|
11
|
+
- **sdk-coin-tao:** fix coinBuilderMap for tao ([b592e09](https://github.com/BitGo/BitGoJS/commit/b592e098544b447e946c1d4432a442f9bb1ab6d3))
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- **sdk-coin-tao:** add network to ttao ([79ad572](https://github.com/BitGo/BitGoJS/commit/79ad5722b1b3b4ee08119d3c9a71f881e74095dc))
|
|
16
|
+
|
|
6
17
|
# [1.2.0](https://github.com/BitGo/BitGoJS/compare/@bitgo/sdk-coin-tao@1.1.0...@bitgo/sdk-coin-tao@1.2.0) (2025-02-05)
|
|
7
18
|
|
|
8
19
|
### Features
|
package/dist/src/lib/index.d.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import * as Interface from './iface';
|
|
3
|
-
export { KeyPair } from './keyPair';
|
|
4
|
-
export { Transaction } from './transaction';
|
|
5
|
-
export { TransactionBuilder } from './transactionBuilder';
|
|
6
|
-
export { TransferBuilder } from './transferBuilder';
|
|
1
|
+
export { Constants, Errors, Interface, KeyPair, SingletonRegistry, Transaction, TransactionBuilder, } from '@bitgo-beta/abstract-substrate';
|
|
7
2
|
export { TransactionBuilderFactory } from './transactionBuilderFactory';
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export { Interface, Utils };
|
|
3
|
+
export { TransferBuilder } from './transferBuilder';
|
|
4
|
+
export { Utils, default as utils } from './utils';
|
|
11
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,MAAM,EACN,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,WAAW,EACX,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AAExC,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/src/lib/index.js
CHANGED
|
@@ -1,55 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Utils = exports.
|
|
37
|
-
|
|
38
|
-
exports.
|
|
39
|
-
|
|
40
|
-
exports
|
|
41
|
-
|
|
42
|
-
Object.defineProperty(exports, "
|
|
43
|
-
|
|
44
|
-
Object.defineProperty(exports, "
|
|
45
|
-
var transactionBuilder_1 = require("./transactionBuilder");
|
|
46
|
-
Object.defineProperty(exports, "TransactionBuilder", { enumerable: true, get: function () { return transactionBuilder_1.TransactionBuilder; } });
|
|
47
|
-
var transferBuilder_1 = require("./transferBuilder");
|
|
48
|
-
Object.defineProperty(exports, "TransferBuilder", { enumerable: true, get: function () { return transferBuilder_1.TransferBuilder; } });
|
|
6
|
+
exports.utils = exports.Utils = exports.TransferBuilder = exports.TransactionBuilderFactory = exports.TransactionBuilder = exports.Transaction = exports.SingletonRegistry = exports.KeyPair = exports.Interface = exports.Errors = exports.Constants = void 0;
|
|
7
|
+
var abstract_substrate_1 = require("@bitgo-beta/abstract-substrate");
|
|
8
|
+
Object.defineProperty(exports, "Constants", { enumerable: true, get: function () { return abstract_substrate_1.Constants; } });
|
|
9
|
+
Object.defineProperty(exports, "Errors", { enumerable: true, get: function () { return abstract_substrate_1.Errors; } });
|
|
10
|
+
Object.defineProperty(exports, "Interface", { enumerable: true, get: function () { return abstract_substrate_1.Interface; } });
|
|
11
|
+
Object.defineProperty(exports, "KeyPair", { enumerable: true, get: function () { return abstract_substrate_1.KeyPair; } });
|
|
12
|
+
Object.defineProperty(exports, "SingletonRegistry", { enumerable: true, get: function () { return abstract_substrate_1.SingletonRegistry; } });
|
|
13
|
+
Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return abstract_substrate_1.Transaction; } });
|
|
14
|
+
Object.defineProperty(exports, "TransactionBuilder", { enumerable: true, get: function () { return abstract_substrate_1.TransactionBuilder; } });
|
|
49
15
|
var transactionBuilderFactory_1 = require("./transactionBuilderFactory");
|
|
50
16
|
Object.defineProperty(exports, "TransactionBuilderFactory", { enumerable: true, get: function () { return transactionBuilderFactory_1.TransactionBuilderFactory; } });
|
|
51
|
-
var
|
|
52
|
-
Object.defineProperty(exports, "
|
|
53
|
-
var
|
|
54
|
-
Object.defineProperty(exports, "
|
|
55
|
-
|
|
17
|
+
var transferBuilder_1 = require("./transferBuilder");
|
|
18
|
+
Object.defineProperty(exports, "TransferBuilder", { enumerable: true, get: function () { return transferBuilder_1.TransferBuilder; } });
|
|
19
|
+
var utils_1 = require("./utils");
|
|
20
|
+
Object.defineProperty(exports, "Utils", { enumerable: true, get: function () { return utils_1.Utils; } });
|
|
21
|
+
Object.defineProperty(exports, "utils", { enumerable: true, get: function () { return __importDefault(utils_1).default; } });
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvbGliL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLHFFQVF3QztBQVB0QywrR0FBQSxTQUFTLE9BQUE7QUFDVCw0R0FBQSxNQUFNLE9BQUE7QUFDTiwrR0FBQSxTQUFTLE9BQUE7QUFDVCw2R0FBQSxPQUFPLE9BQUE7QUFDUCx1SEFBQSxpQkFBaUIsT0FBQTtBQUNqQixpSEFBQSxXQUFXLE9BQUE7QUFDWCx3SEFBQSxrQkFBa0IsT0FBQTtBQUdwQix5RUFBd0U7QUFBL0Qsc0lBQUEseUJBQXlCLE9BQUE7QUFDbEMscURBQW9EO0FBQTNDLGtIQUFBLGVBQWUsT0FBQTtBQUN4QixpQ0FBa0Q7QUFBekMsOEZBQUEsS0FBSyxPQUFBO0FBQUUsK0dBQUEsT0FBTyxPQUFTIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHtcbiAgQ29uc3RhbnRzLFxuICBFcnJvcnMsXG4gIEludGVyZmFjZSxcbiAgS2V5UGFpcixcbiAgU2luZ2xldG9uUmVnaXN0cnksXG4gIFRyYW5zYWN0aW9uLFxuICBUcmFuc2FjdGlvbkJ1aWxkZXIsXG59IGZyb20gJ0BiaXRnby1iZXRhL2Fic3RyYWN0LXN1YnN0cmF0ZSc7XG5cbmV4cG9ydCB7IFRyYW5zYWN0aW9uQnVpbGRlckZhY3RvcnkgfSBmcm9tICcuL3RyYW5zYWN0aW9uQnVpbGRlckZhY3RvcnknO1xuZXhwb3J0IHsgVHJhbnNmZXJCdWlsZGVyIH0gZnJvbSAnLi90cmFuc2ZlckJ1aWxkZXInO1xuZXhwb3J0IHsgVXRpbHMsIGRlZmF1bHQgYXMgdXRpbHMgfSBmcm9tICcuL3V0aWxzJztcbiJdfQ==
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { BaseTransactionBuilderFactory } from '@bitgo-beta/sdk-core';
|
|
2
2
|
import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
|
|
3
|
-
import {
|
|
3
|
+
import { TransactionBuilder, Interface } from './';
|
|
4
4
|
import { TransferBuilder } from './transferBuilder';
|
|
5
|
-
import { TransactionBuilder } from './transactionBuilder';
|
|
6
5
|
export declare class TransactionBuilderFactory extends BaseTransactionBuilderFactory {
|
|
7
|
-
protected _material: Material;
|
|
6
|
+
protected _material: Interface.Material;
|
|
8
7
|
constructor(_coinConfig: Readonly<CoinConfig>);
|
|
9
8
|
getTransferBuilder(): TransferBuilder;
|
|
10
9
|
getWalletInitializationBuilder(): void;
|
|
11
10
|
from(rawTxn: string): TransactionBuilder;
|
|
12
|
-
material(material: Material): this;
|
|
11
|
+
material(material: Interface.Material): this;
|
|
13
12
|
private getBuilder;
|
|
14
13
|
}
|
|
15
14
|
//# sourceMappingURL=transactionBuilderFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionBuilderFactory.d.ts","sourceRoot":"","sources":["../../../src/lib/transactionBuilderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAqC,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,
|
|
1
|
+
{"version":3,"file":"transactionBuilderFactory.d.ts","sourceRoot":"","sources":["../../../src/lib/transactionBuilderFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAqC,MAAM,sBAAsB,CAAC;AACxG,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAqB,kBAAkB,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAGpD,qBAAa,yBAA0B,SAAQ,6BAA6B;IAC1E,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,QAAQ,CAAC;gBAE5B,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;IAK7C,kBAAkB,IAAI,eAAe;IAIrC,8BAA8B,IAAI,IAAI;IAItC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,kBAAkB;IAMxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,IAAI;IAK5C,OAAO,CAAC,UAAU;CAcnB"}
|
|
@@ -6,17 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.TransactionBuilderFactory = void 0;
|
|
7
7
|
const sdk_core_1 = require("@bitgo-beta/sdk-core");
|
|
8
8
|
const txwrapper_polkadot_1 = require("@substrate/txwrapper-polkadot");
|
|
9
|
-
const
|
|
10
|
-
const singletonRegistry_1 = require("./singletonRegistry");
|
|
9
|
+
const _1 = require("./");
|
|
11
10
|
const transferBuilder_1 = require("./transferBuilder");
|
|
12
11
|
const utils_1 = __importDefault(require("./utils"));
|
|
13
12
|
class TransactionBuilderFactory extends sdk_core_1.BaseTransactionBuilderFactory {
|
|
14
13
|
constructor(_coinConfig) {
|
|
15
14
|
super(_coinConfig);
|
|
16
|
-
this._material = utils_1.default.getMaterial(_coinConfig);
|
|
15
|
+
this._material = utils_1.default.getMaterial(_coinConfig.network.type);
|
|
17
16
|
}
|
|
18
17
|
getTransferBuilder() {
|
|
19
|
-
return new transferBuilder_1.TransferBuilder(this._coinConfig)
|
|
18
|
+
return new transferBuilder_1.TransferBuilder(this._coinConfig);
|
|
20
19
|
}
|
|
21
20
|
getWalletInitializationBuilder() {
|
|
22
21
|
throw new sdk_core_1.NotImplementedError(`walletInitialization for ${this._coinConfig.name} not implemented`);
|
|
@@ -31,15 +30,13 @@ class TransactionBuilderFactory extends sdk_core_1.BaseTransactionBuilderFactory
|
|
|
31
30
|
return this;
|
|
32
31
|
}
|
|
33
32
|
getBuilder(rawTxn) {
|
|
34
|
-
const registry =
|
|
33
|
+
const registry = _1.SingletonRegistry.getInstance(this._material);
|
|
35
34
|
const decodedTxn = (0, txwrapper_polkadot_1.decode)(rawTxn, {
|
|
36
35
|
metadataRpc: this._material.metadata,
|
|
37
36
|
registry: registry,
|
|
38
37
|
});
|
|
39
38
|
const methodName = decodedTxn.method?.name;
|
|
40
|
-
if (methodName ===
|
|
41
|
-
methodName === iface_1.MethodNames.TransferAll ||
|
|
42
|
-
methodName === iface_1.MethodNames.Proxy) {
|
|
39
|
+
if (methodName === _1.Interface.MethodNames.TransferKeepAlive || methodName === _1.Interface.MethodNames.TransferAll) {
|
|
43
40
|
return this.getTransferBuilder();
|
|
44
41
|
}
|
|
45
42
|
else {
|
|
@@ -48,4 +45,4 @@ class TransactionBuilderFactory extends sdk_core_1.BaseTransactionBuilderFactory
|
|
|
48
45
|
}
|
|
49
46
|
}
|
|
50
47
|
exports.TransactionBuilderFactory = TransactionBuilderFactory;
|
|
51
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
48
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb25CdWlsZGVyRmFjdG9yeS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdHJhbnNhY3Rpb25CdWlsZGVyRmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmd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OiBzdHJpbmcpOiBUcmFuc2FjdGlvbkJ1aWxkZXIge1xuICAgIGNvbnN0IHJlZ2lzdHJ5ID0gU2luZ2xldG9uUmVnaXN0cnkuZ2V0SW5zdGFuY2UodGhpcy5fbWF0ZXJpYWwpO1xuICAgIGNvbnN0IGRlY29kZWRUeG4gPSBkZWNvZGUocmF3VHhuLCB7XG4gICAgICBtZXRhZGF0YVJwYzogdGhpcy5fbWF0ZXJpYWwubWV0YWRhdGEsXG4gICAgICByZWdpc3RyeTogcmVnaXN0cnksXG4gICAgfSk7XG5cbiAgICBjb25zdCBtZXRob2ROYW1lID0gZGVjb2RlZFR4bi5tZXRob2Q/Lm5hbWU7XG4gICAgaWYgKG1ldGhvZE5hbWUgPT09IEludGVyZmFjZS5NZXRob2ROYW1lcy5UcmFuc2ZlcktlZXBBbGl2ZSB8fCBtZXRob2ROYW1lID09PSBJbnRlcmZhY2UuTWV0aG9kTmFtZXMuVHJhbnNmZXJBbGwpIHtcbiAgICAgIHJldHVybiB0aGlzLmdldFRyYW5zZmVyQnVpbGRlcigpO1xuICAgIH0gZWxzZSB7XG4gICAgICB0aHJvdyBuZXcgTm90U3VwcG9ydGVkKCdUcmFuc2FjdGlvbiBjYW5ub3QgYmUgcGFyc2VkIG9yIGhhcyBhbiB1bnN1cHBvcnRlZCB0cmFuc2FjdGlvbiB0eXBlJyk7XG4gICAgfVxuICB9XG59XG4iXX0=
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { BaseCoin as CoinConfig } from '@bitgo-beta/statics';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare class TransferBuilder extends NativeTransferBuilder {
|
|
5
|
-
protected _amount: string;
|
|
6
|
-
protected _to: string;
|
|
7
|
-
protected _owner: string;
|
|
8
|
-
protected _forceProxyType: ProxyType;
|
|
2
|
+
import { TransferBuilder as SubstrateTransferBuilder } from '@bitgo-beta/abstract-substrate';
|
|
3
|
+
export declare class TransferBuilder extends SubstrateTransferBuilder {
|
|
9
4
|
constructor(_coinConfig: Readonly<CoinConfig>);
|
|
10
5
|
}
|
|
11
6
|
//# sourceMappingURL=transferBuilder.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transferBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/transferBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"transferBuilder.d.ts","sourceRoot":"","sources":["../../../src/lib/transferBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,eAAe,IAAI,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAG7F,qBAAa,eAAgB,SAAQ,wBAAwB;gBAC/C,WAAW,EAAE,QAAQ,CAAC,UAAU,CAAC;CAI9C"}
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.TransferBuilder = void 0;
|
|
4
|
-
const
|
|
5
|
-
|
|
7
|
+
const abstract_substrate_1 = require("@bitgo-beta/abstract-substrate");
|
|
8
|
+
const utils_1 = __importDefault(require("./utils"));
|
|
9
|
+
class TransferBuilder extends abstract_substrate_1.TransferBuilder {
|
|
6
10
|
constructor(_coinConfig) {
|
|
7
11
|
super(_coinConfig);
|
|
12
|
+
this.material(utils_1.default.getMaterial(_coinConfig.network.type));
|
|
8
13
|
}
|
|
9
14
|
}
|
|
10
15
|
exports.TransferBuilder = TransferBuilder;
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZX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@@ -1,267 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { DecodedSignedTx, DecodedSigningPayload, TypeRegistry } from '@substrate/txwrapper-core/lib/types';
|
|
6
|
-
import { AddProxyBatchCallArgs, BatchArgs, BatchCallObject, HexString, Material, ProxyArgs, StakeArgs, StakeBatchCallArgs, StakeMoreArgs, StakeMoreCallArgs, TransferAllArgs, TransferArgs, TxMethod, UnstakeBatchCallArgs } from './iface';
|
|
7
|
-
import { KeyPair } from '.';
|
|
8
|
-
export declare class Utils implements BaseUtils {
|
|
9
|
-
/** @inheritdoc */
|
|
10
|
-
isValidAddress(address: string): boolean;
|
|
11
|
-
/** @inheritdoc */
|
|
12
|
-
isValidBlockId(hash: string): boolean;
|
|
13
|
-
/** @inheritdoc */
|
|
14
|
-
isValidPrivateKey(key: string): boolean;
|
|
15
|
-
/** @inheritdoc */
|
|
16
|
-
isValidPublicKey(key: string): boolean;
|
|
17
|
-
/** @inheritdoc */
|
|
18
|
-
isValidSignature(signature: string): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Verifies the signature on a given message
|
|
21
|
-
*
|
|
22
|
-
* @param {string} signedMessage the signed message for the signature
|
|
23
|
-
* @param {string} signature the signature to verify
|
|
24
|
-
* @param {string} address the address of the signer
|
|
25
|
-
* @returns {boolean} whether the signature is valid or not
|
|
26
|
-
*/
|
|
27
|
-
verifySignature(signedMessage: string, signature: string, address: string): boolean;
|
|
28
|
-
/** @inheritdoc */
|
|
29
|
-
isValidTransactionId(txId: string): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* decodeSeed decodes a substrate seed
|
|
32
|
-
*
|
|
33
|
-
* @param {string} seed - the seed to be validated.
|
|
34
|
-
* @returns {Seed} - the object Seed
|
|
35
|
-
*/
|
|
36
|
-
decodeSeed(seed: string): Seed;
|
|
37
|
-
/**
|
|
38
|
-
* Helper function to capitalize the first letter of a string
|
|
39
|
-
*
|
|
40
|
-
* @param {string} val
|
|
41
|
-
* @returns {string}
|
|
42
|
-
*/
|
|
43
|
-
capitalizeFirstLetter(val: string): string;
|
|
44
|
-
/**
|
|
45
|
-
* Helper function to decode the internal method hex in case of a proxy transaction
|
|
46
|
-
*
|
|
47
|
-
* @param {string | UnsignedTransaction} tx
|
|
48
|
-
* @param { metadataRpc: string; registry: TypeRegistry } options
|
|
49
|
-
* @returns {TransferArgs}
|
|
50
|
-
*/
|
|
51
|
-
decodeCallMethod(tx: string | UnsignedTransaction, options: {
|
|
52
|
-
metadataRpc: string;
|
|
53
|
-
registry: TypeRegistry;
|
|
54
|
-
}): TransferArgs;
|
|
55
|
-
/**
|
|
56
|
-
* keyPairFromSeed generates an object with secretKey and publicKey using the substrate sdk
|
|
57
|
-
* @param seed 32 bytes long seed
|
|
58
|
-
* @returns KeyPair
|
|
59
|
-
*/
|
|
60
|
-
keyPairFromSeed(seed: Uint8Array): KeyPair;
|
|
61
|
-
/**
|
|
62
|
-
* Signing function. Implement this on the OFFLINE signing device.
|
|
63
|
-
*
|
|
64
|
-
* @param {KeyringPair} pair - The signing pair.
|
|
65
|
-
* @param {string} signingPayload - Payload to sign.
|
|
66
|
-
* @param {UnsignedTransaction} transaction - raw transaction to sign
|
|
67
|
-
* @param {Object} options
|
|
68
|
-
* @param {HexString} options.metadataRpc - metadata that is needed for substrate to sign
|
|
69
|
-
* @param {TypeRegistry} options.registry - metadata that is needed for substrate to sign
|
|
70
|
-
*/
|
|
71
|
-
createSignedTx(pair: KeyringPair, signingPayload: string, transaction: UnsignedTransaction, options: {
|
|
72
|
-
metadataRpc: HexString;
|
|
73
|
-
registry: TypeRegistry;
|
|
74
|
-
}): string;
|
|
75
|
-
/**
|
|
76
|
-
* Serializes the signed transaction
|
|
77
|
-
*
|
|
78
|
-
* @param transaction Transaction to serialize
|
|
79
|
-
* @param signature Signature of the message
|
|
80
|
-
* @param metadataRpc Network metadata
|
|
81
|
-
* @param registry Transaction registry
|
|
82
|
-
* @returns string Serialized transaction
|
|
83
|
-
*/
|
|
84
|
-
serializeSignedTransaction(transaction: any, signature: any, metadataRpc: `0x${string}`, registry: any): string;
|
|
85
|
-
/**
|
|
86
|
-
* Decodes the substrate address from the given format
|
|
87
|
-
*
|
|
88
|
-
* @param {string} address
|
|
89
|
-
* @param {number} [ss58Format]
|
|
90
|
-
* @returns {string}
|
|
91
|
-
*/
|
|
92
|
-
decodeSubstrateAddress(address: string, ss58Format: number): string;
|
|
93
|
-
/**
|
|
94
|
-
* Decodes the substrate address from the given format
|
|
95
|
-
*
|
|
96
|
-
* @param {string} address
|
|
97
|
-
* @param {number} [ss58Format]
|
|
98
|
-
* @returns {string}
|
|
99
|
-
*/
|
|
100
|
-
encodeSubstrateAddress(address: string, ss58Format?: number): string;
|
|
101
|
-
/**
|
|
102
|
-
* Retrieves the txHash of a signed txHex
|
|
103
|
-
*
|
|
104
|
-
* @param txHex signed transaction hex
|
|
105
|
-
* @returns {string}
|
|
106
|
-
*/
|
|
107
|
-
getTxHash(txHex: string): string;
|
|
108
|
-
isSigningPayload(payload: DecodedSigningPayload | DecodedSignedTx): payload is DecodedSigningPayload;
|
|
109
|
-
isProxyTransfer(arg: TxMethod['args']): arg is ProxyArgs;
|
|
110
|
-
isTransfer(arg: TxMethod['args']): arg is TransferArgs;
|
|
111
|
-
isTransferAll(arg: TxMethod['args']): arg is TransferAllArgs;
|
|
112
|
-
/**
|
|
113
|
-
* Returns true if arg is of type BatchArgs, false otherwise.
|
|
114
|
-
*
|
|
115
|
-
* @param arg The object to test.
|
|
116
|
-
*
|
|
117
|
-
* @return true if arg is of type BatchArgs, false otherwise.
|
|
118
|
-
*/
|
|
119
|
-
isBatch(arg: TxMethod['args']): arg is BatchArgs;
|
|
120
|
-
/**
|
|
121
|
-
* Returns true if arg is of type BatchArgs and the calls of the batch are staking calls: a stake
|
|
122
|
-
* call (bond) followed by an add proxy call (addProxy), false otherwise.
|
|
123
|
-
*
|
|
124
|
-
* @param arg The object to test.
|
|
125
|
-
*
|
|
126
|
-
* @return true if arg is of type BatchArgs and the calls of the batch are staking calls: a stake
|
|
127
|
-
* call (bond) followed by an add proxy call (addProxy), false otherwise.
|
|
128
|
-
*/
|
|
129
|
-
isStakingBatch(arg: TxMethod['args']): arg is BatchArgs;
|
|
130
|
-
/**
|
|
131
|
-
* Returns true if arg is of type StakeBatchCallArgs, false otherwise.
|
|
132
|
-
*
|
|
133
|
-
* @param arg The object to test.
|
|
134
|
-
*
|
|
135
|
-
* @return true if arg is of type StakeBatchCallArgs, false otherwise.
|
|
136
|
-
*/
|
|
137
|
-
isStakeBatchCallArgs(arg: BatchCallObject['args']): arg is StakeBatchCallArgs;
|
|
138
|
-
/**
|
|
139
|
-
* Returns true if arg is of type AddProxyBatchCallArgs, false otherwise.
|
|
140
|
-
*
|
|
141
|
-
* @param arg The object to test.
|
|
142
|
-
*
|
|
143
|
-
* @return true if arg is of type AddProxyBatchCallArgs, false otherwise.
|
|
144
|
-
*/
|
|
145
|
-
isAddProxyBatchCallArgs(arg: BatchCallObject['args']): arg is AddProxyBatchCallArgs;
|
|
146
|
-
/**
|
|
147
|
-
* Returns true if arg is of type BatchArgs and the calls of the batch are unstaking calls: a remove
|
|
148
|
-
* proxy call (removeProxy), followed by a chill call, and an unstake call (unbond), false otherwise.
|
|
149
|
-
*
|
|
150
|
-
* @param arg The object to test.
|
|
151
|
-
*
|
|
152
|
-
* @return true if arg is of type BatchArgs and the calls of the batch are unstaking calls: a remove
|
|
153
|
-
* proxy call (removeProxy), followed by a chill call, and an unstake call (unbond), false otherwise.
|
|
154
|
-
*/
|
|
155
|
-
isUnstakingBatch(arg: TxMethod['args']): arg is BatchArgs;
|
|
156
|
-
/**
|
|
157
|
-
* Returns true if arg is of type AddProxyBatchCallArgs, false otherwise.
|
|
158
|
-
*
|
|
159
|
-
* @param arg The object to test.
|
|
160
|
-
*
|
|
161
|
-
* @return true if arg is of type AddProxyBatchCallArgs, false otherwise.
|
|
162
|
-
*/
|
|
163
|
-
isRemoveProxyBatchCallArgs(arg: BatchCallObject['args']): arg is AddProxyBatchCallArgs;
|
|
164
|
-
/**
|
|
165
|
-
* Returns true if arg is of type UnstakeBatchCallArgs, false otherwise.
|
|
166
|
-
*
|
|
167
|
-
* @param arg The object to test.
|
|
168
|
-
*
|
|
169
|
-
* @return true if arg is of type UnstakeBatchCallArgs, false otherwise.
|
|
170
|
-
*/
|
|
171
|
-
isUnstakeBatchCallArgs(arg: BatchCallObject['args']): arg is UnstakeBatchCallArgs;
|
|
172
|
-
/**
|
|
173
|
-
* Returns true if arg is of type StakeArgs, false otherwise.
|
|
174
|
-
*
|
|
175
|
-
* @param arg The object to test.
|
|
176
|
-
*
|
|
177
|
-
* @return true if arg is of type StakeArgs, false otherwise.
|
|
178
|
-
*/
|
|
179
|
-
isBond(arg: TxMethod['args']): arg is StakeArgs;
|
|
180
|
-
/**
|
|
181
|
-
* Returns true if arg is of type StakeMoreArgs, false otherwise.
|
|
182
|
-
*
|
|
183
|
-
* @param arg The object to test.
|
|
184
|
-
*
|
|
185
|
-
* @return true if arg is of type StakeMoreArgs, false otherwise.
|
|
186
|
-
*/
|
|
187
|
-
isBondExtra(arg: TxMethod['args'] | BatchCallObject['args']): arg is StakeMoreArgs;
|
|
188
|
-
/**
|
|
189
|
-
* Returns true if arg is of type StakeMoreArgs, false otherwise.
|
|
190
|
-
*
|
|
191
|
-
* @param arg The object to test.
|
|
192
|
-
*
|
|
193
|
-
* @return true if arg is of type StakeMoreArgs, false otherwise.
|
|
194
|
-
*/
|
|
195
|
-
isBondBatchExtra(arg: BatchCallObject['args']): arg is StakeMoreCallArgs;
|
|
196
|
-
/**
|
|
197
|
-
* extracts and returns the signature in hex format given a raw signed transaction
|
|
198
|
-
*
|
|
199
|
-
* @param {string} rawTx signed raw transaction
|
|
200
|
-
* @param options registry substrate registry used to retrieve the signature
|
|
201
|
-
*/
|
|
202
|
-
recoverSignatureFromRawTx(rawTx: string, options: {
|
|
203
|
-
registry: TypeRegistry;
|
|
204
|
-
}): string;
|
|
205
|
-
/**
|
|
206
|
-
* Decodes the dot address from the given format
|
|
207
|
-
*
|
|
208
|
-
* @param {string} address
|
|
209
|
-
* @param {number} [ss58Format]
|
|
210
|
-
* @returns {KeyPair}
|
|
211
|
-
*/
|
|
212
|
-
decodeSubstrateAddressToKeyPair(address: string, ss58Format?: number): KeyPair;
|
|
213
|
-
getMaterial(coinConfig: Readonly<CoinConfig>): Material;
|
|
214
|
-
/**
|
|
215
|
-
* Checks whether the given input is a hex string with with 0 value
|
|
216
|
-
* used to check whether a given transaction is immortal or mortal
|
|
217
|
-
* @param hexValue
|
|
218
|
-
*/
|
|
219
|
-
isZeroHex(hexValue: string): boolean;
|
|
220
|
-
/**
|
|
221
|
-
* Takes an asset name and returns the respective address to format to
|
|
222
|
-
* since substrate addresses differ depending on the network
|
|
223
|
-
* @param networkCoinName
|
|
224
|
-
*/
|
|
225
|
-
getAddressFormat(networkCoinName: DotAssetTypes): DotAddressFormat;
|
|
226
|
-
/**
|
|
227
|
-
* Creates a pure proxy extrinsic. Substrate has renamed anonymous proxies to pure proxies, but
|
|
228
|
-
* the libraries we are using to build transactions have not been updated, as a stop gap we are
|
|
229
|
-
* defining the pure proxy extrinsic here.
|
|
230
|
-
*
|
|
231
|
-
* @param args Arguments to the createPure extrinsic.
|
|
232
|
-
* @param info Common information to all transactions.
|
|
233
|
-
* @param options Chain registry and metadata.
|
|
234
|
-
*/
|
|
235
|
-
pureProxy(args: PureProxyArgs, info: BaseTxInfo, options: OptionsWithMeta): UnsignedTransaction;
|
|
236
|
-
/**
|
|
237
|
-
* Removes '0x' from a given `string` if present.
|
|
238
|
-
*
|
|
239
|
-
* @param {string} str the string value.
|
|
240
|
-
*
|
|
241
|
-
* @return {string} a string without a '0x' prefix.
|
|
242
|
-
*/
|
|
243
|
-
stripHexPrefix(str: string): string;
|
|
244
|
-
/**
|
|
245
|
-
* Returns true if a string starts with '0x', false otherwise.
|
|
246
|
-
*
|
|
247
|
-
* @param {string} str the string value.
|
|
248
|
-
*
|
|
249
|
-
* @return {boolean} true if a string starts with '0x', false otherwise.
|
|
250
|
-
*/
|
|
251
|
-
isHexPrefixed(str: string): boolean;
|
|
252
|
-
/**
|
|
253
|
-
* Decodes the dot address from the given format
|
|
254
|
-
*
|
|
255
|
-
* @param {string} address
|
|
256
|
-
* @param {number} [ss58Format]
|
|
257
|
-
* @returns {string}
|
|
258
|
-
*/
|
|
259
|
-
decodeDotAddress(address: string, ss58Format: number): string;
|
|
260
|
-
}
|
|
261
|
-
interface PureProxyArgs extends Args {
|
|
262
|
-
proxyType: string;
|
|
263
|
-
delay: number;
|
|
264
|
-
index: number;
|
|
1
|
+
import { Utils as SubstrateUtils, Interface } from '@bitgo-beta/abstract-substrate';
|
|
2
|
+
import { NetworkType } from '@bitgo-beta/statics';
|
|
3
|
+
export declare class Utils extends SubstrateUtils {
|
|
4
|
+
getMaterial(networkType: NetworkType): Interface.Material;
|
|
265
5
|
}
|
|
266
6
|
declare const utils: Utils;
|
|
267
7
|
export default utils;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/lib/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,IAAI,cAAc,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAGlD,qBAAa,KAAM,SAAQ,cAAc;IACvC,WAAW,CAAC,WAAW,EAAE,WAAW,GAAG,SAAS,CAAC,QAAQ;CAG1D;AAED,QAAA,MAAM,KAAK,OAAc,CAAC;AAC1B,eAAe,KAAK,CAAC"}
|