@airgap/coinlib-core 0.13.45-beta.1 → 0.13.45-beta.3
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/actions/Action.js +30 -83
- package/actions/Action.js.map +1 -1
- package/actions/LinkedAction.js +18 -82
- package/actions/LinkedAction.js.map +1 -1
- package/actions/RepeatableAction.js +20 -83
- package/actions/RepeatableAction.js.map +1 -1
- package/actions/SimpleAction.js +12 -74
- package/actions/SimpleAction.js.map +1 -1
- package/actions/StateMachine.js +16 -17
- package/actions/StateMachine.js.map +1 -1
- package/data/KeyPair.d.ts +0 -1
- package/data/Lazy.js +15 -64
- package/data/Lazy.js.map +1 -1
- package/data/RPCBody.js +3 -6
- package/data/RPCBody.js.map +1 -1
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.d.ts +12 -12
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js +88 -130
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js.map +1 -1
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.d.ts +3 -3
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js +57 -61
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js.map +1 -1
- package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js +96 -96
- package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js.map +1 -1
- package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js +1 -2
- package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js.map +1 -1
- package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js +8 -10
- package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js +22 -28
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js +9 -10
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js +10 -11
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js +7 -8
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js.map +1 -1
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.d.ts +3 -3
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js +61 -63
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js.map +1 -1
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.d.ts +4 -4
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js +61 -63
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js.map +1 -1
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.d.ts +1 -1
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js +2 -3
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js +111 -111
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js +15 -15
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js +47 -76
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js +46 -61
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js +61 -106
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.d.ts +6 -6
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js +95 -100
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js +33 -33
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js +9 -9
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js +46 -75
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js +45 -70
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js +41 -41
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js +4 -4
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.d.ts +2 -2
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js +58 -63
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js +30 -33
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js +18 -20
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js +5 -12
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js +13 -13
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.d.ts +78 -78
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js +2 -2
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.d.ts +45 -45
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js +75 -76
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js +115 -178
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.d.ts +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js +6 -9
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js +78 -83
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js +27 -36
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.d.ts +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js +25 -26
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js.map +1 -1
- package/dependencies/src/cosmjs/index.d.ts +14 -230
- package/dependencies/src/cosmjs/index.js +373 -480
- package/dependencies/src/cosmjs/index.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/index.d.ts +0 -1
- package/dependencies/src/eciesjs-0.3.9/src/index.js +15 -19
- package/dependencies/src/eciesjs-0.3.9/src/index.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.d.ts +0 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js +37 -28
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.d.ts +0 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js +38 -30
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/utils.d.ts +0 -1
- package/dependencies/src/eciesjs-0.3.9/src/utils.js +33 -24
- package/dependencies/src/eciesjs-0.3.9/src/utils.js.map +1 -1
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js +42 -34
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map +1 -1
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js +6 -10
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map +1 -1
- package/errors/coinlib-error.js +16 -37
- package/errors/coinlib-error.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.js +89 -148
- package/errors/index.js.map +1 -1
- package/index.js +19 -19
- package/index.js.map +1 -1
- package/interfaces/IAirGapSignedTransaction.d.ts +1 -1
- package/interfaces/IAirGapTransaction.js +3 -3
- package/interfaces/IAirGapTransaction.js.map +1 -1
- package/networks.js +9 -9
- package/networks.js.map +1 -1
- package/package.json +1 -1
- package/protocols/BlockExplorerProtocol.js +7 -54
- package/protocols/BlockExplorerProtocol.js.map +1 -1
- package/protocols/CryptoClient.js +19 -78
- package/protocols/CryptoClient.js.map +1 -1
- package/protocols/Ed25519CryptoClient.js +30 -98
- package/protocols/Ed25519CryptoClient.js.map +1 -1
- package/protocols/ICoinSubProtocol.js +1 -1
- package/protocols/ICoinSubProtocol.js.map +1 -1
- package/protocols/NonExtendedProtocol.js +26 -29
- package/protocols/NonExtendedProtocol.js.map +1 -1
- package/protocols/Secp256k1CryptoClient.js +9 -73
- package/protocols/Secp256k1CryptoClient.js.map +1 -1
- package/protocols/Sr25519CryptoClient.js +12 -76
- package/protocols/Sr25519CryptoClient.js.map +1 -1
- package/utils/AES.js +81 -132
- package/utils/AES.js.map +1 -1
- package/utils/ErrorWithData.js +5 -23
- package/utils/ErrorWithData.js.map +1 -1
- package/utils/Network.js +1 -1
- package/utils/Network.js.map +1 -1
- package/utils/ProtocolBlockExplorer.js +3 -4
- package/utils/ProtocolBlockExplorer.js.map +1 -1
- package/utils/ProtocolNetwork.js +11 -16
- package/utils/ProtocolNetwork.js.map +1 -1
- package/utils/ProtocolSymbols.d.ts +1 -1
- package/utils/ProtocolSymbols.js +6 -6
- package/utils/ProtocolSymbols.js.map +1 -1
- package/utils/array.js +14 -15
- package/utils/array.js.map +1 -1
- package/utils/assert.js +8 -12
- package/utils/assert.js.map +1 -1
- package/utils/base64Check.d.ts +0 -1
- package/utils/base64Check.js +15 -15
- package/utils/base64Check.js.map +1 -1
- package/utils/blake2b.js +11 -14
- package/utils/blake2b.js.map +1 -1
- package/utils/buffer.d.ts +0 -1
- package/utils/buffer.js +1 -1
- package/utils/buffer.js.map +1 -1
- package/utils/cache.js +38 -87
- package/utils/cache.js.map +1 -1
- package/utils/error.js +2 -3
- package/utils/error.js.map +1 -1
- package/utils/hex.d.ts +1 -2
- package/utils/hex.js +31 -38
- package/utils/hex.js.map +1 -1
- package/utils/interfaces.js +3 -4
- package/utils/interfaces.js.map +1 -1
- package/utils/object.js +5 -7
- package/utils/object.js.map +1 -1
- package/utils/padStart.js +1 -2
- package/utils/padStart.js.map +1 -1
- package/utils/remote-data/HttpRemoteData.js +24 -107
- package/utils/remote-data/HttpRemoteData.js.map +1 -1
- package/utils/remote-data/IpfsRemoteData.js +32 -116
- package/utils/remote-data/IpfsRemoteData.js.map +1 -1
- package/utils/remote-data/RemoteData.d.ts +0 -1
- package/utils/remote-data/RemoteData.js +3 -4
- package/utils/remote-data/RemoteData.js.map +1 -1
- package/utils/remote-data/RemoteDataFactory.d.ts +2 -2
- package/utils/remote-data/RemoteDataFactory.js +13 -20
- package/utils/remote-data/RemoteDataFactory.js.map +1 -1
- package/utils/remote-data/Sha256RemoteData.d.ts +0 -1
- package/utils/remote-data/Sha256RemoteData.js +44 -117
- package/utils/remote-data/Sha256RemoteData.js.map +1 -1
- package/utils/string.js +8 -9
- package/utils/string.js.map +1 -1
- package/utils/type.js +3 -4
- package/utils/type.js.map +1 -1
- package/utils/xxhash.d.ts +0 -1
- package/utils/xxhash.js +9 -11
- package/utils/xxhash.js.map +1 -1
- package/wallet/AirGapCoinWallet.js +64 -183
- package/wallet/AirGapCoinWallet.js.map +1 -1
- package/wallet/AirGapMarketWallet.js +88 -201
- package/wallet/AirGapMarketWallet.js.map +1 -1
- package/wallet/AirGapNFTWallet.js +48 -165
- package/wallet/AirGapNFTWallet.js.map +1 -1
- package/wallet/AirGapWallet.js +58 -145
- package/wallet/AirGapWallet.js.map +1 -1
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js
CHANGED
|
@@ -31,71 +31,79 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
31
31
|
}) : function(o, v) {
|
|
32
32
|
o["default"] = v;
|
|
33
33
|
});
|
|
34
|
-
var __importStar = (this && this.__importStar) || function (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
34
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
35
|
+
var ownKeys = function(o) {
|
|
36
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
37
|
+
var ar = [];
|
|
38
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
39
|
+
return ar;
|
|
40
|
+
};
|
|
41
|
+
return ownKeys(o);
|
|
42
|
+
};
|
|
43
|
+
return function (mod) {
|
|
44
|
+
if (mod && mod.__esModule) return mod;
|
|
45
|
+
var result = {};
|
|
46
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
+
__setModuleDefault(result, mod);
|
|
48
|
+
return result;
|
|
49
|
+
};
|
|
50
|
+
})();
|
|
41
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
exports.getMasterKeyFromSeed = getMasterKeyFromSeed;
|
|
53
|
+
exports.deriveChild = deriveChild;
|
|
54
|
+
exports.getKeyPair = getKeyPair;
|
|
55
|
+
exports.derivePathFromKey = derivePathFromKey;
|
|
56
|
+
exports.derivePathFromSeed = derivePathFromSeed;
|
|
57
|
+
const nacl = __importStar(require("../../tweetnacl-1.0.1/nacl"));
|
|
58
|
+
const naclAuth = __importStar(require("../../tweetnacl-auth-1.0.1/nacl-auth"));
|
|
59
|
+
const index_1 = require("../../bip32-path-0.4.2/index");
|
|
60
|
+
const ED25519_CURVE = Buffer.from('ed25519 seed');
|
|
61
|
+
const HARDENED_OFFSET = 0x80000000;
|
|
48
62
|
function getMasterKeyFromSeed(seed) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
const I = naclAuth.full(seed, ED25519_CURVE);
|
|
64
|
+
const IL = I.slice(0, 32);
|
|
65
|
+
const IR = I.slice(32);
|
|
52
66
|
return {
|
|
53
67
|
privateKey: IL,
|
|
54
68
|
chainCode: IR
|
|
55
69
|
};
|
|
56
70
|
}
|
|
57
|
-
|
|
58
|
-
function deriveChild(_a, index) {
|
|
59
|
-
var privateKey = _a.privateKey, chainCode = _a.chainCode;
|
|
71
|
+
function deriveChild({ privateKey, chainCode }, index) {
|
|
60
72
|
if (index < HARDENED_OFFSET) {
|
|
61
|
-
throw new Error(
|
|
73
|
+
throw new Error(`Child index #${index} is not supported`);
|
|
62
74
|
}
|
|
63
|
-
|
|
75
|
+
const indexBuffer = Buffer.allocUnsafe(4);
|
|
64
76
|
indexBuffer.writeUInt32BE(index, 0);
|
|
65
|
-
|
|
77
|
+
const data = Buffer.concat([
|
|
66
78
|
Buffer.alloc(1, 0),
|
|
67
79
|
Buffer.from(privateKey),
|
|
68
80
|
Buffer.from(indexBuffer)
|
|
69
81
|
]);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
82
|
+
const I = naclAuth.full(data, Buffer.from(chainCode));
|
|
83
|
+
const IL = I.slice(0, 32);
|
|
84
|
+
const IR = I.slice(32);
|
|
73
85
|
return {
|
|
74
86
|
privateKey: IL,
|
|
75
87
|
chainCode: IR
|
|
76
88
|
};
|
|
77
89
|
}
|
|
78
|
-
exports.deriveChild = deriveChild;
|
|
79
90
|
function getKeyPair(privateKey) {
|
|
80
91
|
return nacl.sign.keyPair.fromSeed(privateKey);
|
|
81
92
|
}
|
|
82
|
-
exports.getKeyPair = getKeyPair;
|
|
83
93
|
function derivePathFromKey(path, key) {
|
|
84
|
-
|
|
85
|
-
segments.forEach(
|
|
94
|
+
const segments = path === '' ? [] : (0, index_1.fromString)(path).toPathArray();
|
|
95
|
+
segments.forEach((segment, i) => {
|
|
86
96
|
if (segment < HARDENED_OFFSET) {
|
|
87
|
-
throw new Error(
|
|
97
|
+
throw new Error(`Segment #${i + 1} is not hardened`);
|
|
88
98
|
}
|
|
89
99
|
});
|
|
90
|
-
return segments.reduce(
|
|
100
|
+
return segments.reduce((parentKey, segment) => deriveChild(parentKey, segment), key);
|
|
91
101
|
}
|
|
92
|
-
exports.derivePathFromKey = derivePathFromKey;
|
|
93
102
|
function derivePathFromSeed(path, seed) {
|
|
94
103
|
if (!['m', 'm/'].includes(path.slice(0, 2))) {
|
|
95
104
|
throw new Error('Invalid path');
|
|
96
105
|
}
|
|
97
|
-
|
|
106
|
+
const masterKey = getMasterKeyFromSeed(seed);
|
|
98
107
|
return derivePathFromKey(path.slice(2), masterKey);
|
|
99
108
|
}
|
|
100
|
-
exports.derivePathFromSeed = derivePathFromSeed;
|
|
101
109
|
//# sourceMappingURL=hd-key.js.map
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hd-key.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"hd-key.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.ts"],"names":[],"mappings":"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"}
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js
CHANGED
|
@@ -16,22 +16,18 @@
|
|
|
16
16
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.
|
|
20
|
-
|
|
19
|
+
exports.generateHDWallet = generateHDWallet;
|
|
20
|
+
exports.generateWalletUsingDerivationPath = generateWalletUsingDerivationPath;
|
|
21
|
+
exports.getHDWalletAccounts = getHDWalletAccounts;
|
|
22
|
+
const hd_key_1 = require("./hd-key");
|
|
21
23
|
function generateHDWallet(seed) {
|
|
22
24
|
return (0, hd_key_1.derivePathFromSeed)('m/44h/457h', seed);
|
|
23
25
|
}
|
|
24
|
-
|
|
25
|
-
function generateWalletUsingDerivationPath(seed, derivationPath) {
|
|
26
|
-
if (derivationPath === void 0) { derivationPath = 'm/44h/457h/0h/0h/0h'; }
|
|
26
|
+
function generateWalletUsingDerivationPath(seed, derivationPath = 'm/44h/457h/0h/0h/0h') {
|
|
27
27
|
return (0, hd_key_1.getKeyPair)((0, hd_key_1.derivePathFromSeed)(derivationPath, seed).privateKey);
|
|
28
28
|
}
|
|
29
|
-
exports.generateWalletUsingDerivationPath = generateWalletUsingDerivationPath;
|
|
30
29
|
function getHDWalletAccounts(wallet, accountCount) {
|
|
31
30
|
return new Array(accountCount).fill()
|
|
32
|
-
.map(
|
|
33
|
-
return (0, hd_key_1.getKeyPair)((0, hd_key_1.derivePathFromKey)("".concat(idx, "h/0h/0h"), wallet).privateKey);
|
|
34
|
-
});
|
|
31
|
+
.map((_, idx) => (0, hd_key_1.getKeyPair)((0, hd_key_1.derivePathFromKey)(`${idx}h/0h/0h`, wallet).privateKey));
|
|
35
32
|
}
|
|
36
|
-
exports.getHDWalletAccounts = getHDWalletAccounts;
|
|
37
33
|
//# sourceMappingURL=hd-wallet.js.map
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hd-wallet.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"hd-wallet.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;AAIH,4CAEC;AAED,8EAEC;AAED,kDAIC;AAdD,qCAA4E;AAE5E,SAAgB,gBAAgB,CAAE,IAAI;IACpC,OAAO,IAAA,2BAAkB,EAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC/C,CAAC;AAED,SAAgB,iCAAiC,CAAE,IAAI,EAAE,cAAc,GAAG,qBAAqB;IAC7F,OAAO,IAAA,mBAAU,EAAC,IAAA,2BAAkB,EAAC,cAAc,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;AACxE,CAAC;AAED,SAAgB,mBAAmB,CAAE,MAAM,EAAE,YAAY;IACvD,OAAQ,IAAI,KAAK,CAAC,YAAY,CAAS,CAAC,IAAI,EAAE;SAC3C,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CACd,IAAA,mBAAU,EAAC,IAAA,0BAAiB,EAAC,GAAG,GAAG,SAAS,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;AACxE,CAAC"}
|
package/errors/coinlib-error.js
CHANGED
|
@@ -1,19 +1,4 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.CoinlibAssertionError = exports.CoinlibError = exports.Domain = void 0;
|
|
19
4
|
var Domain;
|
|
@@ -37,30 +22,24 @@ var Domain;
|
|
|
37
22
|
Domain["OPTIMISM"] = "OPTIMISM";
|
|
38
23
|
Domain["MINA"] = "MINA";
|
|
39
24
|
Domain["STELLAR"] = "STELLAR";
|
|
40
|
-
})(Domain
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
_this.description = description;
|
|
48
|
-
return _this;
|
|
25
|
+
})(Domain || (exports.Domain = Domain = {}));
|
|
26
|
+
class CoinlibError extends Error {
|
|
27
|
+
constructor(domain, code, description) {
|
|
28
|
+
super(description ? `${domain}(${code}): ${description}` : `${domain}(${code})`);
|
|
29
|
+
this.domain = domain;
|
|
30
|
+
this.code = code;
|
|
31
|
+
this.description = description;
|
|
49
32
|
}
|
|
50
|
-
|
|
51
|
-
}(Error));
|
|
33
|
+
}
|
|
52
34
|
exports.CoinlibError = CoinlibError;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_this.actual = actual;
|
|
61
|
-
return _this;
|
|
35
|
+
class CoinlibAssertionError extends Error {
|
|
36
|
+
constructor(domain, code, expected, actual) {
|
|
37
|
+
super(`${domain}(${code}): expected ${expected} but got ${actual}.`);
|
|
38
|
+
this.domain = domain;
|
|
39
|
+
this.code = code;
|
|
40
|
+
this.expected = expected;
|
|
41
|
+
this.actual = actual;
|
|
62
42
|
}
|
|
63
|
-
|
|
64
|
-
}(Error));
|
|
43
|
+
}
|
|
65
44
|
exports.CoinlibAssertionError = CoinlibAssertionError;
|
|
66
45
|
//# sourceMappingURL=coinlib-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinlib-error.js","sourceRoot":"","sources":["../../src/errors/coinlib-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coinlib-error.js","sourceRoot":"","sources":["../../src/errors/coinlib-error.ts"],"names":[],"mappings":";;;AAAA,IAAY,MAoBX;AApBD,WAAY,MAAM;IAChB,mCAAyB,CAAA;IACzB,uCAA6B,CAAA;IAC7B,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,qCAA2B,CAAA;IAC3B,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,qBAAW,CAAA;IACX,2BAAiB,CAAA;IACjB,+BAAqB,CAAA;IACrB,uBAAa,CAAA;IACb,6BAAmB,CAAA;AACrB,CAAC,EApBW,MAAM,sBAAN,MAAM,QAoBjB;AAED,MAAa,YAAa,SAAQ,KAAK;IACrC,YACS,MAAc,EACd,IAAY,EACZ,WAAoB;QAE3B,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,MAAM,WAAW,EAAE,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,IAAI,GAAG,CAAC,CAAA;QAJzE,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,gBAAW,GAAX,WAAW,CAAS;IAG7B,CAAC;CACF;AARD,oCAQC;AAED,MAAa,qBAAsB,SAAQ,KAAK;IAC9C,YACS,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,MAAM;QAEb,KAAK,CAAC,GAAG,MAAM,IAAI,IAAI,eAAe,QAAQ,YAAY,MAAM,GAAG,CAAC,CAAA;QAL7D,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAQ;QACZ,aAAQ,GAAR,QAAQ,CAAQ;QAChB,WAAM,GAAN,MAAM,CAAA;IAGf,CAAC;CACF;AATD,sDASC"}
|
package/errors/index.d.ts
CHANGED
|
@@ -70,8 +70,8 @@ export declare class BalanceError extends CoinlibError {
|
|
|
70
70
|
constructor(domain: Domain, description?: string);
|
|
71
71
|
}
|
|
72
72
|
export declare class TransactionError extends CoinlibError {
|
|
73
|
-
data?: unknown;
|
|
74
|
-
constructor(domain: Domain, description?: string, data?: unknown);
|
|
73
|
+
data?: unknown | undefined;
|
|
74
|
+
constructor(domain: Domain, description?: string, data?: unknown | undefined);
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Gets thrown if an accessed object property is undefined
|
package/errors/index.js
CHANGED
|
@@ -1,22 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.InvalidString = exports.InvalidHexString = exports.InvalidPayloadError = exports.InvalidSchemaType = exports.InvalidSchema = exports.TypeNotSupported = exports.ProtocolVersionMismatch = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.SerializerError = exports.InvalidValueError = exports.NotImplementedError = exports.OperationFailedError = exports.PropertyUndefinedError = exports.TransactionError = exports.BalanceError = exports.NotFoundError = exports.UnsupportedError = exports.ConditionViolationError = exports.NetworkError = exports.ProtocolErrorType = exports.SerializerErrorType = void 0;
|
|
19
|
-
|
|
4
|
+
const coinlib_error_1 = require("./coinlib-error");
|
|
20
5
|
var SerializerErrorType;
|
|
21
6
|
(function (SerializerErrorType) {
|
|
22
7
|
SerializerErrorType["SERIALIZER_VERSION_MISMATCH"] = "SERIALIZER_VERSION_MISMATCH";
|
|
@@ -36,7 +21,7 @@ var SerializerErrorType;
|
|
|
36
21
|
SerializerErrorType["PAYLOAD_TYPE_NOT_SUPPORTED"] = "PAYLOAD_TYPE_NOT_SUPPORTED";
|
|
37
22
|
SerializerErrorType["PROPERTY_IS_EMPTY"] = "PROPERTY_IS_EMPTY";
|
|
38
23
|
SerializerErrorType["PROPERTY_INVALID"] = "PROPERTY_INVALID";
|
|
39
|
-
})(SerializerErrorType
|
|
24
|
+
})(SerializerErrorType || (exports.SerializerErrorType = SerializerErrorType = {}));
|
|
40
25
|
var ProtocolErrorType;
|
|
41
26
|
(function (ProtocolErrorType) {
|
|
42
27
|
ProtocolErrorType["NETWORK"] = "NETWORK";
|
|
@@ -49,233 +34,189 @@ var ProtocolErrorType;
|
|
|
49
34
|
ProtocolErrorType["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
50
35
|
ProtocolErrorType["INVALID_VALUE"] = "INVALID_VALUE";
|
|
51
36
|
ProtocolErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
|
|
52
|
-
})(ProtocolErrorType
|
|
37
|
+
})(ProtocolErrorType || (exports.ProtocolErrorType = ProtocolErrorType = {}));
|
|
53
38
|
/**
|
|
54
39
|
* Gets thrown if an error occurs when making a network request
|
|
55
40
|
* Partial<AxiosError> is either an AxiosError or an AxiosResponse,
|
|
56
41
|
* as we sometimes want to throw an Error even though we get a 200 response
|
|
57
42
|
* from the API (as in case of internal operation errors for Tezos).
|
|
58
43
|
*/
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
_this.url = (_c = error.config) === null || _c === void 0 ? void 0 : _c.url;
|
|
68
|
-
_this.method = (_d = error.config) === null || _d === void 0 ? void 0 : _d.method;
|
|
69
|
-
_this.requestBody = (_e = error.config) === null || _e === void 0 ? void 0 : _e.data;
|
|
70
|
-
return _this;
|
|
44
|
+
class NetworkError extends coinlib_error_1.CoinlibError {
|
|
45
|
+
constructor(domain, error, description) {
|
|
46
|
+
super(domain, ProtocolErrorType.NETWORK);
|
|
47
|
+
this.data = description ?? error.response?.data;
|
|
48
|
+
this.status = error?.response?.status;
|
|
49
|
+
this.url = error.config?.url;
|
|
50
|
+
this.method = error.config?.method;
|
|
51
|
+
this.requestBody = error.config?.data;
|
|
71
52
|
}
|
|
72
|
-
|
|
73
|
-
}(coinlib_error_1.CoinlibError));
|
|
53
|
+
}
|
|
74
54
|
exports.NetworkError = NetworkError;
|
|
75
55
|
/**
|
|
76
56
|
* Gets thrown if a value ist expected to fulfill a certain condition such as having a certain length, but the condition is not satisfied
|
|
77
57
|
*/
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
return _super.call(this, domain, ProtocolErrorType.CONDITION_VIOLATION, description) || this;
|
|
58
|
+
class ConditionViolationError extends coinlib_error_1.CoinlibError {
|
|
59
|
+
constructor(domain, description) {
|
|
60
|
+
super(domain, ProtocolErrorType.CONDITION_VIOLATION, description);
|
|
82
61
|
}
|
|
83
|
-
|
|
84
|
-
}(coinlib_error_1.CoinlibError));
|
|
62
|
+
}
|
|
85
63
|
exports.ConditionViolationError = ConditionViolationError;
|
|
86
64
|
/**
|
|
87
65
|
* Gets thrown if a variable assumes a value for which an operation is not supported
|
|
88
66
|
*/
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
return _super.call(this, domain, ProtocolErrorType.UNSUPPORTED, description) || this;
|
|
67
|
+
class UnsupportedError extends coinlib_error_1.CoinlibError {
|
|
68
|
+
constructor(domain, description) {
|
|
69
|
+
super(domain, ProtocolErrorType.UNSUPPORTED, description);
|
|
93
70
|
}
|
|
94
|
-
|
|
95
|
-
}(coinlib_error_1.CoinlibError));
|
|
71
|
+
}
|
|
96
72
|
exports.UnsupportedError = UnsupportedError;
|
|
97
73
|
/**
|
|
98
74
|
* Gets thrown if a variable is unexpectedly undefined
|
|
99
75
|
*/
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return _super.call(this, domain, ProtocolErrorType.NOT_FOUND, description) || this;
|
|
76
|
+
class NotFoundError extends coinlib_error_1.CoinlibError {
|
|
77
|
+
constructor(domain, description) {
|
|
78
|
+
super(domain, ProtocolErrorType.NOT_FOUND, description);
|
|
104
79
|
}
|
|
105
|
-
|
|
106
|
-
}(coinlib_error_1.CoinlibError));
|
|
80
|
+
}
|
|
107
81
|
exports.NotFoundError = NotFoundError;
|
|
108
82
|
/**
|
|
109
83
|
* Gets thrown if an account has an insufficient balance to perform a certain kind of operation
|
|
110
84
|
*/
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return _super.call(this, domain, ProtocolErrorType.BALANCE, description) || this;
|
|
85
|
+
class BalanceError extends coinlib_error_1.CoinlibError {
|
|
86
|
+
constructor(domain, description) {
|
|
87
|
+
super(domain, ProtocolErrorType.BALANCE, description);
|
|
115
88
|
}
|
|
116
|
-
|
|
117
|
-
}(coinlib_error_1.CoinlibError));
|
|
89
|
+
}
|
|
118
90
|
exports.BalanceError = BalanceError;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
_this.data = data;
|
|
124
|
-
return _this;
|
|
91
|
+
class TransactionError extends coinlib_error_1.CoinlibError {
|
|
92
|
+
constructor(domain, description, data) {
|
|
93
|
+
super(domain, ProtocolErrorType.TRANSACTION_FAILED, description);
|
|
94
|
+
this.data = data;
|
|
125
95
|
}
|
|
126
|
-
|
|
127
|
-
}(coinlib_error_1.CoinlibError));
|
|
96
|
+
}
|
|
128
97
|
exports.TransactionError = TransactionError;
|
|
129
98
|
/**
|
|
130
99
|
* Gets thrown if an accessed object property is undefined
|
|
131
100
|
*/
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
return _super.call(this, domain, ProtocolErrorType.PROPERTY_UNDEFINED, description) || this;
|
|
101
|
+
class PropertyUndefinedError extends coinlib_error_1.CoinlibError {
|
|
102
|
+
constructor(domain, description) {
|
|
103
|
+
super(domain, ProtocolErrorType.PROPERTY_UNDEFINED, description);
|
|
136
104
|
}
|
|
137
|
-
|
|
138
|
-
}(coinlib_error_1.CoinlibError));
|
|
105
|
+
}
|
|
139
106
|
exports.PropertyUndefinedError = PropertyUndefinedError;
|
|
140
107
|
/**
|
|
141
108
|
* Gets thrown if an internal method fails
|
|
142
109
|
*/
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return _super.call(this, domain, ProtocolErrorType.OPERATION_FAILED, description) || this;
|
|
110
|
+
class OperationFailedError extends coinlib_error_1.CoinlibError {
|
|
111
|
+
constructor(domain, description) {
|
|
112
|
+
super(domain, ProtocolErrorType.OPERATION_FAILED, description);
|
|
147
113
|
}
|
|
148
|
-
|
|
149
|
-
}(coinlib_error_1.CoinlibError));
|
|
114
|
+
}
|
|
150
115
|
exports.OperationFailedError = OperationFailedError;
|
|
151
116
|
/**
|
|
152
117
|
* Gets thrown if a method is executed which is not implemented
|
|
153
118
|
*/
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
return _super.call(this, domain, ProtocolErrorType.NOT_IMPLEMENTED, description) || this;
|
|
119
|
+
class NotImplementedError extends coinlib_error_1.CoinlibError {
|
|
120
|
+
constructor(domain, description) {
|
|
121
|
+
super(domain, ProtocolErrorType.NOT_IMPLEMENTED, description);
|
|
158
122
|
}
|
|
159
|
-
|
|
160
|
-
}(coinlib_error_1.CoinlibError));
|
|
123
|
+
}
|
|
161
124
|
exports.NotImplementedError = NotImplementedError;
|
|
162
125
|
/**
|
|
163
126
|
* Gets thrown if a variable has a value which cannot be handled
|
|
164
127
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
return _super.call(this, domain, ProtocolErrorType.INVALID_VALUE, description) || this;
|
|
128
|
+
class InvalidValueError extends coinlib_error_1.CoinlibError {
|
|
129
|
+
constructor(domain, description) {
|
|
130
|
+
super(domain, ProtocolErrorType.INVALID_VALUE, description);
|
|
169
131
|
}
|
|
170
|
-
|
|
171
|
-
}(coinlib_error_1.CoinlibError));
|
|
132
|
+
}
|
|
172
133
|
exports.InvalidValueError = InvalidValueError;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return _super.call(this, coinlib_error_1.Domain.SERIALIZER, code, description) || this;
|
|
134
|
+
class SerializerError extends coinlib_error_1.CoinlibError {
|
|
135
|
+
constructor(code, description) {
|
|
136
|
+
super(coinlib_error_1.Domain.SERIALIZER, code, description);
|
|
177
137
|
}
|
|
178
|
-
|
|
179
|
-
}(coinlib_error_1.CoinlibError));
|
|
138
|
+
}
|
|
180
139
|
exports.SerializerError = SerializerError;
|
|
181
140
|
// tslint:disable:max-classes-per-file
|
|
182
141
|
/**
|
|
183
142
|
* Gets thrown if the serializer version does not match
|
|
184
143
|
*/
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
return _super.call(this, SerializerErrorType.SERIALIZER_VERSION_MISMATCH, description) || this;
|
|
144
|
+
class SerializerVersionMismatch extends SerializerError {
|
|
145
|
+
constructor(description) {
|
|
146
|
+
super(SerializerErrorType.SERIALIZER_VERSION_MISMATCH, description);
|
|
189
147
|
}
|
|
190
|
-
|
|
191
|
-
}(SerializerError));
|
|
148
|
+
}
|
|
192
149
|
exports.SerializerVersionMismatch = SerializerVersionMismatch;
|
|
193
150
|
/**
|
|
194
151
|
* Gets thrown if the serializer cannot handle the specified coin/protocol
|
|
195
152
|
*/
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
return _super.call(this, SerializerErrorType.PROTOCOL_NOT_SUPPORTED, description) || this;
|
|
153
|
+
class ProtocolNotSupported extends SerializerError {
|
|
154
|
+
constructor(description) {
|
|
155
|
+
super(SerializerErrorType.PROTOCOL_NOT_SUPPORTED, description);
|
|
200
156
|
}
|
|
201
|
-
|
|
202
|
-
}(SerializerError));
|
|
157
|
+
}
|
|
203
158
|
exports.ProtocolNotSupported = ProtocolNotSupported;
|
|
204
159
|
/**
|
|
205
160
|
* Gets thrown if the serializer CAN handle the specified coin/protocol, but not in this version
|
|
206
161
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
return _super.call(this, SerializerErrorType.PROTOCOL_VERSION_MISMATCH, description) || this;
|
|
162
|
+
class ProtocolVersionMismatch extends SerializerError {
|
|
163
|
+
constructor(description) {
|
|
164
|
+
super(SerializerErrorType.PROTOCOL_VERSION_MISMATCH, description);
|
|
211
165
|
}
|
|
212
|
-
|
|
213
|
-
}(SerializerError));
|
|
166
|
+
}
|
|
214
167
|
exports.ProtocolVersionMismatch = ProtocolVersionMismatch;
|
|
215
168
|
/**
|
|
216
169
|
* Gets thrown if the specified Type is not supported
|
|
217
170
|
*/
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return _super.call(this, SerializerErrorType.TYPE_NOT_SUPPORTED, description) || this;
|
|
171
|
+
class TypeNotSupported extends SerializerError {
|
|
172
|
+
constructor(description) {
|
|
173
|
+
super(SerializerErrorType.TYPE_NOT_SUPPORTED, description);
|
|
222
174
|
}
|
|
223
|
-
|
|
224
|
-
}(SerializerError));
|
|
175
|
+
}
|
|
225
176
|
exports.TypeNotSupported = TypeNotSupported;
|
|
226
177
|
/**
|
|
227
178
|
* Gets thrown if the schema in the serializer is invalid
|
|
228
179
|
*/
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
return _super.call(this, SerializerErrorType.INVALID_SCHEMA, description) || this;
|
|
180
|
+
class InvalidSchema extends SerializerError {
|
|
181
|
+
constructor(description) {
|
|
182
|
+
super(SerializerErrorType.INVALID_SCHEMA, description);
|
|
233
183
|
}
|
|
234
|
-
|
|
235
|
-
}(SerializerError));
|
|
184
|
+
}
|
|
236
185
|
exports.InvalidSchema = InvalidSchema;
|
|
237
186
|
/**
|
|
238
187
|
* Gets thrown if the 2 types provided are not compatible
|
|
239
188
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
return _super.call(this, SerializerErrorType.INVALID_SCHEMA_TYPE, description) || this;
|
|
189
|
+
class InvalidSchemaType extends SerializerError {
|
|
190
|
+
constructor(description) {
|
|
191
|
+
super(SerializerErrorType.INVALID_SCHEMA_TYPE, description);
|
|
244
192
|
}
|
|
245
|
-
|
|
246
|
-
}(SerializerError));
|
|
193
|
+
}
|
|
247
194
|
exports.InvalidSchemaType = InvalidSchemaType;
|
|
248
195
|
/**
|
|
249
196
|
* Gets thrown if the payload that is being decoded does not match the schema
|
|
250
197
|
*/
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
return _super.call(this, SerializerErrorType.INVALID_PAYLOAD, description) || this;
|
|
198
|
+
class InvalidPayloadError extends SerializerError {
|
|
199
|
+
constructor(description) {
|
|
200
|
+
super(SerializerErrorType.INVALID_PAYLOAD, description);
|
|
255
201
|
}
|
|
256
|
-
|
|
257
|
-
}(SerializerError));
|
|
202
|
+
}
|
|
258
203
|
exports.InvalidPayloadError = InvalidPayloadError;
|
|
259
204
|
/**
|
|
260
205
|
* Gets thrown if the string is not a valid hex string
|
|
261
206
|
*/
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return _super.call(this, SerializerErrorType.INVALID_HEX_STRING, description) || this;
|
|
207
|
+
class InvalidHexString extends SerializerError {
|
|
208
|
+
constructor(description) {
|
|
209
|
+
super(SerializerErrorType.INVALID_HEX_STRING, description);
|
|
266
210
|
}
|
|
267
|
-
|
|
268
|
-
}(SerializerError));
|
|
211
|
+
}
|
|
269
212
|
exports.InvalidHexString = InvalidHexString;
|
|
270
213
|
/**
|
|
271
214
|
* Gets thrown if the string starts with "0x". This causes problems with RLP
|
|
272
215
|
*/
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
return _super.call(this, SerializerErrorType.INVALID_STRING, description) || this;
|
|
216
|
+
class InvalidString extends SerializerError {
|
|
217
|
+
constructor(description) {
|
|
218
|
+
super(SerializerErrorType.INVALID_STRING, description);
|
|
277
219
|
}
|
|
278
|
-
|
|
279
|
-
}(SerializerError));
|
|
220
|
+
}
|
|
280
221
|
exports.InvalidString = InvalidString;
|
|
281
222
|
//# sourceMappingURL=index.js.map
|