@airgap/coinlib-core 0.13.7-beta.15 → 0.13.7-beta.17

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.
@@ -30365,7 +30365,7 @@ exports.InvalidString = InvalidString;
30365
30365
  },{"./coinlib-error":195}],197:[function(require,module,exports){
30366
30366
  "use strict";
30367
30367
  Object.defineProperty(exports, "__esModule", { value: true });
30368
- exports.bufferFrom = exports.assertNever = exports.SubProtocolType = exports.TimeInterval = exports.Domain = exports.TransactionError = exports.BalanceError = exports.ProtocolErrorType = exports.SerializerErrorType = exports.CoinlibError = exports.NetworkError = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.TypeNotSupported = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.isProtocolSymbol = exports.isNetworkEqual = exports.SimpleAction = exports.LinkedAction = exports.RepeatableAction = exports.Action = exports.NetworkType = exports.SubProtocolSymbols = exports.MainProtocolSymbols = exports.ProtocolNetwork = exports.ProtocolBlockExplorer = exports.CryptoClient = exports.AirGapNFTWallet = exports.AirGapWalletStatus = exports.AirGapCoinWallet = exports.AirGapMarketWallet = exports.AirGapWallet = void 0;
30368
+ exports.bufferFrom = exports.hasConfigurableContract = exports.implementsInterface = exports.assertNever = exports.SubProtocolType = exports.TimeInterval = exports.Domain = exports.TransactionError = exports.BalanceError = exports.ProtocolErrorType = exports.SerializerErrorType = exports.CoinlibError = exports.NetworkError = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.TypeNotSupported = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.isProtocolSymbol = exports.isNetworkEqual = exports.SimpleAction = exports.LinkedAction = exports.RepeatableAction = exports.Action = exports.NetworkType = exports.SubProtocolSymbols = exports.MainProtocolSymbols = exports.ProtocolNetwork = exports.ProtocolBlockExplorer = exports.CryptoClient = exports.AirGapNFTWallet = exports.AirGapWalletStatus = exports.AirGapCoinWallet = exports.AirGapMarketWallet = exports.AirGapWallet = void 0;
30369
30369
  var Action_1 = require("./actions/Action");
30370
30370
  Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
30371
30371
  var LinkedAction_1 = require("./actions/LinkedAction");
@@ -30394,6 +30394,9 @@ var assert_1 = require("./utils/assert");
30394
30394
  Object.defineProperty(exports, "assertNever", { enumerable: true, get: function () { return assert_1.assertNever; } });
30395
30395
  var buffer_1 = require("./utils/buffer");
30396
30396
  Object.defineProperty(exports, "bufferFrom", { enumerable: true, get: function () { return buffer_1.bufferFrom; } });
30397
+ var interfaces_1 = require("./utils/interfaces");
30398
+ Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return interfaces_1.hasConfigurableContract; } });
30399
+ Object.defineProperty(exports, "implementsInterface", { enumerable: true, get: function () { return interfaces_1.implementsInterface; } });
30397
30400
  var Network_1 = require("./utils/Network");
30398
30401
  Object.defineProperty(exports, "isNetworkEqual", { enumerable: true, get: function () { return Network_1.isNetworkEqual; } });
30399
30402
  var ProtocolBlockExplorer_1 = require("./utils/ProtocolBlockExplorer");
@@ -30418,7 +30421,7 @@ var AirGapWallet_1 = require("./wallet/AirGapWallet");
30418
30421
  Object.defineProperty(exports, "AirGapWallet", { enumerable: true, get: function () { return AirGapWallet_1.AirGapWallet; } });
30419
30422
  Object.defineProperty(exports, "AirGapWalletStatus", { enumerable: true, get: function () { return AirGapWallet_1.AirGapWalletStatus; } });
30420
30423
 
