aftermath-ts-sdk 0.0.147 → 0.0.148
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/historicalData/historicalDataApi.d.ts +2 -1
- package/dist/general/historicalData/historicalDataApi.d.ts.map +1 -1
- package/dist/general/historicalData/historicalDataApiInterface.d.ts +10 -0
- package/dist/general/historicalData/historicalDataApiInterface.d.ts.map +1 -0
- package/dist/general/historicalData/historicalDataApiInterface.js +2 -0
- package/dist/general/historicalData/placeholderHistoricalDataApi.d.ts +10 -0
- package/dist/general/historicalData/placeholderHistoricalDataApi.d.ts.map +1 -0
- package/dist/general/historicalData/placeholderHistoricalDataApi.js +23 -0
- package/dist/general/prices/placeholder/placeholderPricesApi.d.ts +1 -2
- package/dist/general/prices/placeholder/placeholderPricesApi.d.ts.map +1 -1
- package/dist/general/prices/placeholder/placeholderPricesApi.js +1 -1
- package/dist/general/providers/aftermathApi.d.ts +6 -4
- package/dist/general/providers/aftermathApi.d.ts.map +1 -1
- package/dist/general/providers/aftermathApi.js +8 -3
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { HistoricalDataApiInterface } from "./historicalDataApiInterface";
|
|
2
|
+
export declare class HistoricalDataApi implements HistoricalDataApiInterface {
|
|
2
3
|
private readonly coinGeckoApiKey;
|
|
3
4
|
constructor(coinGeckoApiKey: string);
|
|
4
5
|
fetchAllCoinData: () => Promise<Record<string, import("../prices/coingecko/coinGeckoTypes").CoinGeckoCoinData>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"historicalDataApi.d.ts","sourceRoot":"","sources":["../../../src/general/historicalData/historicalDataApi.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"historicalDataApi.d.ts","sourceRoot":"","sources":["../../../src/general/historicalData/historicalDataApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAE1E,qBAAa,iBAAkB,YAAW,0BAA0B;IAKvD,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAAf,eAAe,EAAE,MAAM;IAM7C,gBAAgB,gGACJ;IAEZ,mBAAmB;;;sEACJ;CACtB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CoinGeckoCoinData } from "../prices/coingecko/coinGeckoTypes";
|
|
2
|
+
import { CoinHistoricalData } from "./historicalDataTypes";
|
|
3
|
+
export interface HistoricalDataApiInterface {
|
|
4
|
+
fetchAllCoinData: () => Promise<Record<string, CoinGeckoCoinData>>;
|
|
5
|
+
fetchHistoricalData: (inputs: {
|
|
6
|
+
coinApiId: string;
|
|
7
|
+
daysAgo: number;
|
|
8
|
+
}) => Promise<CoinHistoricalData>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=historicalDataApiInterface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"historicalDataApiInterface.d.ts","sourceRoot":"","sources":["../../../src/general/historicalData/historicalDataApiInterface.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,MAAM,WAAW,0BAA0B;IAC1C,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IACnE,mBAAmB,EAAE,CAAC,MAAM,EAAE;QAC7B,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KAChB,KAAK,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAClC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HistoricalDataApiInterface } from "./historicalDataApiInterface";
|
|
2
|
+
import { CoinHistoricalData } from "./historicalDataTypes";
|
|
3
|
+
export declare class PlaceholderHistoricalDataApi implements HistoricalDataApiInterface {
|
|
4
|
+
fetchAllCoinData: () => Promise<{}>;
|
|
5
|
+
fetchHistoricalData: (inputs: {
|
|
6
|
+
coinApiId: string;
|
|
7
|
+
daysAgo: number;
|
|
8
|
+
}) => Promise<CoinHistoricalData>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=placeholderHistoricalDataApi.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"placeholderHistoricalDataApi.d.ts","sourceRoot":"","sources":["../../../src/general/historicalData/placeholderHistoricalDataApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,qBAAa,4BACZ,YAAW,0BAA0B;IAE9B,gBAAgB,oBAErB;IAEK,mBAAmB,WAAkB;QAC3C,SAAS,EAAE,MAAM,CAAC;QAClB,OAAO,EAAE,MAAM,CAAC;KAChB,KAAG,QAAQ,kBAAkB,CAAC,CAE7B;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PlaceholderHistoricalDataApi = void 0;
|
|
13
|
+
class PlaceholderHistoricalDataApi {
|
|
14
|
+
constructor() {
|
|
15
|
+
this.fetchAllCoinData = () => __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return {};
|
|
17
|
+
});
|
|
18
|
+
this.fetchHistoricalData = (inputs) => __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
throw new Error("no placeholder historical data");
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.PlaceholderHistoricalDataApi = PlaceholderHistoricalDataApi;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { CoinType } from "../../../types";
|
|
2
|
-
import { AftermathApi } from "../../providers/aftermathApi";
|
|
3
2
|
import { PricesApiInterface } from "../pricesApiInterface";
|
|
4
3
|
export declare class PlaceholderPricesApi implements PricesApiInterface {
|
|
5
4
|
private static readonly constants;
|
|
6
|
-
constructor(
|
|
5
|
+
constructor();
|
|
7
6
|
fetchPrice: (coin: CoinType) => Promise<number>;
|
|
8
7
|
fetchCoinsToPrice: (coins: CoinType[]) => Promise<Record<string, number>>;
|
|
9
8
|
private fetchPrices;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"placeholderPricesApi.d.ts","sourceRoot":"","sources":["../../../../src/general/prices/placeholder/placeholderPricesApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"placeholderPricesApi.d.ts","sourceRoot":"","sources":["../../../../src/general/prices/placeholder/placeholderPricesApi.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAE3D,qBAAa,oBAAqB,YAAW,kBAAkB;IAK9D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAkB/B;;IAgBK,UAAU,SAAgB,QAAQ,qBAEvC;IAEK,iBAAiB,UAAiB,QAAQ,EAAE,qCAajD;IAMF,OAAO,CAAC,WAAW,CAYjB;CACF"}
|
|
@@ -15,7 +15,7 @@ class PlaceholderPricesApi {
|
|
|
15
15
|
/////////////////////////////////////////////////////////////////////
|
|
16
16
|
//// Constructor
|
|
17
17
|
/////////////////////////////////////////////////////////////////////
|
|
18
|
-
constructor(
|
|
18
|
+
constructor() {
|
|
19
19
|
/////////////////////////////////////////////////////////////////////
|
|
20
20
|
//// Fetching
|
|
21
21
|
/////////////////////////////////////////////////////////////////////
|
|
@@ -12,6 +12,7 @@ import { TransactionsApiHelpers } from "../api/transactionsApiHelpers";
|
|
|
12
12
|
import { SuiApi } from "../../packages/sui/api/suiApi";
|
|
13
13
|
import { WalletApi } from "../wallet/walletApi";
|
|
14
14
|
import { RouterApi } from "../../packages/router/api/routerApi";
|
|
15
|
+
import { PlaceholderPricesApi } from "../prices/placeholder/placeholderPricesApi";
|
|
15
16
|
import { CapysApi } from "../../packages/capys/api/capysApi";
|
|
16
17
|
import { StakingApi } from "../../packages/staking/api/stakingApi";
|
|
17
18
|
import { NftAmmApi } from "../../packages/nftAmm/api/nftAmmApi";
|
|
@@ -19,10 +20,11 @@ import { ReferralVaultApi } from "../../packages/referralVault/api/referralVault
|
|
|
19
20
|
import { RouterProtocolName } from "../../types";
|
|
20
21
|
import { HistoricalDataApi } from "../historicalData/historicalDataApi";
|
|
21
22
|
import { CoinGeckoPricesApi } from "../prices/coingecko/coinGeckoPricesApi";
|
|
23
|
+
import { PlaceholderHistoricalDataApi } from "../historicalData/placeholderHistoricalDataApi";
|
|
22
24
|
export declare class AftermathApi {
|
|
23
25
|
readonly provider: JsonRpcProvider;
|
|
24
26
|
readonly addresses: ConfigAddresses;
|
|
25
|
-
private readonly coinGeckoApiKey
|
|
27
|
+
private readonly coinGeckoApiKey?;
|
|
26
28
|
static helpers: {
|
|
27
29
|
dynamicFields: typeof DynamicFieldsApiHelpers;
|
|
28
30
|
events: typeof EventsApiHelpers;
|
|
@@ -34,7 +36,7 @@ export declare class AftermathApi {
|
|
|
34
36
|
coin: typeof CoinApi;
|
|
35
37
|
sui: typeof SuiApi;
|
|
36
38
|
};
|
|
37
|
-
constructor(provider: JsonRpcProvider, addresses: ConfigAddresses, coinGeckoApiKey
|
|
39
|
+
constructor(provider: JsonRpcProvider, addresses: ConfigAddresses, coinGeckoApiKey?: string | undefined);
|
|
38
40
|
DynamicFields: () => DynamicFieldsApiHelpers;
|
|
39
41
|
Events: () => EventsApiHelpers;
|
|
40
42
|
Inspections: () => InspectionsApiHelpers;
|
|
@@ -42,8 +44,8 @@ export declare class AftermathApi {
|
|
|
42
44
|
Transactions: () => TransactionsApiHelpers;
|
|
43
45
|
Rpc: () => RpcApiHelpers;
|
|
44
46
|
Wallet: () => WalletApi;
|
|
45
|
-
Prices: () => CoinGeckoPricesApi;
|
|
46
|
-
HistoricalData: () => HistoricalDataApi;
|
|
47
|
+
Prices: () => PlaceholderPricesApi | CoinGeckoPricesApi;
|
|
48
|
+
HistoricalData: () => HistoricalDataApi | PlaceholderHistoricalDataApi;
|
|
47
49
|
Coin: () => CoinApi;
|
|
48
50
|
Sui: () => SuiApi;
|
|
49
51
|
Pools: () => PoolsApi;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aftermathApi.d.ts","sourceRoot":"","sources":["../../../src/general/providers/aftermathApi.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,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,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAA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AAE,UAAU,EAAE,MAAM,uCAAuC,CAAC;AACnE,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mDAAmD,CAAC;AACrF,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAE9F,qBAAa,YAAY;aAoCP,QAAQ,EAAE,eAAe;aACzB,SAAS,EAAE,eAAe;IAC1C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAC;IAjClC,OAAc,OAAO;;;;;;;;;;MAwBnB;gBAOe,QAAQ,EAAE,eAAe,EACzB,SAAS,EAAE,eAAe,EACzB,eAAe,CAAC,oBAAQ;IAenC,aAAa,gCAA2C;IACxD,MAAM,yBAAoC;IAC1C,WAAW,8BAAyC;IACpD,OAAO,0BAAqC;IAC5C,YAAY,+BAA0C;IACtD,GAAG,sBAAiC;IAMpC,MAAM,kBAA6B;IACnC,MAAM,kDAGkB;IACxB,cAAc,yDAGkB;IAMhC,IAAI,gBAA2B;IAC/B,GAAG,eAA0B;IAM7B,KAAK,iBAA4B;IACjC,MAAM,kBAA6B;IACnC,MAAM,eAAgB,kBAAkB,EAAE,eACjB;IACzB,KAAK,iBAA4B;IACjC,OAAO,mBAA8B;IACrC,MAAM,kBAA6B;IACnC,aAAa,yBAAoC;CACxD"}
|
|
@@ -13,12 +13,14 @@ const transactionsApiHelpers_1 = require("../api/transactionsApiHelpers");
|
|
|
13
13
|
const suiApi_1 = require("../../packages/sui/api/suiApi");
|
|
14
14
|
const walletApi_1 = require("../wallet/walletApi");
|
|
15
15
|
const routerApi_1 = require("../../packages/router/api/routerApi");
|
|
16
|
+
const placeholderPricesApi_1 = require("../prices/placeholder/placeholderPricesApi");
|
|
16
17
|
const capysApi_1 = require("../../packages/capys/api/capysApi");
|
|
17
18
|
const stakingApi_1 = require("../../packages/staking/api/stakingApi");
|
|
18
19
|
const nftAmmApi_1 = require("../../packages/nftAmm/api/nftAmmApi");
|
|
19
20
|
const referralVaultApi_1 = require("../../packages/referralVault/api/referralVaultApi");
|
|
20
21
|
const historicalDataApi_1 = require("../historicalData/historicalDataApi");
|
|
21
22
|
const coinGeckoPricesApi_1 = require("../prices/coingecko/coinGeckoPricesApi");
|
|
23
|
+
const placeholderHistoricalDataApi_1 = require("../historicalData/placeholderHistoricalDataApi");
|
|
22
24
|
class AftermathApi {
|
|
23
25
|
/////////////////////////////////////////////////////////////////////
|
|
24
26
|
//// Constructor
|
|
@@ -43,9 +45,12 @@ class AftermathApi {
|
|
|
43
45
|
//// Utils
|
|
44
46
|
/////////////////////////////////////////////////////////////////////
|
|
45
47
|
this.Wallet = () => new walletApi_1.WalletApi(this);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
this.Prices = () => this.coinGeckoApiKey
|
|
49
|
+
? new coinGeckoPricesApi_1.CoinGeckoPricesApi(this.coinGeckoApiKey)
|
|
50
|
+
: new placeholderPricesApi_1.PlaceholderPricesApi();
|
|
51
|
+
this.HistoricalData = () => this.coinGeckoApiKey
|
|
52
|
+
? new historicalDataApi_1.HistoricalDataApi(this.coinGeckoApiKey)
|
|
53
|
+
: new placeholderHistoricalDataApi_1.PlaceholderHistoricalDataApi();
|
|
49
54
|
/////////////////////////////////////////////////////////////////////
|
|
50
55
|
//// General Packages
|
|
51
56
|
/////////////////////////////////////////////////////////////////////
|