@airgap/optimism 0.13.45-beta.3 → 0.13.45-beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,52 @@
1
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
+ };
2
38
  Object.defineProperty(exports, "__esModule", { value: true });
3
39
  exports.OptimismV3SerializerCompanion = void 0;
4
- const coinlib_core_1 = require("@airgap/coinlib-core");
5
- const errors_1 = require("@airgap/coinlib-core/errors");
6
- const serializer_1 = require("@airgap/serializer");
7
- const transaction_converter_1 = require("./schemas/converter/transaction-converter");
8
- const transaction_validator_1 = require("./validators/transaction-validator");
9
- const ethereumTransactionSignRequest = require('./schemas/generated/transaction-sign-request-optimism.json');
10
- const ethereumTypedTransactionSignRequest = require('./schemas/generated/transaction-sign-request-optimism-typed.json');
11
- const ethereumTransactionSignResponse = require('./schemas/generated/transaction-sign-response-optimism.json');
12
- class OptimismV3SerializerCompanion {
13
- constructor() {
40
+ var coinlib_core_1 = require("@airgap/coinlib-core");
41
+ var errors_1 = require("@airgap/coinlib-core/errors");
42
+ var serializer_1 = require("@airgap/serializer");
43
+ var transaction_converter_1 = require("./schemas/converter/transaction-converter");
44
+ var transaction_validator_1 = require("./validators/transaction-validator");
45
+ var ethereumTransactionSignRequest = require('./schemas/generated/transaction-sign-request-optimism.json');
46
+ var ethereumTypedTransactionSignRequest = require('./schemas/generated/transaction-sign-request-optimism-typed.json');
47
+ var ethereumTransactionSignResponse = require('./schemas/generated/transaction-sign-response-optimism.json');
48
+ var OptimismV3SerializerCompanion = /** @class */ (function () {
49
+ function OptimismV3SerializerCompanion() {
14
50
  this.schemas = [
15
51
  {
16
52
  type: serializer_1.IACMessageType.TransactionSignRequest,
@@ -40,72 +76,115 @@ class OptimismV3SerializerCompanion {
40
76
  ];
41
77
  this.ethereumTransactionValidator = new transaction_validator_1.OptimismTransactionValidator();
42
78
  }
43
- async toTransactionSignRequest(identifier, unsignedTransaction, publicKey, callbackUrl) {
44
- switch (identifier) {
45
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
46
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
47
- return (0, transaction_converter_1.optimismUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl);
48
- default:
49
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
50
- }
51
- }
52
- async fromTransactionSignRequest(identifier, transactionSignRequest) {
53
- switch (identifier) {
54
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
55
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
56
- return (0, transaction_converter_1.optimismTransactionSignRequestToUnsigned)(transactionSignRequest);
57
- default:
58
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
59
- }
60
- }
61
- async validateTransactionSignRequest(identifier, transactionSignRequest) {
62
- switch (identifier) {
63
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
64
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
65
- try {
66
- await this.ethereumTransactionValidator.validateUnsignedTransaction(transactionSignRequest);
67
- return true;
79
+ OptimismV3SerializerCompanion.prototype.toTransactionSignRequest = function (identifier, unsignedTransaction, publicKey, callbackUrl) {
80
+ return __awaiter(this, void 0, void 0, function () {
81
+ return __generator(this, function (_a) {
82
+ switch (identifier) {
83
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
84
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
85
+ return [2 /*return*/, (0, transaction_converter_1.optimismUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
86
+ default:
87
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
68
88
  }
69
- catch {
70
- return false;
89
+ return [2 /*return*/];
90
+ });
91
+ });
92
+ };
93
+ OptimismV3SerializerCompanion.prototype.fromTransactionSignRequest = function (identifier, transactionSignRequest) {
94
+ return __awaiter(this, void 0, void 0, function () {
95
+ return __generator(this, function (_a) {
96
+ switch (identifier) {
97
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
98
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
99
+ return [2 /*return*/, (0, transaction_converter_1.optimismTransactionSignRequestToUnsigned)(transactionSignRequest)];
100
+ default:
101
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
71
102
  }
72
- default:
73
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
74
- }
75
- }
76
- async toTransactionSignResponse(identifier, signedTransaction, accountIdentifier) {
77
- switch (identifier) {
78
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
79
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
80
- return (0, transaction_converter_1.optimismSignedTransactionToResponse)(signedTransaction, accountIdentifier);
81
- default:
82
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
83
- }
84
- }
85
- async fromTransactionSignResponse(identifier, transactionSignResponse) {
86
- switch (identifier) {
87
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
88
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
89
- return (0, transaction_converter_1.optimismTransactionSignResponseToSigned)(transactionSignResponse);
90
- default:
91
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
92
- }
93
- }
94
- async validateTransactionSignResponse(identifier, transactionSignResponse) {
95
- switch (identifier) {
96
- case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
97
- case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
98
- try {
99
- await this.ethereumTransactionValidator.validateSignedTransaction(transactionSignResponse);
100
- return true;
103
+ return [2 /*return*/];
104
+ });
105
+ });
106
+ };
107
+ OptimismV3SerializerCompanion.prototype.validateTransactionSignRequest = function (identifier, transactionSignRequest) {
108
+ return __awaiter(this, void 0, void 0, function () {
109
+ var _a, _b;
110
+ return __generator(this, function (_c) {
111
+ switch (_c.label) {
112
+ case 0:
113
+ _a = identifier;
114
+ switch (_a) {
115
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM: return [3 /*break*/, 1];
116
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20: return [3 /*break*/, 1];
117
+ }
118
+ return [3 /*break*/, 4];
119
+ case 1:
120
+ _c.trys.push([1, 3, , 4]);
121
+ return [4 /*yield*/, this.ethereumTransactionValidator.validateUnsignedTransaction(transactionSignRequest)];
122
+ case 2:
123
+ _c.sent();
124
+ return [2 /*return*/, true];
125
+ case 3:
126
+ _b = _c.sent();
127
+ return [2 /*return*/, false];
128
+ case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
101
129
  }
102
- catch {
103
- return false;
130
+ });
131
+ });
132
+ };
133
+ OptimismV3SerializerCompanion.prototype.toTransactionSignResponse = function (identifier, signedTransaction, accountIdentifier) {
134
+ return __awaiter(this, void 0, void 0, function () {
135
+ return __generator(this, function (_a) {
136
+ switch (identifier) {
137
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
138
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
139
+ return [2 /*return*/, (0, transaction_converter_1.optimismSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
140
+ default:
141
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
104
142
  }
105
- default:
106
- throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, `Protocol ${identifier} not supported`);
107
- }
108
- }
109
- }
143
+ return [2 /*return*/];
144
+ });
145
+ });
146
+ };
147
+ OptimismV3SerializerCompanion.prototype.fromTransactionSignResponse = function (identifier, transactionSignResponse) {
148
+ return __awaiter(this, void 0, void 0, function () {
149
+ return __generator(this, function (_a) {
150
+ switch (identifier) {
151
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM:
152
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20:
153
+ return [2 /*return*/, (0, transaction_converter_1.optimismTransactionSignResponseToSigned)(transactionSignResponse)];
154
+ default:
155
+ throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
156
+ }
157
+ return [2 /*return*/];
158
+ });
159
+ });
160
+ };
161
+ OptimismV3SerializerCompanion.prototype.validateTransactionSignResponse = function (identifier, transactionSignResponse) {
162
+ return __awaiter(this, void 0, void 0, function () {
163
+ var _a, _b;
164
+ return __generator(this, function (_c) {
165
+ switch (_c.label) {
166
+ case 0:
167
+ _a = identifier;
168
+ switch (_a) {
169
+ case coinlib_core_1.MainProtocolSymbols.OPTIMISM: return [3 /*break*/, 1];
170
+ case coinlib_core_1.SubProtocolSymbols.OPTIMISM_ERC20: return [3 /*break*/, 1];
171
+ }
172
+ return [3 /*break*/, 4];
173
+ case 1:
174
+ _c.trys.push([1, 3, , 4]);
175
+ return [4 /*yield*/, this.ethereumTransactionValidator.validateSignedTransaction(transactionSignResponse)];
176
+ case 2:
177
+ _c.sent();
178
+ return [2 /*return*/, true];
179
+ case 3:
180
+ _b = _c.sent();
181
+ return [2 /*return*/, false];
182
+ case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.OPTIMISM, "Protocol ".concat(identifier, " not supported"));
183
+ }
184
+ });
185
+ });
186
+ };
187
+ return OptimismV3SerializerCompanion;
188
+ }());
110
189
  exports.OptimismV3SerializerCompanion = OptimismV3SerializerCompanion;
111
190
  //# sourceMappingURL=serializer-companion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":";;;AAAA,uDAAsF;AACtF,wDAA8D;AAG9D,mDAAgH;AAIhH,qFAKkD;AAClD,8EAAiF;AAEjF,MAAM,8BAA8B,GAAe,OAAO,CAAC,4DAA4D,CAAC,CAAA;AACxH,MAAM,mCAAmC,GAAe,OAAO,CAAC,kEAAkE,CAAC,CAAA;AACnI,MAAM,+BAA+B,GAAe,OAAO,CAAC,6DAA6D,CAAC,CAAA;AAE1H,MAAa,6BAA6B;IAA1C;QACkB,YAAO,GAA4B;YACjD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,8BAA8B,EAAE;gBAClD,kBAAkB,EAAE,kCAAmB,CAAC,QAAQ;aACjD;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,mCAAmC,EAAE;gBACvD,kBAAkB,EAAE,kCAAmB,CAAC,QAAQ;aACjD;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,uBAAuB;gBAC5C,MAAM,EAAE,EAAE,MAAM,EAAE,+BAA+B,EAAE;gBACnD,kBAAkB,EAAE,kCAAmB,CAAC,QAAQ;aACjD;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,sBAAsB;gBAC3C,MAAM,EAAE,EAAE,MAAM,EAAE,8BAA8B,EAAE;gBAClD,kBAAkB,EAAE,iCAAkB,CAAC,cAAc;aACtD;YACD;gBACE,IAAI,EAAE,2BAAc,CAAC,uBAAuB;gBAC5C,MAAM,EAAE,EAAE,MAAM,EAAE,+BAA+B,EAAE;gBACnD,kBAAkB,EAAE,iCAAkB,CAAC,cAAc;aACtD;SACF,CAAA;QAEgB,iCAA4B,GAAiC,IAAI,oDAA4B,EAAE,CAAA;IAwFlH,CAAC;IAtFQ,KAAK,CAAC,wBAA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B,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,kCAAmB,CAAC,QAAQ,CAAC;YAClC,KAAK,iCAAkB,CAAC,cAAc;gBACpC,OAAO,IAAA,2DAAmC,EAAC,iBAA8C,EAAE,iBAAiB,CAAC,CAAA;YAC/G;gBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,YAAY,UAAU,gBAAgB,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,2BAA2B,CACtC,UAAkB,EAClB,uBAAgD;QAEhD,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,kCAAmB,CAAC,QAAQ,CAAC;YAClC,KAAK,iCAAkB,CAAC,cAAc;gBACpC,OAAO,IAAA,+DAAuC,EAAC,uBAAuB,CAAC,CAAA;YACzE;gBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,YAAY,UAAU,gBAAgB,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,+BAA+B,CAAC,UAAkB,EAAE,uBAAgD;QAC/G,QAAQ,UAAU,EAAE,CAAC;YACnB,KAAK,kCAAmB,CAAC,QAAQ,CAAC;YAClC,KAAK,iCAAkB,CAAC,cAAc;gBACpC,IAAI,CAAC;oBACH,MAAM,IAAI,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,CAAA;oBAE1F,OAAO,IAAI,CAAA;gBACb,CAAC;gBAAC,MAAM,CAAC;oBACP,OAAO,KAAK,CAAA;gBACd,CAAC;YACH;gBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,YAAY,UAAU,gBAAgB,CAAC,CAAA;QACvF,CAAC;IACH,CAAC;CACF;AArHD,sEAqHC"}
1
+ {"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,iBAAiB,CAAC,EAAA;oBAC/G;wBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;iBACtF;;;;KACF;IAEY,mEAA2B,GAAxC,UACE,UAAkB,EAClB,uBAAgD;;;gBAEhD,QAAQ,UAAU,EAAE;oBAClB,KAAK,kCAAmB,CAAC,QAAQ,CAAC;oBAClC,KAAK,iCAAkB,CAAC,cAAc;wBACpC,sBAAO,IAAA,+DAAuC,EAAC,uBAAuB,CAAC,EAAA;oBACzE;wBACE,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;iBACtF;;;;KACF;IAEY,uEAA+B,GAA5C,UAA6C,UAAkB,EAAE,uBAAgD;;;;;;wBACvG,KAAA,UAAU,CAAA;;iCACX,kCAAmB,CAAC,QAAQ,CAAC,CAA7B,wBAA4B;iCAC5B,iCAAkB,CAAC,cAAc,CAAC,CAAlC,wBAAiC;;;;;wBAElC,qBAAM,IAAI,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,EAAA;;wBAA1F,SAA0F,CAAA;wBAE1F,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAGd,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,QAAQ,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KAExF;IACH,oCAAC;AAAD,CAAC,AArHD,IAqHC;AArHY,sEAA6B"}
@@ -1,9 +1,29 @@
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
+ })();
2
17
  Object.defineProperty(exports, "__esModule", { value: true });
3
18
  exports.OptimismTransactionValidator = void 0;
4
19
  // tslint:disable: max-classes-per-file
5
- const v1_1 = require("@airgap/ethereum/v1");
6
- class OptimismTransactionValidator extends v1_1.EthereumTransactionValidator {
7
- }
20
+ var v1_1 = require("@airgap/ethereum/v1");
21
+ var OptimismTransactionValidator = /** @class */ (function (_super) {
22
+ __extends(OptimismTransactionValidator, _super);
23
+ function OptimismTransactionValidator() {
24
+ return _super !== null && _super.apply(this, arguments) || this;
25
+ }
26
+ return OptimismTransactionValidator;
27
+ }(v1_1.EthereumTransactionValidator));
8
28
  exports.OptimismTransactionValidator = OptimismTransactionValidator;
9
29
  //# sourceMappingURL=transaction-validator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,4CAAkE;AAGlE,MAAa,4BAA6B,SAAQ,iCAA4B;CAAmC;AAAjH,oEAAiH"}
1
+ {"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,0CAAkE;AAGlE;IAAkD,gDAA4B;IAA9E;;IAAgH,CAAC;IAAD,mCAAC;AAAD,CAAC,AAAjH,CAAkD,iCAA4B,GAAmC;AAApG,oEAA4B"}
@@ -1,2 +1,2 @@
1
1
  import { EthereumCryptoConfiguration } from '@airgap/ethereum/v1';
2
- export type OptimismCryptoConfiguration = EthereumCryptoConfiguration;
2
+ export declare type OptimismCryptoConfiguration = EthereumCryptoConfiguration;
@@ -2,9 +2,9 @@ import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTran
2
2
  export interface OptimismRawUnsignedTransaction extends EthereumRawUnsignedTransaction {
3
3
  l1DataFee: string;
4
4
  }
5
- export type OptimismTypedUnsignedTransaction = EthereumTypedUnsignedTransaction;
6
- export type OptimismUnsignedTransaction = OptimismRawUnsignedTransaction | OptimismTypedUnsignedTransaction;
5
+ export declare type OptimismTypedUnsignedTransaction = EthereumTypedUnsignedTransaction;
6
+ export declare type OptimismUnsignedTransaction = OptimismRawUnsignedTransaction | OptimismTypedUnsignedTransaction;
7
7
  export interface OptimismSignedTransaction extends EthereumSignedTransaction {
8
8
  l1DataFee?: string;
9
9
  }
10
- export type OptimismTransactionCursor = EthereumTransactionCursor;
10
+ export declare type OptimismTransactionCursor = EthereumTransactionCursor;
@@ -1,44 +1,33 @@
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
+ };
2
13
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.optimismERC20TokenSchema = exports.optimismProtocolSchema = exports.optimismBaseProtocolSchema = void 0;
4
- exports.isAnyOptimismProtocol = isAnyOptimismProtocol;
5
- exports.isOptimismProtocol = isOptimismProtocol;
6
- exports.isOptimismERC20Token = isOptimismERC20Token;
7
- const module_kit_1 = require("@airgap/module-kit");
14
+ exports.isOptimismERC20Token = exports.isOptimismProtocol = exports.isAnyOptimismProtocol = exports.optimismERC20TokenSchema = exports.optimismProtocolSchema = exports.optimismBaseProtocolSchema = void 0;
15
+ var module_kit_1 = require("@airgap/module-kit");
8
16
  // Schemas
9
- exports.optimismBaseProtocolSchema = {
10
- ...module_kit_1.offlineProtocolSchema,
11
- ...module_kit_1.onlineProtocolSchema,
12
- ...module_kit_1.bip32OfflineProtocolSchema,
13
- ...module_kit_1.bip32OnlineProtocolSchema,
14
- ...module_kit_1.aesEncryptionSchema,
15
- ...module_kit_1.asymmetricEncryptionOfflineSchema,
16
- ...module_kit_1.signMessageOfflineSchema,
17
- ...module_kit_1.fetchDataForAddressProtocolSchema,
18
- ...module_kit_1.fetchDataForMultipleAddressesProtocolSchema,
19
- ...module_kit_1.getTokenBalancesSchema,
20
- ...module_kit_1.transactionStatusCheckerSchema,
21
- ...module_kit_1.walletConnectProtocolSchema
22
- };
23
- exports.optimismProtocolSchema = {
24
- ...exports.optimismBaseProtocolSchema
25
- };
26
- exports.optimismERC20TokenSchema = {
27
- ...exports.optimismBaseProtocolSchema,
28
- ...module_kit_1.singleTokenSubProtocolSchema,
29
- name: 'required',
30
- symbol: 'required',
31
- decimals: 'required',
32
- tokenMetadata: 'required'
33
- };
17
+ exports.optimismBaseProtocolSchema = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, module_kit_1.offlineProtocolSchema), module_kit_1.onlineProtocolSchema), module_kit_1.bip32OfflineProtocolSchema), module_kit_1.bip32OnlineProtocolSchema), module_kit_1.aesEncryptionSchema), module_kit_1.asymmetricEncryptionOfflineSchema), module_kit_1.signMessageOfflineSchema), module_kit_1.fetchDataForAddressProtocolSchema), module_kit_1.fetchDataForMultipleAddressesProtocolSchema), module_kit_1.getTokenBalancesSchema), module_kit_1.transactionStatusCheckerSchema), module_kit_1.walletConnectProtocolSchema);
18
+ exports.optimismProtocolSchema = __assign({}, exports.optimismBaseProtocolSchema);
19
+ exports.optimismERC20TokenSchema = __assign(__assign(__assign({}, exports.optimismBaseProtocolSchema), module_kit_1.singleTokenSubProtocolSchema), { name: 'required', symbol: 'required', decimals: 'required', tokenMetadata: 'required' });
34
20
  // Implementation Checks