30421
- },{"./actions/Action":188,"./actions/LinkedAction":189,"./actions/RepeatableAction":190,"./actions/SimpleAction":191,"./errors":196,"./errors/coinlib-error":195,"./protocols/CryptoClient":198,"./protocols/ICoinSubProtocol":199,"./utils/Network":201,"./utils/ProtocolBlockExplorer":202,"./utils/ProtocolNetwork":203,"./utils/ProtocolSymbols":204,"./utils/assert":205,"./utils/buffer":206,"./wallet/AirGapCoinWallet":209,"./wallet/AirGapMarketWallet":210,"./wallet/AirGapNFTWallet":211,"./wallet/AirGapWallet":212}],198:[function(require,module,exports){
30424
+ },{"./actions/Action":188,"./actions/LinkedAction":189,"./actions/RepeatableAction":190,"./actions/SimpleAction":191,"./errors":196,"./errors/coinlib-error":195,"./protocols/CryptoClient":198,"./protocols/ICoinSubProtocol":199,"./utils/Network":201,"./utils/ProtocolBlockExplorer":202,"./utils/ProtocolNetwork":203,"./utils/ProtocolSymbols":204,"./utils/assert":205,"./utils/buffer":206,"./utils/interfaces":208,"./wallet/AirGapCoinWallet":210,"./wallet/AirGapMarketWallet":211,"./wallet/AirGapNFTWallet":212,"./wallet/AirGapWallet":213}],198:[function(require,module,exports){
30422
30425
  "use strict";
30423
30426
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
30424
30427
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -30940,7 +30943,26 @@ function fillToTargetLength(hexString, bitLength) {
30940
30943
  }
30941
30944
 
30942
30945
  }).call(this)}).call(this,require("buffer").Buffer)
