aftermath-ts-sdk 1.1.7 → 1.1.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/dist/general/providers/aftermath.d.ts +30 -0
- package/dist/general/providers/aftermath.d.ts.map +1 -1
- package/dist/general/providers/aftermath.js +30 -0
- package/dist/general/providers/aftermathApi.d.ts +18 -0
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +18 -0
- package/dist/general/utils/casting.d.ts +4 -0
- package/dist/general/utils/casting.d.ts.map +1 -1
- package/dist/general/utils/casting.js +4 -0
- package/dist/general/utils/helpers.d.ts +15 -0
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +15 -0
- package/dist/packages/pools/api/poolsApi.d.ts +256 -0
- package/dist/packages/pools/api/poolsApi.d.ts.map +1 -1
- package/dist/packages/pools/api/poolsApi.js +253 -0
- package/dist/packages/pools/pool.d.ts +150 -8
- package/dist/packages/pools/pool.d.ts.map +1 -1
- package/dist/packages/pools/pool.js +139 -18
- package/dist/packages/pools/pools.d.ts +28 -0
- package/dist/packages/pools/pools.d.ts.map +1 -1
- package/dist/packages/pools/pools.js +28 -0
- package/dist/packages/router/api/routerApi.d.ts +37 -0
- package/dist/packages/router/api/routerApi.d.ts.map +1 -1
- package/dist/packages/router/api/routerApi.js +37 -0
- package/dist/packages/router/api/routerApiHelpers.d.ts.map +1 -1
- package/dist/packages/router/api/routerApiHelpers.js +0 -37
- package/dist/packages/staking/staking.d.ts +78 -0
- package/dist/packages/staking/staking.d.ts.map +1 -1
- package/dist/packages/staking/staking.js +78 -0
- package/package.json +2 -2
|
@@ -38,19 +38,49 @@ export declare class Aftermath extends Caller {
|
|
|
38
38
|
* @returns New `Aftermath` instance
|
|
39
39
|
*/
|
|
40
40
|
constructor(network?: SuiNetwork | Url);
|
|
41
|
+
/**
|
|
42
|
+
* Retrieves the addresses from the Aftermath API.
|
|
43
|
+
* @returns A promise that resolves to a ConfigAddresses object.
|
|
44
|
+
*/
|
|
41
45
|
getAddresses(): Promise<ConfigAddresses>;
|
|
46
|
+
/**
|
|
47
|
+
* Returns an instance of the Pools class.
|
|
48
|
+
* @returns {Pools} An instance of the Pools class.
|
|
49
|
+
*/
|
|
42
50
|
Pools: () => Pools;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new instance of the Staking class.
|
|
53
|
+
* @returns A new instance of the Staking class.
|
|
54
|
+
*/
|
|
43
55
|
Staking: () => Staking;
|
|
44
56
|
SuiFrens: () => SuiFrens;
|
|
45
57
|
Faucet: () => Faucet;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a new instance of the Router class with the current network.
|
|
60
|
+
* @returns A new instance of the Router class.
|
|
61
|
+
*/
|
|
46
62
|
Router: () => Router;
|
|
47
63
|
NftAmm: () => NftAmm;
|
|
48
64
|
ReferralVault: () => ReferralVault;
|
|
49
65
|
Perpetuals: () => Perpetuals;
|
|
66
|
+
/**
|
|
67
|
+
* Creates a new instance of the Farms class.
|
|
68
|
+
* @returns A new instance of the Farms class.
|
|
69
|
+
*/
|
|
50
70
|
Farms: () => Farms;
|
|
51
71
|
Sui: () => Sui;
|
|
52
72
|
Prices: () => Prices;
|
|
73
|
+
/**
|
|
74
|
+
* Creates a new instance of the Wallet class.
|
|
75
|
+
* @param address - The address of the wallet.
|
|
76
|
+
* @returns A new instance of the Wallet class.
|
|
77
|
+
*/
|
|
53
78
|
Wallet: (address: SuiAddress) => Wallet;
|
|
79
|
+
/**
|
|
80
|
+
* Creates a new instance of the Coin class.
|
|
81
|
+
* @param coinType The type of coin to create.
|
|
82
|
+
* @returns A new instance of the Coin class.
|
|
83
|
+
*/
|
|
54
84
|
Coin: (coinType?: CoinType) => Coin;
|
|
55
85
|
HistoricalData: () => HistoricalData;
|
|
56
86
|
DynamicGas: () => DynamicGas;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aftermath.d.ts","sourceRoot":"","sources":["../../../src/general/providers/aftermath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EACN,QAAQ,EACR,eAAe,EACf,UAAU,EACV,UAAU,EACV,GAAG,EACH,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAChD,OAAO,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,SAAU,SAAQ,MAAM;IAKpC;;;;;OAKG;gBACS,OAAO,CAAC,EAAE,UAAU,GAAG,GAAG;
|
|
1
|
+
{"version":3,"file":"aftermath.d.ts","sourceRoot":"","sources":["../../../src/general/providers/aftermath.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACnD,OAAO,EACN,QAAQ,EACR,eAAe,EACf,UA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;;;OAIG;IACI,MAAM,YAAa,UAAU,YAAuC;IAC3E;;;;OAIG;IACI,IAAI,cAAe,QAAQ,UAAsC;IACjE,cAAc,uBAA0C;IACxD,UAAU,mBAAsC;IAMvD,OAAc,OAAO,iBAAW;IAChC,OAAc,OAAO,iBAAW;CAChC"}
|
|
@@ -59,21 +59,47 @@ class Aftermath extends caller_1.Caller {
|
|
|
59
59
|
// =========================================================================
|
|
60
60
|
// Packages
|
|
61
61
|
// =========================================================================
|
|
62
|
+
/**
|
|
63
|
+
* Returns an instance of the Pools class.
|
|
64
|
+
* @returns {Pools} An instance of the Pools class.
|
|
65
|
+
*/
|
|
62
66
|
this.Pools = () => new pools_1.Pools(this.network);
|
|
67
|
+
/**
|
|
68
|
+
* Creates a new instance of the Staking class.
|
|
69
|
+
* @returns A new instance of the Staking class.
|
|
70
|
+
*/
|
|
63
71
|
this.Staking = () => new staking_1.Staking(this.network);
|
|
64
72
|
this.SuiFrens = () => new suiFrens_1.SuiFrens(this.network);
|
|
65
73
|
this.Faucet = () => new faucet_1.Faucet(this.network);
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new instance of the Router class with the current network.
|
|
76
|
+
* @returns A new instance of the Router class.
|
|
77
|
+
*/
|
|
66
78
|
this.Router = () => new packages_1.Router(this.network);
|
|
67
79
|
this.NftAmm = () => new packages_1.NftAmm(this.network);
|
|
68
80
|
this.ReferralVault = () => new packages_1.ReferralVault(this.network);
|
|
69
81
|
this.Perpetuals = () => new perpetuals_1.Perpetuals(this.network);
|
|
82
|
+
/**
|
|
83
|
+
* Creates a new instance of the Farms class.
|
|
84
|
+
* @returns A new instance of the Farms class.
|
|
85
|
+
*/
|
|
70
86
|
this.Farms = () => new farms_1.Farms(this.network);
|
|
71
87
|
// =========================================================================
|
|
72
88
|
// General
|
|
73
89
|
// =========================================================================
|
|
74
90
|
this.Sui = () => new packages_1.Sui(this.network);
|
|
75
91
|
this.Prices = () => new prices_1.Prices(this.network);
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new instance of the Wallet class.
|
|
94
|
+
* @param address - The address of the wallet.
|
|
95
|
+
* @returns A new instance of the Wallet class.
|
|
96
|
+
*/
|
|
76
97
|
this.Wallet = (address) => new wallet_1.Wallet(address, this.network);
|
|
98
|
+
/**
|
|
99
|
+
* Creates a new instance of the Coin class.
|
|
100
|
+
* @param coinType The type of coin to create.
|
|
101
|
+
* @returns A new instance of the Coin class.
|
|
102
|
+
*/
|
|
77
103
|
this.Coin = (coinType) => new coin_1.Coin(coinType, this.network);
|
|
78
104
|
this.HistoricalData = () => new historicalData_1.HistoricalData(this.network);
|
|
79
105
|
this.DynamicGas = () => new dynamicGas_1.DynamicGas(this.network);
|
|
@@ -81,6 +107,10 @@ class Aftermath extends caller_1.Caller {
|
|
|
81
107
|
// =========================================================================
|
|
82
108
|
// Public Methods
|
|
83
109
|
// =========================================================================
|
|
110
|
+
/**
|
|
111
|
+
* Retrieves the addresses from the Aftermath API.
|
|
112
|
+
* @returns A promise that resolves to a ConfigAddresses object.
|
|
113
|
+
*/
|
|
84
114
|
getAddresses() {
|
|
85
115
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
116
|
return this.fetchApi("addresses");
|
|
@@ -25,6 +25,10 @@ import { CoinGeckoCoinApiId } from "../prices/coingecko/coinGeckoTypes";
|
|
|
25
25
|
import { IndexerCaller } from "../utils";
|
|
26
26
|
import { SuiClient } from "@mysten/sui.js/client";
|
|
27
27
|
import { DynamicGasApi } from "../dynamicGas/dynamicGasApi";
|
|
28
|
+
/**
|
|
29
|
+
* This class represents the Aftermath API and provides helper methods for various functionalities.
|
|
30
|
+
* @class
|
|
31
|
+
*/
|
|
28
32
|
export declare class AftermathApi {
|
|
29
33
|
readonly provider: SuiClient;
|
|
30
34
|
readonly addresses: ConfigAddresses;
|
|
@@ -40,6 +44,13 @@ export declare class AftermathApi {
|
|
|
40
44
|
coin: typeof CoinApi;
|
|
41
45
|
sui: typeof SuiApi;
|
|
42
46
|
};
|
|
47
|
+
/**
|
|
48
|
+
* Creates an instance of AftermathApi.
|
|
49
|
+
* @param provider - The SuiClient instance to use for interacting with the blockchain.
|
|
50
|
+
* @param addresses - The configuration addresses for the Aftermath protocol.
|
|
51
|
+
* @param indexerCaller - The IndexerCaller instance to use for querying the blockchain.
|
|
52
|
+
* @param coinGeckoApiKey - (Optional) The API key to use for querying CoinGecko for token prices.
|
|
53
|
+
*/
|
|
43
54
|
constructor(provider: SuiClient, addresses: ConfigAddresses, indexerCaller: IndexerCaller, coinGeckoApiKey?: string | undefined);
|
|
44
55
|
DynamicFields: () => DynamicFieldsApiHelpers;
|
|
45
56
|
Events: () => EventsApiHelpers;
|
|
@@ -60,6 +71,13 @@ export declare class AftermathApi {
|
|
|
60
71
|
ReferralVault: () => ReferralVaultApi;
|
|
61
72
|
Perpetuals: () => PerpetualsApi;
|
|
62
73
|
Farms: () => FarmsApi;
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new instance of the RouterApi class.
|
|
76
|
+
* @param protocols An optional array of protocol names to use for the router.
|
|
77
|
+
* @param regularOptions An optional object containing regular router options.
|
|
78
|
+
* @param preAsyncOptions An optional object containing pre-async router options.
|
|
79
|
+
* @returns A new instance of the RouterApi class.
|
|
80
|
+
*/
|
|
63
81
|
Router: (protocols?: RouterProtocolName[], regularOptions?: PartialRouterOptions, preAsyncOptions?: Partial<RouterSynchronousOptions>) => RouterApi;
|
|
64
82
|
}
|
|
65
83
|
//# sourceMappingURL=aftermathApi.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aftermathApi.d.ts","sourceRoot":"","sources":["../../../src/general/providers/aftermathApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,iCAAiC,CAA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ACrE"}
|
|
@@ -23,10 +23,21 @@ const placeholderHistoricalDataApi_1 = require("../historicalData/placeholderHis
|
|
|
23
23
|
const perpetualsApi_1 = require("../../packages/perpetuals/api/perpetualsApi");
|
|
24
24
|
const farmsApi_1 = require("../../packages/farms/api/farmsApi");
|
|
25
25
|
const dynamicGasApi_1 = require("../dynamicGas/dynamicGasApi");
|
|
26
|
+
/**
|
|
27
|
+
* This class represents the Aftermath API and provides helper methods for various functionalities.
|
|
28
|
+
* @class
|
|
29
|
+
*/
|
|
26
30
|
class AftermathApi {
|
|
27
31
|
// =========================================================================
|
|
28
32
|
// Constructor
|
|
29
33
|
// =========================================================================
|
|
34
|
+
/**
|
|
35
|
+
* Creates an instance of AftermathApi.
|
|
36
|
+
* @param provider - The SuiClient instance to use for interacting with the blockchain.
|
|
37
|
+
* @param addresses - The configuration addresses for the Aftermath protocol.
|
|
38
|
+
* @param indexerCaller - The IndexerCaller instance to use for querying the blockchain.
|
|
39
|
+
* @param coinGeckoApiKey - (Optional) The API key to use for querying CoinGecko for token prices.
|
|
40
|
+
*/
|
|
30
41
|
constructor(provider, addresses, indexerCaller, coinGeckoApiKey) {
|
|
31
42
|
this.provider = provider;
|
|
32
43
|
this.addresses = addresses;
|
|
@@ -76,6 +87,13 @@ class AftermathApi {
|
|
|
76
87
|
this.ReferralVault = () => new referralVaultApi_1.ReferralVaultApi(this);
|
|
77
88
|
this.Perpetuals = () => new perpetualsApi_1.PerpetualsApi(this);
|
|
78
89
|
this.Farms = () => new farmsApi_1.FarmsApi(this);
|
|
90
|
+
/**
|
|
91
|
+
* Creates a new instance of the RouterApi class.
|
|
92
|
+
* @param protocols An optional array of protocol names to use for the router.
|
|
93
|
+
* @param regularOptions An optional object containing regular router options.
|
|
94
|
+
* @param preAsyncOptions An optional object containing pre-async router options.
|
|
95
|
+
* @returns A new instance of the RouterApi class.
|
|
96
|
+
*/
|
|
79
97
|
this.Router = (protocols, regularOptions, preAsyncOptions) => new routerApi_1.RouterApi(this, protocols, regularOptions, preAsyncOptions);
|
|
80
98
|
}
|
|
81
99
|
}
|
|
@@ -7,6 +7,10 @@ import { Byte, SuiAddress } from "../types";
|
|
|
7
7
|
import { RouterApiCasting } from "../../packages/router/api/routerApiCasting";
|
|
8
8
|
import { PerpetualsApiCasting } from "../../packages/perpetuals/api/perpetualsApiCasting";
|
|
9
9
|
import { FarmsApiCasting } from "../../packages/farms/api/farmsApiCasting";
|
|
10
|
+
/**
|
|
11
|
+
* Utility class for casting and conversion functions.
|
|
12
|
+
* @class
|
|
13
|
+
*/
|
|
10
14
|
export declare class Casting {
|
|
11
15
|
static pools: typeof PoolsApiCasting;
|
|
12
16
|
static suiFrens: typeof SuiFrensApiCasting;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"casting.d.ts","sourceRoot":"","sources":["../../../src/general/utils/casting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAC3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,8CAA8C,CAAC;AACjF,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,4CAA4C,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,oDAAoD,CAAC;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,qBAAa,OAAO;IAKnB,OAAc,KAAK,yBAAmB;IACtC,OAAc,QAAQ,4BAAsB;IAC5C,OAAc,MAAM,0BAAoB;IACxC,OAAc,OAAO,2BAAqB;IAC1C,OAAc,MAAM,0BAAoB;IACxC,OAAc,MAAM,0BAAoB;IACxC,OAAc,UAAU,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AAM,0CAA0C,CAAC;AAE3E;;;GAGG;AACH,qBAAa,OAAO;IAKnB,OAAc,KAAK,yBAAmB;IACtC,OAAc,QAAQ,4BAAsB;IAC5C,OAAc,MAAM,0BAAoB;IACxC,OAAc,OAAO,2BAAqB;IAC1C,OAAc,MAAM,0BAAoB;IACxC,OAAc,MAAM,0BAAoB;IACxC,OAAc,UAAU,8BAAwB;IAChD,OAAc,KAAK,yBAAmB;IAUtC,OAAc,cAAc,EAAE,MAAM,CAAiC;IACrE,OAAc,cAAc,EAAE,MAAM,CAA+B;IACnE,OAAc,YAAY,EAAE,MAAM,CAAgC;IAClE,OAAc,aAAa,EAAE,MAAM,CAEjC;IACF,OAAc,UAAU,EAAE,MAAM,CAAa;IAU7C,OAAc,mBAAmB,MAAO,MAAM,KAAG,MAAM,CACV;IAC7C,OAAc,mBAAmB,MAAO,MAAM,KAAG,MAAM,CACtB;IAEjC,OAAc,mBAAmB,WAAY,MAAM,OAAO,MAAM,KAAG,MAAM,CAC/B;IAM1C,OAAc,eAAe,UAAW,IAAI,EAAE,YACN;IAExC,OAAc,eAAe,UAAW,IAAI,EAAE,YAO3C;IAEH,OAAc,gBAAgB,UAAW,IAAI,EAAE,KAAG,UAAU,CACX;IAEjD,OAAc,wBAAwB,qBACnB,GAAG,KACnB,GAAG,GAAG,SAAS,CAEhB;IAEF,OAAc,kBAAkB,QAAS,MAAM,cAS7C;IAEF,OAAc,0BAA0B,sBAAuB,MAAM,YAEnE;CACF"}
|
|
@@ -11,6 +11,10 @@ const stakingApiCasting_1 = require("../../packages/staking/api/stakingApiCastin
|
|
|
11
11
|
const routerApiCasting_1 = require("../../packages/router/api/routerApiCasting");
|
|
12
12
|
const perpetualsApiCasting_1 = require("../../packages/perpetuals/api/perpetualsApiCasting");
|
|
13
13
|
const farmsApiCasting_1 = require("../../packages/farms/api/farmsApiCasting");
|
|
14
|
+
/**
|
|
15
|
+
* Utility class for casting and conversion functions.
|
|
16
|
+
* @class
|
|
17
|
+
*/
|
|
14
18
|
class Casting {
|
|
15
19
|
}
|
|
16
20
|
exports.Casting = Casting;
|
|
@@ -5,13 +5,28 @@ import { EventsApiHelpers } from "../api/eventsApiHelpers";
|
|
|
5
5
|
import { InspectionsApiHelpers } from "../api/inspectionsApiHelpers";
|
|
6
6
|
import { ObjectsApiHelpers } from "../api/objectsApiHelpers";
|
|
7
7
|
import { TransactionsApiHelpers } from "../api/transactionsApiHelpers";
|
|
8
|
+
/**
|
|
9
|
+
* A utility class containing various helper functions for general use.
|
|
10
|
+
*/
|
|
8
11
|
export declare class Helpers {
|
|
9
12
|
static readonly dynamicFields: typeof DynamicFieldsApiHelpers;
|
|
10
13
|
static readonly events: typeof EventsApiHelpers;
|
|
11
14
|
static readonly inspections: typeof InspectionsApiHelpers;
|
|
12
15
|
static readonly objects: typeof ObjectsApiHelpers;
|
|
13
16
|
static readonly transactions: typeof TransactionsApiHelpers;
|
|
17
|
+
/**
|
|
18
|
+
* Removes leading zeroes from the hexadecimal representation of a given object type.
|
|
19
|
+
* @param type - The object type to strip leading zeroes from.
|
|
20
|
+
* @returns The object type with leading zeroes removed from its hexadecimal representation.
|
|
21
|
+
*/
|
|
14
22
|
static stripLeadingZeroesFromType: (type: AnyObjectType) => AnyObjectType;
|
|
23
|
+
/**
|
|
24
|
+
* Adds leading zeroes to a given `AnyObjectType` until it reaches a length of 64 characters.
|
|
25
|
+
* If the input type already has a length greater than 64, an error is thrown.
|
|
26
|
+
* @param type - The `AnyObjectType` to add leading zeroes to.
|
|
27
|
+
* @returns The modified `AnyObjectType` with leading zeroes added.
|
|
28
|
+
* @throws An error if the input type has a length greater than 64.
|
|
29
|
+
*/
|
|
15
30
|
static addLeadingZeroesToType: (type: AnyObjectType) => AnyObjectType;
|
|
16
31
|
static isNumber: (str: string) => boolean;
|
|
17
32
|
static sum: (arr: number[]) => number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/general/utils/helpers.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AAM,iDAiBT;IAMJ,OAAc,QAAQ,sBAwBpB;IAEF,OAAc,UAAU,QAAS,GAAG,EAAE,YAcpC;IAEF,OAAc,WAAW,uBAA2C;IAEpE,OAAc,KAAK,OAAQ,MAAM,sBAA2C;IAE5E,OAAc,SAAS,eAC4C;IAEnE,OAAc,QAAQ,iEAEU,MAAM,uBAAuB,OAAO,+CASlE;IAEF,OAAc,aAAa,iEAIlB,MAAM,uBAET,QAAQ,OAAO,CAAC,wDAIpB;IAEF,OAAc,YAAY,uDAER,MAAM,mBAAmB,OAAO,2BAWjB;IAEjC,OAAc,mBAAmB,WACxB,OAAO,YACL,QAAQ,YAWjB;IAEF,OAAc,aAAa,WAAY,MAAM,YAAY,QAAQ,YAE/D;WAMY,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,EAAE;WAWnD,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,QAAQ;WAOhD,WAAW,CAAC,IAAI,EAAE,iBAAiB,GAAG,QAAQ;WAO9C,eAAe,CAC5B,IAAI,EAAE,iBAAiB,GACrB,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WASR,gBAAgB,CAC7B,IAAI,EAAE,iBAAiB,GACrB,qBAAqB;CAMxB"}
|
|
@@ -17,6 +17,9 @@ const inspectionsApiHelpers_1 = require("../api/inspectionsApiHelpers");
|
|
|
17
17
|
const objectsApiHelpers_1 = require("../api/objectsApiHelpers");
|
|
18
18
|
const transactionsApiHelpers_1 = require("../api/transactionsApiHelpers");
|
|
19
19
|
const casting_1 = require("./casting");
|
|
20
|
+
/**
|
|
21
|
+
* A utility class containing various helper functions for general use.
|
|
22
|
+
*/
|
|
20
23
|
class Helpers {
|
|
21
24
|
// =========================================================================
|
|
22
25
|
// Type Checking
|
|
@@ -73,7 +76,19 @@ Helpers.transactions = transactionsApiHelpers_1.TransactionsApiHelpers;
|
|
|
73
76
|
// =========================================================================
|
|
74
77
|
// Type Manipulation
|
|
75
78
|
// =========================================================================
|
|
79
|
+
/**
|
|
80
|
+
* Removes leading zeroes from the hexadecimal representation of a given object type.
|
|
81
|
+
* @param type - The object type to strip leading zeroes from.
|
|
82
|
+
* @returns The object type with leading zeroes removed from its hexadecimal representation.
|
|
83
|
+
*/
|
|
76
84
|
Helpers.stripLeadingZeroesFromType = (type) => type.replaceAll(/x0+/g, "x");
|
|
85
|
+
/**
|
|
86
|
+
* Adds leading zeroes to a given `AnyObjectType` until it reaches a length of 64 characters.
|
|
87
|
+
* If the input type already has a length greater than 64, an error is thrown.
|
|
88
|
+
* @param type - The `AnyObjectType` to add leading zeroes to.
|
|
89
|
+
* @returns The modified `AnyObjectType` with leading zeroes added.
|
|
90
|
+
* @throws An error if the input type has a length greater than 64.
|
|
91
|
+
*/
|
|
77
92
|
Helpers.addLeadingZeroesToType = (type) => {
|
|
78
93
|
const expectedTypeLength = 64;
|
|
79
94
|
let strippedType = type.replace("0x", "");
|