35
21
  function isAnyOptimismProtocol(protocol) {
36
22
  return (0, module_kit_1.implementsInterface)(protocol, exports.optimismBaseProtocolSchema);
37
23
  }
24
+ exports.isAnyOptimismProtocol = isAnyOptimismProtocol;
38
25
  function isOptimismProtocol(protocol) {
39
26
  return (0, module_kit_1.implementsInterface)(protocol, exports.optimismProtocolSchema);
40
27
  }
28
+ exports.isOptimismProtocol = isOptimismProtocol;
41
29
  function isOptimismERC20Token(protocol) {
42
30
  return (0, module_kit_1.implementsInterface)(protocol, exports.optimismERC20TokenSchema);
43
31
  }
32
+ exports.isOptimismERC20Token = isOptimismERC20Token;
44
33
  //# sourceMappingURL=protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/v1/utils/protocol.ts"],"names":[],"mappings":";;;AAuDA,sDAEC;AAED,gDAEC;AAED,oDAEC;AAjED,mDAiB2B;AAM3B,UAAU;AAEG,QAAA,0BAA0B,GAAiC;IACtE,GAAG,kCAAqB;IACxB,GAAG,iCAAoB;IACvB,GAAG,uCAA0B;IAC7B,GAAG,sCAAyB;IAC5B,GAAG,gCAAmB;IACtB,GAAG,8CAAiC;IACpC,GAAG,qCAAwB;IAC3B,GAAG,8CAAiC;IACpC,GAAG,wDAA2C;IAC9C,GAAG,mCAAsB;IACzB,GAAG,2CAA8B;IACjC,GAAG,wCAA2B;CAC/B,CAAA;AAEY,QAAA,sBAAsB,GAA6B;IAC9D,GAAG,kCAA0B;CAC9B,CAAA;AAEY,QAAA,wBAAwB,GAAuB;IAC1D,GAAG,kCAA0B;IAC7B,GAAG,yCAA4B;IAC/B,IAAI,EAAE,UAAU;IAChB,MAAM,EAAE,UAAU;IAClB,QAAQ,EAAE,UAAU;IACpB,aAAa,EAAE,UAAU;CAC1B,CAAA;AAED,wBAAwB;AAExB,SAAgB,qBAAqB,CAAC,QAA2B;IAC/D,OAAO,IAAA,gCAAmB,EAAuB,QAAQ,EAAE,kCAA0B,CAAC,CAAA;AACxF,CAAC;AAED,SAAgB,kBAAkB,CAAC,QAA2B;IAC5D,OAAO,IAAA,gCA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