30943
- },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"./padStart":208,"buffer":62}],208:[function(require,module,exports){
30946
+ },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"./padStart":209,"buffer":62}],208:[function(require,module,exports){
30947
+ "use strict";
30948
+ Object.defineProperty(exports, "__esModule", { value: true });
30949
+ exports.hasConfigurableContract = exports.implementsInterface = void 0;
30950
+ function implementsInterface(object, schema) {
30951
+ if (typeof object !== 'object' || !object) {
30952
+ return false;
30953
+ }
30954
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
30955
+ }
30956
+ exports.implementsInterface = implementsInterface;
30957
+ function hasConfigurableContract(object) {
30958
+ return implementsInterface(object, {
30959
+ getContractAddress: 'required',
30960
+ setContractAddress: 'required'
30961
+ });
30962
+ }
30963
+ exports.hasConfigurableContract = hasConfigurableContract;
30964
+
30965
+ },{}],209:[function(require,module,exports){
30944
30966
  "use strict";
30945
30967
  Object.defineProperty(exports, "__esModule", { value: true });
30946
30968
  exports.padStart = void 0;
@@ -30961,7 +30983,7 @@ function padStart(targetString, targetLength, padString) {
30961
30983
  }
30962
30984
  exports.padStart = padStart;
30963
30985
 
30964
- },{}],209:[function(require,module,exports){
30986
+ },{}],210:[function(require,module,exports){
30965
30987
  "use strict";
30966
30988
  var __extends = (this && this.__extends) || (function () {
30967
30989
  var extendStatics = function (d, b) {
@@ -31159,7 +31181,7 @@ var AirGapCoinWallet = /** @class */ (function (_super) {
31159
31181
  }(AirGapMarketWallet_1.AirGapMarketWallet));
31160
31182
  exports.AirGapCoinWallet = AirGapCoinWallet;
31161
31183
 
31162
- },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolNetwork":203,"../utils/ProtocolSymbols":204,"./AirGapMarketWallet":210}],210:[function(require,module,exports){
31184
+ },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolNetwork":203,"../utils/ProtocolSymbols":204,"./AirGapMarketWallet":211}],211:[function(require,module,exports){
31163
31185
  "use strict";
31164
31186
  var __extends = (this && this.__extends) || (function () {
31165
31187
  var extendStatics = function (d, b) {
@@ -31376,7 +31398,7 @@ var AirGapMarketWallet = /** @class */ (function (_super) {
31376
31398
  }(AirGapWallet_1.AirGapWallet));
31377
31399
  exports.AirGapMarketWallet = AirGapMarketWallet;
31378
31400
 
31379
- },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolSymbols":204,"./AirGapWallet":212}],211:[function(require,module,exports){
31401
+ },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolSymbols":204,"./AirGapWallet":213}],212:[function(require,module,exports){
31380
31402
  "use strict";
31381
31403
  var __extends = (this && this.__extends) || (function () {
31382
31404
  var extendStatics = function (d, b) {
@@ -31554,7 +31576,7 @@ var AirGapNFTWallet = /** @class */ (function (_super) {
31554
31576
  }(AirGapMarketWallet_1.AirGapMarketWallet));
31555
31577
  exports.AirGapNFTWallet = AirGapNFTWallet;
31556
31578
 
31557
- },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolNetwork":203,"./AirGapMarketWallet":210}],212:[function(require,module,exports){
31579
+ },{"../dependencies/src/bignumber.js-9.0.0/bignumber":193,"../utils/ProtocolNetwork":203,"./AirGapMarketWallet":211}],213:[function(require,module,exports){
31558
31580
  "use strict";
31559
31581
  var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
31560
31582
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ import { IAirGapSignedTransaction } from './interfaces/IAirGapSignedTransaction'
8
8
  import { IAirGapTransaction, IAirGapTransactionResult, IProtocolTransactionCursor } from './interfaces/IAirGapTransaction';
9
9
  import { IAirGapWallet } from './interfaces/IAirGapWallet';
10
10
  import { CryptoClient } from './protocols/CryptoClient';
11
+ import { HasConfigurableContract } from './protocols/HasConfigurableContract';
11
12
  import { DelegateeDetails, DelegatorAction, DelegatorDetails, DelegatorReward, ICoinDelegateProtocol } from './protocols/ICoinDelegateProtocol';
12
13
  import { FeeDefaults, ICoinProtocol } from './protocols/ICoinProtocol';
13
14
  import { ICoinSubProtocol, SubProtocolType } from './protocols/ICoinSubProtocol';
@@ -15,6 +16,7 @@ import { SignedTransaction } from './types/signed-transaction';
15
16
  import { UnsignedTransaction } from './types/unsigned-transaction';
16
17
  import { assertNever } from './utils/assert';
17
18
  import { bufferFrom } from './utils/buffer';
19
+ import { hasConfigurableContract, implementsInterface } from './utils/interfaces';
18
20
  import { isNetworkEqual } from './utils/Network';
19
21
  import { ProtocolBlockExplorer } from './utils/ProtocolBlockExplorer';
20
22
  import { NetworkType, ProtocolNetwork } from './utils/ProtocolNetwork';
@@ -23,9 +25,9 @@ import { AirGapCoinWallet, TimeInterval } from './wallet/AirGapCoinWallet';
23
25
  import { AirGapMarketWallet, AirGapWalletPriceService } from './wallet/AirGapMarketWallet';
24
26
  import { AirGapNFTWallet } from './wallet/AirGapNFTWallet';
25
27
  import { AirGapWallet, AirGapWalletStatus, SerializedAirGapWallet } from './wallet/AirGapWallet';
26
- export { AirGapWallet, AirGapMarketWallet, AirGapCoinWallet, AirGapWalletStatus, AirGapNFTWallet, IAirGapWallet, IAirGapTransaction, ICoinProtocol, ICoinSubProtocol, ICoinDelegateProtocol, CryptoClient, ProtocolBlockExplorer, ProtocolNetwork, ProtocolSymbols, MainProtocolSymbols, SubProtocolSymbols, NetworkType, FeeDefaults };
28
+ export { AirGapWallet, AirGapMarketWallet, AirGapCoinWallet, AirGapWalletStatus, AirGapNFTWallet, HasConfigurableContract, IAirGapWallet, IAirGapTransaction, ICoinProtocol, ICoinSubProtocol, ICoinDelegateProtocol, CryptoClient, ProtocolBlockExplorer, ProtocolNetwork, ProtocolSymbols, MainProtocolSymbols, SubProtocolSymbols, NetworkType, FeeDefaults };
27
29
  export { UnsignedTransaction, SignedTransaction };
28
30
  export { SerializedAirGapWallet };
29
31
  export { Action, RepeatableAction, LinkedAction, SimpleAction };
30
- export { isNetworkEqual, isProtocolSymbol, isMainProtocolSymbol, isSubProtocolSymbol, TypeNotSupported, SerializerVersionMismatch, ProtocolNotSupported, NetworkError, CoinlibError, SerializerErrorType, ProtocolErrorType, BalanceError, TransactionError, Domain, TimeInterval, DelegateeDetails, DelegatorAction, DelegatorDetails, DelegatorReward, IAirGapSignedTransaction, IAirGapTransactionResult, AirGapWalletPriceService, IProtocolTransactionCursor, SubProtocolType, assertNever };
32
+ export { isNetworkEqual, isProtocolSymbol, isMainProtocolSymbol, isSubProtocolSymbol, TypeNotSupported, SerializerVersionMismatch, ProtocolNotSupported, NetworkError, CoinlibError, SerializerErrorType, ProtocolErrorType, BalanceError, TransactionError, Domain, TimeInterval, DelegateeDetails, DelegatorAction, DelegatorDetails, DelegatorReward, IAirGapSignedTransaction, IAirGapTransactionResult, AirGapWalletPriceService, IProtocolTransactionCursor, SubProtocolType, assertNever, implementsInterface, hasConfigurableContract };
31
33
  export { bufferFrom };
package/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.bufferFrom = exports.assertNever = exports.SubProtocolType = exports.TimeInterval = exports.Domain = exports.TransactionError = exports.BalanceError = exports.ProtocolErrorType = exports.SerializerErrorType = exports.CoinlibError = exports.NetworkError = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.TypeNotSupported = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.isProtocolSymbol = exports.isNetworkEqual = exports.SimpleAction = exports.LinkedAction = exports.RepeatableAction = exports.Action = exports.NetworkType = exports.SubProtocolSymbols = exports.MainProtocolSymbols = exports.ProtocolNetwork = exports.ProtocolBlockExplorer = exports.CryptoClient = exports.AirGapNFTWallet = exports.AirGapWalletStatus = exports.AirGapCoinWallet = exports.AirGapMarketWallet = exports.AirGapWallet = void 0;
3
+ exports.bufferFrom = exports.hasConfigurableContract = exports.implementsInterface = exports.assertNever = exports.SubProtocolType = exports.TimeInterval = exports.Domain = exports.TransactionError = exports.BalanceError = exports.ProtocolErrorType = exports.SerializerErrorType = exports.CoinlibError = exports.NetworkError = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.TypeNotSupported = exports.isSubProtocolSymbol = exports.isMainProtocolSymbol = exports.isProtocolSymbol = exports.isNetworkEqual = exports.SimpleAction = exports.LinkedAction = exports.RepeatableAction = exports.Action = exports.NetworkType = exports.SubProtocolSymbols = exports.MainProtocolSymbols = exports.ProtocolNetwork = exports.ProtocolBlockExplorer = exports.CryptoClient = exports.AirGapNFTWallet = exports.AirGapWalletStatus = exports.AirGapCoinWallet = exports.AirGapMarketWallet = exports.AirGapWallet = void 0;
4
4
  var Action_1 = require("./actions/Action");
5
5
  Object.defineProperty(exports, "Action", { enumerable: true, get: function () { return Action_1.Action; } });
6
6
  var LinkedAction_1 = require("./actions/LinkedAction");
@@ -29,6 +29,9 @@ var assert_1 = require("./utils/assert");
29
29
  Object.defineProperty(exports, "assertNever", { enumerable: true, get: function () { return assert_1.assertNever; } });
30
30
  var buffer_1 = require("./utils/buffer");
31
31
  Object.defineProperty(exports, "bufferFrom", { enumerable: true, get: function () { return buffer_1.bufferFrom; } });
32
+ var interfaces_1 = require("./utils/interfaces");
33
+ Object.defineProperty(exports, "hasConfigurableContract", { enumerable: true, get: function () { return interfaces_1.hasConfigurableContract; } });
34
+ Object.defineProperty(exports, "implementsInterface", { enumerable: true, get: function () { return interfaces_1.implementsInterface; } });
32
35
  var Network_1 = require("./utils/Network");
33
36
  Object.defineProperty(exports, "isNetworkEqual", { enumerable: true, get: function () { return Network_1.isNetworkEqual; } });
34
37
  var ProtocolBlockExplorer_1 = require("./utils/ProtocolBlockExplorer");
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AA6EhC,uFA7EA,eAAM,OA6EA;AA5Ef,uDAAqD;AA4ElB,6FA5E1B,2BAAY,OA4E0B;AA3E/C,+DAA6D;AA2E5C,iGA3ER,mCAAgB,OA2EQ;AA1EjC,uDAAqD;AA0EJ,6FA1ExC,2BAAY,OA0EwC;AAzE7D,mCASiB;AAgFf,6FAxFA,qBAAY,OAwFA;AAJZ,6FAnFA,qBAAY,OAmFA;AAGZ,kGArFA,0BAAiB,OAqFA;AAJjB,qGAhFA,6BAAoB,OAgFA;AAGpB,oGAlFA,4BAAmB,OAkFA;AAJnB,0GA7EA,kCAAyB,OA6EA;AAOzB,iGAnFA,yBAAgB,OAmFA;AARhB,iGA1EA,yBAAgB,OA0EA;AAxElB,wDAA6D;AA4E3D,6FA5EO,4BAAY,OA4EP;AAKZ,uFAjFqB,sBAAM,OAiFrB;AA7ER,yDAAuD;AA0CrD,6FA1CO,2BAAY,OA0CP;AAjCd,iEAAgF;AA8E9E,gGA9EyB,kCAAe,OA8EzB;AA3EjB,yCAA4C;AA4E1C,4FA5EO,oBAAW,OA4EP;AA3Eb,yCAA2C;AA8ElC,2FA9EA,mBAAU,OA8EA;AA7EnB,2CAAgD;AAiD9C,+FAjDO,wBAAc,OAiDP;AAhDhB,uEAAqE;AA4BnE,sGA5BO,6CAAqB,OA4BP;AA3BvB,2DAAsE;AAgCpE,4FAhCO,6BAAW,OAgCP;AAJX,gGA5BoB,iCAAe,OA4BpB;AA3BjB,2DAOgC;AAyC9B,qGA/CA,sCAAoB,OA+CA;AADpB,iGA7CA,kCAAgB,OA6CA;AAEhB,oGA9CA,qCAAmB,OA8CA;AApBnB,oGAzBA,qCAAmB,OAyBA;AACnB,mGAxBA,oCAAkB,OAwBA;AAtBpB,8DAA0E;AASxE,iGATO,mCAAgB,OASP;AA4ChB,6FArDyB,+BAAY,OAqDzB;AApDd,kEAA0F;AAOxF,mGAPO,uCAAkB,OAOP;AANpB,4DAA0D;AASxD,gGATO,iCAAe,OASP;AARjB,sDAAgG;AAI9F,6FAJO,2BAAY,OAIP;AAGZ,mGAPqB,iCAAkB,OAOrB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAyC;AAgFhC,uFAhFA,eAAM,OAgFA;AA/Ef,uDAAqD;AA+ElB,6FA/E1B,2BAAY,OA+E0B;AA9E/C,+DAA6D;AA8E5C,iGA9ER,mCAAgB,OA8EQ;AA7EjC,uDAAqD;AA6EJ,6FA7ExC,2BAAY,OA6EwC;AA5E7D,mCASiB;AAmFf,6FA3FA,qBAAY,OA2FA;AAJZ,6FAtFA,qBAAY,OAsFA;AAGZ,kGAxFA,0BAAiB,OAwFA;AAJjB,qGAnFA,6BAAoB,OAmFA;AAGpB,oGArFA,4BAAmB,OAqFA;AAJnB,0GAhFA,kCAAyB,OAgFA;AAOzB,iGAtFA,yBAAgB,OAsFA;AARhB,iGA7EA,yBAAgB,OA6EA;AA3ElB,wDAA6D;AA+E3D,6FA/EO,4BAAY,OA+EP;AAKZ,uFApFqB,sBAAM,OAoFrB;AAhFR,yDAAuD;AA6CrD,6FA7CO,2BAAY,OA6CP;AAnCd,iEAAgF;AAgF9E,gGAhFyB,kCAAe,OAgFzB;AA7EjB,yCAA4C;AA8E1C,4FA9EO,oBAAW,OA8EP;AA7Eb,yCAA2C;AAkFlC,2FAlFA,mBAAU,OAkFA;AAjFnB,iDAAiF;AA8E/E,wGA9EO,oCAAuB,OA8EP;AADvB,oGA7EgC,gCAAmB,OA6EhC;AA5ErB,2CAAgD;AAkD9C,+FAlDO,wBAAc,OAkDP;AAjDhB,uEAAqE;AA6BnE,sGA7BO,6CAAqB,OA6BP;AA5BvB,2DAAsE;AAiCpE,4FAjCO,6BAAW,OAiCP;AAJX,gGA7BoB,iCAAe,OA6BpB;AA5BjB,2DAOgC;AA0C9B,qGAhDA,sCAAoB,OAgDA;AADpB,iGA9CA,kCAAgB,OA8CA;AAEhB,oGA/CA,qCAAmB,OA+CA;AApBnB,oGA1BA,qCAAmB,OA0BA;AACnB,mGAzBA,oCAAkB,OAyBA;AAvBpB,8DAA0E;AASxE,iGATO,mCAAgB,OASP;AA6ChB,6FAtDyB,+BAAY,OAsDzB;AArDd,kEAA0F;AAOxF,mGAPO,uCAAkB,OAOP;AANpB,4DAA0D;AASxD,gGATO,iCAAe,OASP;AARjB,sDAAgG;AAI9F,6FAJO,2BAAY,OAIP;AAGZ,mGAPqB,iCAAkB,OAOrB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@airgap/coinlib-core",
3
- "version": "0.13.7-beta.15",
3
+ "version": "0.13.7-beta.17",
4
4
  "description": "The @airgap/coinlib-core is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.",
5
5
  "keywords": [
6
6
  "airgap",
@@ -0,0 +1,4 @@
1
+ export interface HasConfigurableContract {
2
+ getContractAddress(): Promise<string | undefined>;
3
+ setContractAddress(address: string): Promise<void>;
4
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=HasConfigurableContract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HasConfigurableContract.js","sourceRoot":"","sources":["../../src/protocols/HasConfigurableContract.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { HasConfigurableContract } from '../protocols/HasConfigurableContract';
2
+ export declare function implementsInterface<T>(object: unknown, schema: Record<keyof T, 'required' | 'optional'>): object is T;
3
+ export declare function hasConfigurableContract(object: unknown): object is HasConfigurableContract;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.hasConfigurableContract = exports.implementsInterface = void 0;
4
+ function implementsInterface(object, schema) {
5
+ if (typeof object !== 'object' || !object) {
6
+ return false;
7
+ }
8
+ return Object.keys(schema).every(function (key) { return schema[key] === 'optional' || object[key] !== undefined; });
9
+ }
10
+ exports.implementsInterface = implementsInterface;
11
+ function hasConfigurableContract(object) {
12
+ return implementsInterface(object, {
13
+ getContractAddress: 'required',
14
+ setContractAddress: 'required'
15
+ });
16
+ }
17
+ exports.hasConfigurableContract = hasConfigurableContract;
18
+ //# sourceMappingURL=interfaces.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.js","sourceRoot":"","sources":["../../src/utils/interfaces.ts"],"names":[],"mappings":";;;AAEA,SAAgB,mBAAmB,CAAI,MAAe,EAAE,MAAgD;IACtG,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,EAAE;QACzC,OAAO,KAAK,CAAA;KACb;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,UAAC,GAAG,IAAK,OAAA,MAAM,CAAC,GAAG,CAAC,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,CAAC,KAAK,SAAS,EAAvD,CAAuD,CAAC,CAAA;AACpG,CAAC;AAND,kDAMC;AAED,SAAgB,uBAAuB,CAAC,MAAe;IACrD,OAAO,mBAAmB,CAA0B,MAAM,EAAE;QAC1D,kBAAkB,EAAE,UAAU;QAC9B,kBAAkB,EAAE,UAAU;KAC/B,CAAC,CAAA;AACJ,CAAC;AALD,0DAKC"}