@airgap/tezos 0.13.8-beta.7 → 0.13.8-beta.8
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/airgap-coinlib-tezos.min.js +1 -7
- package/package.json +4 -4
- package/v0/protocol/fa/TezosSIRS.js +1 -1
- package/v1/index.d.ts +2 -1
- package/v1/index.js +3 -1
- package/v1/index.js.map +1 -1
- package/v1/module/TezosKtModule.d.ts +8 -0
- package/v1/module/TezosKtModule.js +87 -0
- package/v1/module/TezosKtModule.js.map +1 -0
- package/v1/module/TezosModule.d.ts +6 -9
- package/v1/module/TezosModule.js +10 -126
- package/v1/module/TezosModule.js.map +1 -1
- package/v1/module/TezosShieldedTezModule.d.ts +8 -0
- package/v1/module/TezosShieldedTezModule.js +86 -0
- package/v1/module/TezosShieldedTezModule.js.map +1 -0
- package/v1/protocol/fa/TezosFAProtocol.d.ts +2 -3
- package/v1/protocol/fa/TezosFAProtocol.js +11 -21
- package/v1/protocol/fa/TezosFAProtocol.js.map +1 -1
- package/v1/protocol/kt/TezosKtProtocol.js +0 -7
- package/v1/protocol/kt/TezosKtProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosSaplingProtocol.js +2 -6
- package/v1/protocol/sapling/TezosSaplingProtocol.js.map +1 -1
- package/v1/protocol/sapling/TezosShieldedTezProtocol.d.ts +2 -0
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js +5 -3
- package/v1/protocol/sapling/TezosShieldedTezProtocol.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +4 -26
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos-sapling.d.ts +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-tezos.d.ts +1 -5
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos-sapling.json +36 -29
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-tezos.json +15 -8
- package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -1
- package/v1/serializer/v3/validators/transaction-validator.js +20 -2
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/utils/protocol/tezos/TezosAccountant.js +5 -9
- package/v1/utils/protocol/tezos/TezosAccountant.js.map +1 -1
- package/v1/serializer/v3/serializer-companion.d.ts +0 -15
- package/v1/serializer/v3/serializer-companion.js +0 -328
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
|
@@ -95645,12 +95645,6 @@ exports.NonExtendedProtocol = void 0;
|
|
|
95645
95645
|
var NonExtendedProtocol = /** @class */ (function () {
|
|
95646
95646
|
function NonExtendedProtocol() {
|
|
95647
95647
|
}
|
|
95648
|
-
NonExtendedProtocol.prototype.getExtendedPublicKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
95649
|
-
throw Promise.reject('extended public key support not implemented');
|
|
95650
|
-
};
|
|
95651
|
-
NonExtendedProtocol.prototype.getExtendedPublicKeyFromHexSecret = function (secret, derivationPath) {
|
|
95652
|
-
throw Promise.reject('extended public key support not implemented');
|
|
95653
|
-
};
|
|
95654
95648
|
NonExtendedProtocol.prototype.getExtendedPrivateKeyFromMnemonic = function (mnemonic, derivationPath, password) {
|
|
95655
95649
|
throw Promise.reject('extended private key support not implemented');
|
|
95656
95650
|
};
|
|
@@ -110096,7 +110090,7 @@ var TezosSIRSProtocolConfig = /** @class */ (function (_super) {
|
|
|
110096
110090
|
medium: '0.200',
|
|
110097
110091
|
high: '0.300'
|
|
110098
110092
|
}; }
|
|
110099
|
-
if (decimals === void 0) { decimals =
|
|
110093
|
+
if (decimals === void 0) { decimals = 0; }
|
|
110100
110094
|
return _super.call(this, contractAddress, identifier, symbol, name, marketSymbol, feeDefaults, decimals) || this;
|
|
110101
110095
|
}
|
|
110102
110096
|
return TezosSIRSProtocolConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/tezos",
|
|
3
|
-
"version": "0.13.8-beta.
|
|
3
|
+
"version": "0.13.8-beta.8",
|
|
4
4
|
"description": "The @airgap/tezos is a Tezos implementation of the ICoinProtocol interface from @airgap/coinlib-core.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -40,9 +40,9 @@
|
|
|
40
40
|
"@taquito/local-forging": "14.0.0"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
|
-
"@airgap/coinlib-core": "^0.13.8-beta.
|
|
44
|
-
"@airgap/module-kit": "^0.13.8-beta.
|
|
45
|
-
"@airgap/serializer": "^0.13.8-beta.
|
|
43
|
+
"@airgap/coinlib-core": "^0.13.8-beta.7",
|
|
44
|
+
"@airgap/module-kit": "^0.13.8-beta.7",
|
|
45
|
+
"@airgap/serializer": "^0.13.8-beta.7"
|
|
46
46
|
},
|
|
47
47
|
"localDependencies": {
|
|
48
48
|
"@taquito/local-forging": "8.0.1-beta.1"
|
|
@@ -44,7 +44,7 @@ var TezosSIRSProtocolConfig = /** @class */ (function (_super) {
|
|
|
44
44
|
medium: '0.200',
|
|
45
45
|
high: '0.300'
|
|
46
46
|
}; }
|
|
47
|
-
if (decimals === void 0) { decimals =
|
|
47
|
+
if (decimals === void 0) { decimals = 0; }
|
|
48
48
|
return _super.call(this, contractAddress, identifier, symbol, name, marketSymbol, feeDefaults, decimals) || this;
|
|
49
49
|
}
|
|
50
50
|
return TezosSIRSProtocolConfig;
|
package/v1/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { createTezosBlockExplorer } from './block-explorer/factory';
|
|
2
2
|
import { TzKTBlockExplorer } from './block-explorer/TzKTBlockExplorer';
|
|
3
|
+
import { TezosKtModule } from './module/TezosKtModule';
|
|
3
4
|
import { TezosModule } from './module/TezosModule';
|
|
4
5
|
import { createTezosFA1p2Protocol, TezosFA1p2Protocol } from './protocol/fa/TezosFA1p2Protocol';
|
|
5
6
|
import { createTezosFA1Protocol, TezosFA1Protocol } from './protocol/fa/TezosFA1Protocol';
|
|
@@ -46,7 +47,7 @@ import { TezosOperationType } from './types/operations/TezosOperationType';
|
|
|
46
47
|
import { TezosWrappedOperation } from './types/operations/TezosWrappedOperation';
|
|
47
48
|
import { TezosFA1p2ProtocolNetwork, TezosFA1p2ProtocolOptions, TezosFA1ProtocolNetwork, TezosFA1ProtocolOptions, TezosFA2ProtocolNetwork, TezosFA2ProtocolOptions, TezosFAProtocolNetwork, TezosFAProtocolOptions, TezosProtocolNetwork, TezosProtocolOptions, TezosSaplingProtocolNetwork, TezosSaplingProtocolOptions, TezosShieldedTezProtocolOptions, TezosUnits } from './types/protocol';
|
|
48
49
|
import { TezosKtTransactionCursor, TezosSignedTransaction, TezosTransactionCursor, TezosUnsignedTransaction } from './types/transaction';
|
|
49
|
-
export { TezosModule };
|
|
50
|
+
export { TezosModule, TezosKtModule };
|
|
50
51
|
export { TezosProtocol, createTezosProtocol, createTezosProtocolOptions, TezosKtProtocol, createTezosKtProtocol, TezosSaplingProtocol, TezosShieldedTezProtocol, createTezosShieldedTezProtocol, createTezosShieldedTezProtocolOptions, TezosFAProtocol, TezosFA1Protocol, createTezosFA1Protocol, TezosFA1p2Protocol, createTezosFA1p2Protocol, TezosFA2Protocol, createTezosFA2Protocol, BTCTezProtocol, createBTCTezProtocol, createBTCTezProtocolOptions, CTezProtocol, createCTezProtocol, createCTezProtocolOptions, DogamiProtocol, createDogamiProtocol, createDogamiProtocolOptions, ETHTezProtocol, createETHTezProtocol, createETHTezProtocolOptions, KolibriUSDProtocol, createKolibriUSDProtocol, createKolibriUSDProtocolOptions, PlentyProtocol, createPlentyProtocol, createPlentyProtocolOptions, QuipuswapProtocol, createQuipuswapProtocol, createQuipuswapProtocolOptions, SiriusProtocol, createSiriusProtocol, createSiriusProtocolOptions, StakerProtocol, createStakerProtocol, createStakerProtocolOptions, TetherUSDProtocol, createTetherUSDProtocol, createTetherUSDProtocolOptions, TzBTCProtocol, createTzBTCProtocol, createTzBTCProtocolOptions, UBTCProtocol, createUBTCProtocol, createUBTCProtocolOptions, UDEFIProtocol, createUDEFIProtocol, createUDEFIProtocolOptions, USDTezProtocol, createUSDTezProtocol, createUSDTezProtocolOptions, UUSDProtocol, createUUSDProtocol, createUUSDProtocolOptions, WrappedTezosProtocol, createWrappedTezosProtocol, createWrappedTezosProtocolOptions, WrapProtocol, createWrapProtocol, createWrapProtocolOptions, YouProtocol, createYouProtocol, createYouProtocolOptions };
|
|
51
52
|
export { TzKTBlockExplorer, createTezosBlockExplorer };
|
|
52
53
|
export { TezosUnits, TezosProtocolNetwork, TezosSaplingProtocolNetwork, TezosProtocolOptions, TezosSaplingProtocolOptions, TezosShieldedTezProtocolOptions, TezosFAProtocolNetwork, TezosFAProtocolOptions, TezosFA1ProtocolNetwork, TezosFA1ProtocolOptions, TezosFA1p2ProtocolNetwork, TezosFA1p2ProtocolOptions, TezosFA2ProtocolNetwork, TezosFA2ProtocolOptions, TezosNetwork, TezosBlockExplorer, TezosIndexer, TezosUnsignedTransaction, TezosSignedTransaction, TezosTransactionCursor, TezosKtTransactionCursor, TezosOperation, TezosOperationType, TezosWrappedOperation, TezosActivateAccountOperation, TezosBallotOperation, TezosDelegationOperation, TezosDoubleBakingEvidenceOperation, TezosDoubleEndorsementEvidenceOperation, TezosEndorsementOperation, TezosOriginationOperation, TezosProposalOperation, TezosRevealOperation, TezosSeedNonceRevelationOperation, TezosTransactionOperation };
|
package/v1/index.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.TezosOperationType = exports.TezosNetwork = exports.createTezosBlockExplorer = exports.TzKTBlockExplorer = exports.createYouProtocolOptions = exports.createYouProtocol = exports.createWrapProtocolOptions = exports.createWrapProtocol = exports.createWrappedTezosProtocolOptions = exports.createWrappedTezosProtocol = exports.createUUSDProtocolOptions = exports.createUUSDProtocol = exports.createUSDTezProtocolOptions = exports.createUSDTezProtocol = exports.createUDEFIProtocolOptions = exports.createUDEFIProtocol = exports.createUBTCProtocolOptions = exports.createUBTCProtocol = exports.createTzBTCProtocolOptions = exports.createTzBTCProtocol = exports.createTetherUSDProtocolOptions = exports.createTetherUSDProtocol = exports.createStakerProtocolOptions = exports.createStakerProtocol = exports.createSiriusProtocolOptions = exports.createSiriusProtocol = exports.createQuipuswapProtocolOptions = exports.createQuipuswapProtocol = exports.createPlentyProtocolOptions = exports.createPlentyProtocol = exports.createKolibriUSDProtocolOptions = exports.createKolibriUSDProtocol = exports.createETHTezProtocolOptions = exports.createETHTezProtocol = exports.createDogamiProtocolOptions = exports.createDogamiProtocol = exports.createCTezProtocolOptions = exports.createCTezProtocol = exports.createBTCTezProtocolOptions = exports.createBTCTezProtocol = exports.createTezosFA2Protocol = exports.createTezosFA1p2Protocol = exports.createTezosFA1Protocol = exports.createTezosShieldedTezProtocolOptions = exports.createTezosShieldedTezProtocol = exports.createTezosKtProtocol = exports.createTezosProtocolOptions = exports.createTezosProtocol = exports.TezosModule = void 0;
|
|
3
|
+
exports.TezosOperationType = exports.TezosNetwork = exports.createTezosBlockExplorer = exports.TzKTBlockExplorer = exports.createYouProtocolOptions = exports.createYouProtocol = exports.createWrapProtocolOptions = exports.createWrapProtocol = exports.createWrappedTezosProtocolOptions = exports.createWrappedTezosProtocol = exports.createUUSDProtocolOptions = exports.createUUSDProtocol = exports.createUSDTezProtocolOptions = exports.createUSDTezProtocol = exports.createUDEFIProtocolOptions = exports.createUDEFIProtocol = exports.createUBTCProtocolOptions = exports.createUBTCProtocol = exports.createTzBTCProtocolOptions = exports.createTzBTCProtocol = exports.createTetherUSDProtocolOptions = exports.createTetherUSDProtocol = exports.createStakerProtocolOptions = exports.createStakerProtocol = exports.createSiriusProtocolOptions = exports.createSiriusProtocol = exports.createQuipuswapProtocolOptions = exports.createQuipuswapProtocol = exports.createPlentyProtocolOptions = exports.createPlentyProtocol = exports.createKolibriUSDProtocolOptions = exports.createKolibriUSDProtocol = exports.createETHTezProtocolOptions = exports.createETHTezProtocol = exports.createDogamiProtocolOptions = exports.createDogamiProtocol = exports.createCTezProtocolOptions = exports.createCTezProtocol = exports.createBTCTezProtocolOptions = exports.createBTCTezProtocol = exports.createTezosFA2Protocol = exports.createTezosFA1p2Protocol = exports.createTezosFA1Protocol = exports.createTezosShieldedTezProtocolOptions = exports.createTezosShieldedTezProtocol = exports.createTezosKtProtocol = exports.createTezosProtocolOptions = exports.createTezosProtocol = exports.TezosKtModule = exports.TezosModule = void 0;
|
|
4
4
|
var factory_1 = require("./block-explorer/factory");
|
|
5
5
|
Object.defineProperty(exports, "createTezosBlockExplorer", { enumerable: true, get: function () { return factory_1.createTezosBlockExplorer; } });
|
|
6
6
|
var TzKTBlockExplorer_1 = require("./block-explorer/TzKTBlockExplorer");
|
|
7
7
|
Object.defineProperty(exports, "TzKTBlockExplorer", { enumerable: true, get: function () { return TzKTBlockExplorer_1.TzKTBlockExplorer; } });
|
|
8
|
+
var TezosKtModule_1 = require("./module/TezosKtModule");
|
|
9
|
+
Object.defineProperty(exports, "TezosKtModule", { enumerable: true, get: function () { return TezosKtModule_1.TezosKtModule; } });
|
|
8
10
|
var TezosModule_1 = require("./module/TezosModule");
|
|
9
11
|
Object.defineProperty(exports, "TezosModule", { enumerable: true, get: function () { return TezosModule_1.TezosModule; } });
|
|
10
12
|
var TezosFA1p2Protocol_1 = require("./protocol/fa/TezosFA1p2Protocol");
|
package/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,oDAAmE;AA0JvC,yGA1JnB,kCAAwB,OA0JmB;AAzJpD,wEAAsE;AAyJ7D,kGAzJA,qCAAiB,OAyJA;AAxJ1B,wDAAsD;AAyEhC,8FAzEb,6BAAa,OAyEa;AAxEnC,oDAAkD;AAwEzC,4FAxEA,yBAAW,OAwEA;AAvEpB,uEAA+F;AAyF7F,yGAzFO,6CAAwB,OAyFP;AAxF1B,mEAAyF;AAsFvF,uGAtFO,yCAAsB,OAsFP;AArFxB,mEAAyF;AAyFvF,uGAzFO,yCAAsB,OAyFP;AAvFxB,sEAAuH;AAyFrH,qGAzFuB,qCAAoB,OAyFvB;AACpB,4GA1F6C,4CAA2B,OA0F7C;AAzF7B,kEAA+G;AA2F7G,mGA3FO,iCAAkB,OA2FP;AAClB,0GA5F2B,wCAAyB,OA4F3B;AA3F3B,sEAAuH;AA6FrH,qGA7FO,qCAAoB,OA6FP;AACpB,4GA9F6B,4CAA2B,OA8F7B;AA7F7B,sEAAuH;AA+FrH,qGA/FO,qCAAoB,OA+FP;AACpB,4GAhG6B,4CAA2B,OAgG7B;AA/F7B,8EAAuI;AAiGrI,yGAjGO,6CAAwB,OAiGP;AACxB,gHAlGiC,oDAA+B,OAkGjC;AAjGjC,sEAAuH;AAmGrH,qGAnGO,qCAAoB,OAmGP;AACpB,4GApG6B,4CAA2B,OAoG7B;AAnG7B,4EAAmI;AAqGjI,wGArGO,2CAAuB,OAqGP;AACvB,+GAtGgC,kDAA8B,OAsGhC;AArGhC,sEAAuH;AAuGrH,qGAvGO,qCAAoB,OAuGP;AACpB,4GAxG6B,4CAA2B,OAwG7B;AAvG7B,sEAAuH;AAyGrH,qGAzGO,qCAAoB,OAyGP;AACpB,4GA1G6B,4CAA2B,OA0G7B;AAzG7B,4EAAmI;AA2GjI,wGA3GO,2CAAuB,OA2GP;AACvB,+GA5GgC,kDAA8B,OA4GhC;AA3GhC,oEAAmH;AA6GjH,oGA7GO,mCAAmB,OA6GP;AACnB,2GA9G4B,0CAA0B,OA8G5B;AA7G5B,kEAA+G;AA+G7G,mGA/GO,iCAAkB,OA+GP;AAClB,0GAhH2B,wCAAyB,OAgH3B;AA/G3B,oEAAmH;AAiHjH,oGAjHO,mCAAmB,OAiHP;AACnB,2GAlH4B,0CAA0B,OAkH5B;AAjH5B,sEAAuH;AAmHrH,qGAnHO,qCAAoB,OAmHP;AACpB,4GApH6B,4CAA2B,OAoH7B;AAnH7B,kEAA+G;AAqH7G,mGArHO,iCAAkB,OAqHP;AAClB,0GAtH2B,wCAAyB,OAsH3B;AArH3B,kFAIkD;AAmHhD,2GAtHA,iDAA0B,OAsHA;AAC1B,kHAtHA,wDAAiC,OAsHA;AAnHnC,kEAA+G;AAqH7G,mGArHO,iCAAkB,OAqHP;AAClB,0GAtH2B,wCAAyB,OAsH3B;AArH3B,gEAA2G;AAuHzG,kGAvHO,+BAAiB,OAuHP;AACjB,yGAxH0B,sCAAwB,OAwH1B;AAvH1B,iEAAsF;AAsDpF,sGAtDO,uCAAqB,OAsDP;AApDvB,wFAIoD;AAmDlD,+GAtDA,yDAA8B,OAsDA;AAC9B,sHAtDA,gEAAqC,OAsDA;AAnDvC,0DAAyG;AA4CvG,oGA5CO,mCAAmB,OA4CP;AACnB,2GA7C4B,0CAA0B,OA6C5B;AA1C5B,2CAA8C;AAqI5C,6FArIO,sBAAY,OAqIP;AAxHd,4EAA0E;AAgIxE,mGAhIO,uCAAkB,OAgIP"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolNetwork } from '@airgap/module-kit';
|
|
2
|
+
export declare class TezosKtModule implements AirGapModule {
|
|
3
|
+
private readonly networkRegistry;
|
|
4
|
+
readonly supportedNetworks: Record<string, ProtocolNetwork>;
|
|
5
|
+
createOfflineProtocol(): Promise<AirGapOfflineProtocol | undefined>;
|
|
6
|
+
createOnlineProtocol(networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
7
|
+
createBlockExplorer(networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TezosKtModule = void 0;
|
|
40
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
42
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
+
var factory_1 = require("../block-explorer/factory");
|
|
44
|
+
var TezosKtProtocol_1 = require("../protocol/kt/TezosKtProtocol");
|
|
45
|
+
var TezosProtocol_1 = require("../protocol/TezosProtocol");
|
|
46
|
+
var TezosKtModule = /** @class */ (function () {
|
|
47
|
+
function TezosKtModule() {
|
|
48
|
+
this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
49
|
+
supportedNetworks: [TezosProtocol_1.TEZOS_MAINNET_PROTOCOL_NETWORK]
|
|
50
|
+
});
|
|
51
|
+
this.supportedNetworks = this.networkRegistry.supportedNetworks;
|
|
52
|
+
}
|
|
53
|
+
TezosKtModule.prototype.createOfflineProtocol = function () {
|
|
54
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
55
|
+
return __generator(this, function (_a) {
|
|
56
|
+
return [2 /*return*/, (0, TezosKtProtocol_1.createTezosKtProtocol)()];
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
TezosKtModule.prototype.createOnlineProtocol = function (networkId) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
var network;
|
|
63
|
+
return __generator(this, function (_a) {
|
|
64
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
65
|
+
if (network === undefined) {
|
|
66
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Protocol network type not supported.');
|
|
67
|
+
}
|
|
68
|
+
return [2 /*return*/, (0, TezosKtProtocol_1.createTezosKtProtocol)({ network: network })];
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
};
|
|
72
|
+
TezosKtModule.prototype.createBlockExplorer = function (networkId) {
|
|
73
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
74
|
+
var network;
|
|
75
|
+
return __generator(this, function (_a) {
|
|
76
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
77
|
+
if (network === undefined) {
|
|
78
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Block Explorer network type not supported.');
|
|
79
|
+
}
|
|
80
|
+
return [2 /*return*/, (0, factory_1.createTezosBlockExplorer)(network.blockExplorer)];
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
return TezosKtModule;
|
|
85
|
+
}());
|
|
86
|
+
exports.TezosKtModule = TezosKtModule;
|
|
87
|
+
//# sourceMappingURL=TezosKtModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TezosKtModule.js","sourceRoot":"","sources":["../../../src/v1/module/TezosKtModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAAqE;AACrE,iDAO2B;AAE3B,qDAAoE;AACpE,kEAAsE;AACtE,2DAA0E;AAG1E;IAAA;QACmB,oBAAe,GAAgD,IAAI,kCAAqB,CAAC;YACxG,iBAAiB,EAAE,CAAC,8CAA8B,CAAC;SACpD,CAAC,CAAA;QAEc,sBAAiB,GAAoC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAA;IAuB7G,CAAC;IArBc,6CAAqB,GAAlC;;;gBACE,sBAAO,IAAA,uCAAqB,GAAE,EAAA;;;KAC/B;IAEY,4CAAoB,GAAjC,UAAkC,SAAkB;;;;gBAC5C,OAAO,GAAqC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBAC7F,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAA;iBACxF;gBAED,sBAAO,IAAA,uCAAqB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;;KAC1C;IAEY,2CAAmB,GAAhC,UAAiC,SAAkB;;;;gBAC3C,OAAO,GAAqC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBAC7F,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAA;iBAC9F;gBAED,sBAAO,IAAA,kCAAwB,EAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;;KACvD;IACH,oBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,sCAAa"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol,
|
|
1
|
+
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolNetwork } from '@airgap/module-kit';
|
|
2
2
|
export declare class TezosModule implements AirGapModule {
|
|
3
|
-
private readonly
|
|
4
|
-
readonly
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
createBlockExplorer(identifier: string, networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
9
|
-
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
10
|
-
private createProtocol;
|
|
3
|
+
private readonly networkRegistry;
|
|
4
|
+
readonly supportedNetworks: Record<string, ProtocolNetwork>;
|
|
5
|
+
createOfflineProtocol(): Promise<AirGapOfflineProtocol | undefined>;
|
|
6
|
+
createOnlineProtocol(networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
7
|
+
createBlockExplorer(networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
11
8
|
}
|
package/v1/module/TezosModule.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
4
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -52,86 +41,38 @@ var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
|
52
41
|
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
53
42
|
var module_kit_1 = require("@airgap/module-kit");
|
|
54
43
|
var factory_1 = require("../block-explorer/factory");
|
|
55
|
-
var BTCTezProtocol_1 = require("../protocol/fa/tokens/BTCTezProtocol");
|
|
56
|
-
var CTezProtocol_1 = require("../protocol/fa/tokens/CTezProtocol");
|
|
57
|
-
var DogamiProtocol_1 = require("../protocol/fa/tokens/DogamiProtocol");
|
|
58
|
-
var ETHTezProtocol_1 = require("../protocol/fa/tokens/ETHTezProtocol");
|
|
59
|
-
var KolibriUSDProtocol_1 = require("../protocol/fa/tokens/KolibriUSDProtocol");
|
|
60
|
-
var PlentyProtocol_1 = require("../protocol/fa/tokens/PlentyProtocol");
|
|
61
|
-
var QuipuswapProtocol_1 = require("../protocol/fa/tokens/QuipuswapProtocol");
|
|
62
|
-
var SiriusProtocol_1 = require("../protocol/fa/tokens/SiriusProtocol");
|
|
63
|
-
var StakerProtocol_1 = require("../protocol/fa/tokens/StakerProtocol");
|
|
64
|
-
var TzBTCProtocol_1 = require("../protocol/fa/tokens/TzBTCProtocol");
|
|
65
|
-
var UBTCProtocol_1 = require("../protocol/fa/tokens/UBTCProtocol");
|
|
66
|
-
var UDEFIProtocol_1 = require("../protocol/fa/tokens/UDEFIProtocol");
|
|
67
|
-
var USDTezProtocol_1 = require("../protocol/fa/tokens/USDTezProtocol");
|
|
68
|
-
var UUSDProtocol_1 = require("../protocol/fa/tokens/UUSDProtocol");
|
|
69
|
-
var WrappedTezosProtocol_1 = require("../protocol/fa/tokens/WrappedTezosProtocol");
|
|
70
|
-
var WrapProtocol_1 = require("../protocol/fa/tokens/WrapProtocol");
|
|
71
|
-
var YouProtocol_1 = require("../protocol/fa/tokens/YouProtocol");
|
|
72
|
-
var TezosKtProtocol_1 = require("../protocol/kt/TezosKtProtocol");
|
|
73
|
-
var TezosShieldedTezProtocol_1 = require("../protocol/sapling/TezosShieldedTezProtocol");
|
|
74
44
|
var TezosProtocol_1 = require("../protocol/TezosProtocol");
|
|
75
|
-
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
76
45
|
var TezosModule = /** @class */ (function () {
|
|
77
46
|
function TezosModule() {
|
|
78
|
-
|
|
79
|
-
var supportedFAProtocols = [
|
|
80
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_BTC,
|
|
81
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_USD,
|
|
82
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_KUSD,
|
|
83
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_STKR,
|
|
84
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_ETHTZ,
|
|
85
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_UUSD,
|
|
86
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_YOU,
|
|
87
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_W,
|
|
88
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_UDEFI,
|
|
89
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_UBTC,
|
|
90
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_CTEZ,
|
|
91
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_PLENTY,
|
|
92
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_WRAP,
|
|
93
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_QUIPU,
|
|
94
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_DOGA,
|
|
95
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_BTC_TEZ,
|
|
96
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_USDT,
|
|
97
|
-
coinlib_core_1.SubProtocolSymbols.XTZ_SIRS
|
|
98
|
-
];
|
|
99
|
-
var tezosNetworkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
47
|
+
this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
100
48
|
supportedNetworks: [TezosProtocol_1.TEZOS_MAINNET_PROTOCOL_NETWORK, TezosProtocol_1.TEZOS_GHOSTNET_PROTOCOL_NETWORK]
|
|
101
49
|
});
|
|
102
|
-
this.
|
|
103
|
-
supportedNetworks: [TezosProtocol_1.TEZOS_MAINNET_PROTOCOL_NETWORK]
|
|
104
|
-
}), _a), supportedFAProtocols.reduce(function (obj, next) {
|
|
105
|
-
var _a;
|
|
106
|
-
return Object.assign(obj, (_a = {}, _a[next] = tezosNetworkRegistry, _a));
|
|
107
|
-
}, {}));
|
|
108
|
-
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
50
|
+
this.supportedNetworks = this.networkRegistry.supportedNetworks;
|
|
109
51
|
}
|
|
110
|
-
TezosModule.prototype.createOfflineProtocol = function (
|
|
52
|
+
TezosModule.prototype.createOfflineProtocol = function () {
|
|
111
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
112
54
|
return __generator(this, function (_a) {
|
|
113
|
-
return [2 /*return*/,
|
|
55
|
+
return [2 /*return*/, (0, TezosProtocol_1.createTezosProtocol)()];
|
|
114
56
|
});
|
|
115
57
|
});
|
|
116
58
|
};
|
|
117
|
-
TezosModule.prototype.createOnlineProtocol = function (
|
|
118
|
-
var _a;
|
|
59
|
+
TezosModule.prototype.createOnlineProtocol = function (networkId) {
|
|
119
60
|
return __awaiter(this, void 0, void 0, function () {
|
|
120
61
|
var network;
|
|
121
|
-
return __generator(this, function (
|
|
122
|
-
network =
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
123
64
|
if (network === undefined) {
|
|
124
65
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Protocol network type not supported.');
|
|
125
66
|
}
|
|
126
|
-
return [2 /*return*/,
|
|
67
|
+
return [2 /*return*/, (0, TezosProtocol_1.createTezosProtocol)({ network: network })];
|
|
127
68
|
});
|
|
128
69
|
});
|
|
129
70
|
};
|
|
130
|
-
TezosModule.prototype.createBlockExplorer = function (
|
|
71
|
+
TezosModule.prototype.createBlockExplorer = function (networkId) {
|
|
131
72
|
return __awaiter(this, void 0, void 0, function () {
|
|
132
73
|
var network;
|
|
133
74
|
return __generator(this, function (_a) {
|
|
134
|
-
network = this.
|
|
75
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
135
76
|
if (network === undefined) {
|
|
136
77
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Block Explorer network type not supported.');
|
|
137
78
|
}
|
|
@@ -139,63 +80,6 @@ var TezosModule = /** @class */ (function () {
|
|
|
139
80
|
});
|
|
140
81
|
});
|
|
141
82
|
};
|
|
142
|
-
TezosModule.prototype.createV3SerializerCompanion = function () {
|
|
143
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
144
|
-
return __generator(this, function (_a) {
|
|
145
|
-
return [2 /*return*/, new serializer_companion_1.TezosV3SerializerCompanion()];
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
// tslint:disable-next-line: cyclomatic-complexity
|
|
150
|
-
TezosModule.prototype.createProtocol = function (identifier, network) {
|
|
151
|
-
// TODO: should we allow to create generic FA tokens here?
|
|
152
|
-
switch (identifier) {
|
|
153
|
-
case coinlib_core_1.MainProtocolSymbols.XTZ:
|
|
154
|
-
return (0, TezosProtocol_1.createTezosProtocol)({ network: network });
|
|
155
|
-
case coinlib_core_1.MainProtocolSymbols.XTZ_SHIELDED:
|
|
156
|
-
return (0, TezosShieldedTezProtocol_1.createTezosShieldedTezProtocol)({ network: network });
|
|
157
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_KT:
|
|
158
|
-
return (0, TezosKtProtocol_1.createTezosKtProtocol)({ network: network });
|
|
159
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_BTC:
|
|
160
|
-
return (0, TzBTCProtocol_1.createTzBTCProtocol)({ network: network });
|
|
161
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_USD:
|
|
162
|
-
return (0, USDTezProtocol_1.createUSDTezProtocol)({ network: network });
|
|
163
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_KUSD:
|
|
164
|
-
return (0, KolibriUSDProtocol_1.createKolibriUSDProtocol)({ network: network });
|
|
165
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_STKR:
|
|
166
|
-
return (0, StakerProtocol_1.createStakerProtocol)({ network: network });
|
|
167
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_ETHTZ:
|
|
168
|
-
return (0, ETHTezProtocol_1.createETHTezProtocol)({ network: network });
|
|
169
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_UUSD:
|
|
170
|
-
return (0, UUSDProtocol_1.createUUSDProtocol)({ network: network });
|
|
171
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_YOU:
|
|
172
|
-
return (0, YouProtocol_1.createYouProtocol)({ network: network });
|
|
173
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_W:
|
|
174
|
-
return (0, WrappedTezosProtocol_1.createWrappedTezosProtocol)({ network: network });
|
|
175
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_UDEFI:
|
|
176
|
-
return (0, UDEFIProtocol_1.createUDEFIProtocol)({ network: network });
|
|
177
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_UBTC:
|
|
178
|
-
return (0, UBTCProtocol_1.createUBTCProtocol)({ network: network });
|
|
179
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_CTEZ:
|
|
180
|
-
return (0, CTezProtocol_1.createCTezProtocol)({ network: network });
|
|
181
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_PLENTY:
|
|
182
|
-
return (0, PlentyProtocol_1.createPlentyProtocol)({ network: network });
|
|
183
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_WRAP:
|
|
184
|
-
return (0, WrapProtocol_1.createWrapProtocol)({ network: network });
|
|
185
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_QUIPU:
|
|
186
|
-
return (0, QuipuswapProtocol_1.createQuipuswapProtocol)({ network: network });
|
|
187
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_DOGA:
|
|
188
|
-
return (0, DogamiProtocol_1.createDogamiProtocol)({ network: network });
|
|
189
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_BTC_TEZ:
|
|
190
|
-
return (0, BTCTezProtocol_1.createBTCTezProtocol)({ network: network });
|
|
191
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_USDT:
|
|
192
|
-
return (0, USDTezProtocol_1.createUSDTezProtocol)({ network: network });
|
|
193
|
-
case coinlib_core_1.SubProtocolSymbols.XTZ_SIRS:
|
|
194
|
-
return (0, SiriusProtocol_1.createSiriusProtocol)({ network: network });
|
|
195
|
-
default:
|
|
196
|
-
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, "Protocol ".concat(identifier, " not supported."));
|
|
197
|
-
}
|
|
198
|
-
};
|
|
199
83
|
return TezosModule;
|
|
200
84
|
}());
|
|
201
85
|
exports.TezosModule = TezosModule;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TezosModule.js","sourceRoot":"","sources":["../../../src/v1/module/TezosModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TezosModule.js","sourceRoot":"","sources":["../../../src/v1/module/TezosModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAAqE;AACrE,iDAO2B;AAE3B,qDAAoE;AACpE,2DAAgI;AAGhI;IAAA;QACmB,oBAAe,GAAgD,IAAI,kCAAqB,CAAC;YACxG,iBAAiB,EAAE,CAAC,8CAA8B,EAAE,+CAA+B,CAAC;SACrF,CAAC,CAAA;QAEc,sBAAiB,GAAoC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAA;IAuB7G,CAAC;IArBc,2CAAqB,GAAlC;;;gBACE,sBAAO,IAAA,mCAAmB,GAAE,EAAA;;;KAC7B;IAEY,0CAAoB,GAAjC,UAAkC,SAAkB;;;;gBAC5C,OAAO,GAAqC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBAC7F,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAA;iBACxF;gBAED,sBAAO,IAAA,mCAAmB,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;;KACxC;IAEY,yCAAmB,GAAhC,UAAiC,SAAkB;;;;gBAC3C,OAAO,GAAqC,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBAC7F,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAA;iBAC9F;gBAED,sBAAO,IAAA,kCAAwB,EAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;;KACvD;IACH,kBAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,kCAAW"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, ProtocolNetwork } from '@airgap/module-kit';
|
|
2
|
+
export declare class TezosShieldedModule implements AirGapModule {
|
|
3
|
+
private readonly networkRegistry;
|
|
4
|
+
readonly supportedNetworks: Record<string, ProtocolNetwork>;
|
|
5
|
+
createOfflineProtocol(): Promise<AirGapOfflineProtocol | undefined>;
|
|
6
|
+
createOnlineProtocol(networkId?: string): Promise<AirGapOnlineProtocol | undefined>;
|
|
7
|
+
createBlockExplorer(networkId?: string): Promise<AirGapBlockExplorer | undefined>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.TezosShieldedModule = void 0;
|
|
40
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
41
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
42
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
+
var factory_1 = require("../block-explorer/factory");
|
|
44
|
+
var TezosShieldedTezProtocol_1 = require("../protocol/sapling/TezosShieldedTezProtocol");
|
|
45
|
+
var TezosShieldedModule = /** @class */ (function () {
|
|
46
|
+
function TezosShieldedModule() {
|
|
47
|
+
this.networkRegistry = new module_kit_1.ModuleNetworkRegistry({
|
|
48
|
+
supportedNetworks: [TezosShieldedTezProtocol_1.SHIELDED_TEZ_MAINNET_PROTOCOL_NETWORK, TezosShieldedTezProtocol_1.SHIELDED_TEZ_GHOSTNET_PROTOCOL_NETWORK]
|
|
49
|
+
});
|
|
50
|
+
this.supportedNetworks = this.networkRegistry.supportedNetworks;
|
|
51
|
+
}
|
|
52
|
+
TezosShieldedModule.prototype.createOfflineProtocol = function () {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
54
|
+
return __generator(this, function (_a) {
|
|
55
|
+
return [2 /*return*/, (0, TezosShieldedTezProtocol_1.createTezosShieldedTezProtocol)()];
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
TezosShieldedModule.prototype.createOnlineProtocol = function (networkId) {
|
|
60
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
61
|
+
var network;
|
|
62
|
+
return __generator(this, function (_a) {
|
|
63
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
64
|
+
if (network === undefined) {
|
|
65
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Protocol network type not supported.');
|
|
66
|
+
}
|
|
67
|
+
return [2 /*return*/, (0, TezosShieldedTezProtocol_1.createTezosShieldedTezProtocol)({ network: network })];
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
TezosShieldedModule.prototype.createBlockExplorer = function (networkId) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
var network;
|
|
74
|
+
return __generator(this, function (_a) {
|
|
75
|
+
network = this.networkRegistry.findNetwork(networkId);
|
|
76
|
+
if (network === undefined) {
|
|
77
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.TEZOS, 'Block Explorer network type not supported.');
|
|
78
|
+
}
|
|
79
|
+
return [2 /*return*/, (0, factory_1.createTezosBlockExplorer)(network.blockExplorer)];
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
return TezosShieldedModule;
|
|
84
|
+
}());
|
|
85
|
+
exports.TezosShieldedModule = TezosShieldedModule;
|
|
86
|
+
//# sourceMappingURL=TezosShieldedTezModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TezosShieldedTezModule.js","sourceRoot":"","sources":["../../../src/v1/module/TezosShieldedTezModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA6C;AAC7C,sDAAqE;AACrE,iDAO2B;AAE3B,qDAAoE;AACpE,yFAIqD;AAGrD;IAAA;QACmB,oBAAe,GAAuD,IAAI,kCAAqB,CAAC;YAC/G,iBAAiB,EAAE,CAAC,gEAAqC,EAAE,iEAAsC,CAAC;SACnG,CAAC,CAAA;QAEc,sBAAiB,GAAoC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAA;IAuB7G,CAAC;IArBc,mDAAqB,GAAlC;;;gBACE,sBAAO,IAAA,yDAA8B,GAAE,EAAA;;;KACxC;IAEY,kDAAoB,GAAjC,UAAkC,SAAkB;;;;gBAC5C,OAAO,GAA4C,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACpG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,sCAAsC,CAAC,CAAA;iBACxF;gBAED,sBAAO,IAAA,yDAA8B,EAAC,EAAE,OAAO,SAAA,EAAE,CAAC,EAAA;;;KACnD;IAEY,iDAAmB,GAAhC,UAAiC,SAAkB;;;;gBAC3C,OAAO,GAA4C,IAAI,CAAC,eAAe,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;gBACpG,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,KAAK,EAAE,4CAA4C,CAAC,CAAA;iBAC9F;gBAED,sBAAO,IAAA,kCAAwB,EAAC,OAAO,CAAC,aAAa,CAAC,EAAA;;;KACvD;IACH,0BAAC;AAAD,CAAC,AA5BD,IA4BC;AA5BY,kDAAmB"}
|
|
@@ -36,13 +36,12 @@ export declare abstract class TezosFAProtocolImpl<_Entrypoints extends string, _
|
|
|
36
36
|
protected readonly contract: TezosContract<_Entrypoints>;
|
|
37
37
|
protected readonly remoteDataFactory: RemoteDataFactory;
|
|
38
38
|
protected constructor(options: TezosFAProtocolOptions<_Units, _ProtocolNetwork>, accountant: TezosFAAccountant<_Units>);
|
|
39
|
-
getType(): Promise<'token'>;
|
|
40
|
-
mainProtocol(): Promise<string>;
|
|
41
|
-
getContractAddress(): Promise<string>;
|
|
42
39
|
protected readonly metadata: ProtocolMetadata<_Units, TezosUnits>;
|
|
43
40
|
getMetadata(): Promise<ProtocolMetadata<_Units, TezosUnits>>;
|
|
44
41
|
getAddressFromPublicKey(publicKey: PublicKey): Promise<string>;
|
|
45
42
|
getDetailsFromTransaction(transaction: TezosUnsignedTransaction | TezosSignedTransaction, publicKey: PublicKey): Promise<AirGapTransaction<_Units, TezosUnits>[]>;
|
|
43
|
+
getType(): Promise<'token'>;
|
|
44
|
+
getContractAddress(): Promise<string>;
|
|
46
45
|
verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey): Promise<boolean>;
|
|
47
46
|
encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey): Promise<string>;
|
|
48
47
|
getKeyPairFromSecret(secret: Secret, derivationPath?: string): Promise<KeyPair>;
|
|
@@ -81,53 +81,43 @@ var TezosFAProtocolImpl = /** @class */ (function () {
|
|
|
81
81
|
units: options.units,
|
|
82
82
|
mainUnit: options.mainUnit,
|
|
83
83
|
fee: {
|
|
84
|
-
defaults: options.feeDefaults
|
|
85
|
-
units: TezosProtocol_1.TEZOS_UNITS,
|
|
86
|
-
mainUnit: 'tez'
|
|
84
|
+
defaults: options.feeDefaults
|
|
87
85
|
},
|
|
88
86
|
account: TezosProtocol_1.TEZOS_ACCOUNT_METADATA
|
|
89
87
|
};
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
TezosFAProtocolImpl.prototype.getType = function () {
|
|
93
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
94
|
-
return __generator(this, function (_a) {
|
|
95
|
-
return [2 /*return*/, 'token'];
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
};
|
|
99
|
-
TezosFAProtocolImpl.prototype.mainProtocol = function () {
|
|
89
|
+
TezosFAProtocolImpl.prototype.getMetadata = function () {
|
|
100
90
|
return __awaiter(this, void 0, void 0, function () {
|
|
101
91
|
return __generator(this, function (_a) {
|
|
102
|
-
return [2 /*return*/,
|
|
92
|
+
return [2 /*return*/, this.metadata];
|
|
103
93
|
});
|
|
104
94
|
});
|
|
105
95
|
};
|
|
106
|
-
TezosFAProtocolImpl.prototype.
|
|
96
|
+
TezosFAProtocolImpl.prototype.getAddressFromPublicKey = function (publicKey) {
|
|
107
97
|
return __awaiter(this, void 0, void 0, function () {
|
|
108
98
|
return __generator(this, function (_a) {
|
|
109
|
-
return [2 /*return*/, this.
|
|
99
|
+
return [2 /*return*/, this.tezos.getAddressFromPublicKey(publicKey)];
|
|
110
100
|
});
|
|
111
101
|
});
|
|
112
102
|
};
|
|
113
|
-
TezosFAProtocolImpl.prototype.
|
|
103
|
+
TezosFAProtocolImpl.prototype.getDetailsFromTransaction = function (transaction, publicKey) {
|
|
114
104
|
return __awaiter(this, void 0, void 0, function () {
|
|
115
105
|
return __generator(this, function (_a) {
|
|
116
|
-
return [2 /*return*/, this.
|
|
106
|
+
return [2 /*return*/, this.accountant.getDetailsFromTransaction(transaction)];
|
|
117
107
|
});
|
|
118
108
|
});
|
|
119
109
|
};
|
|
120
|
-
TezosFAProtocolImpl.prototype.
|
|
110
|
+
TezosFAProtocolImpl.prototype.getType = function () {
|
|
121
111
|
return __awaiter(this, void 0, void 0, function () {
|
|
122
112
|
return __generator(this, function (_a) {
|
|
123
|
-
return [2 /*return*/,
|
|
113
|
+
return [2 /*return*/, 'token'];
|
|
124
114
|
});
|
|
125
115
|
});
|
|
126
116
|
};
|
|
127
|
-
TezosFAProtocolImpl.prototype.
|
|
117
|
+
TezosFAProtocolImpl.prototype.getContractAddress = function () {
|
|
128
118
|
return __awaiter(this, void 0, void 0, function () {
|
|
129
119
|
return __generator(this, function (_a) {
|
|
130
|
-
return [2 /*return*/, this.
|
|
120
|
+
return [2 /*return*/, this.options.network.contractAddress];
|
|
131
121
|
});
|
|
132
122
|
});
|
|
133
123
|
};
|