@liberfi.io/types 0.1.26 → 0.1.28
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/README.md +288 -0
- package/dist/index.d.mts +271 -71
- package/dist/index.d.ts +271 -71
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +10 -10
package/dist/index.d.ts
CHANGED
|
@@ -193,37 +193,85 @@ declare enum ChainNamespace {
|
|
|
193
193
|
SOLANA = "SOL"
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
interface
|
|
196
|
+
interface ActivityToken {
|
|
197
|
+
/** token address */
|
|
197
198
|
address: string;
|
|
199
|
+
/** token symbol */
|
|
198
200
|
symbol: string;
|
|
201
|
+
/** token name */
|
|
199
202
|
name?: string;
|
|
203
|
+
/** token avatar image url */
|
|
200
204
|
image?: string;
|
|
205
|
+
/** token amount */
|
|
201
206
|
amount: string;
|
|
207
|
+
/** token amount in USD */
|
|
202
208
|
amountInUsd?: string;
|
|
209
|
+
/** token price in USD at the time of the trade */
|
|
203
210
|
priceInUsd?: string;
|
|
204
211
|
}
|
|
205
|
-
interface
|
|
212
|
+
interface ActivityDex {
|
|
213
|
+
/** dex name */
|
|
206
214
|
name?: string;
|
|
215
|
+
/** dex avatar image url */
|
|
207
216
|
image?: string;
|
|
217
|
+
/** dex protocol family */
|
|
208
218
|
protocolFamily?: string;
|
|
219
|
+
/** dex program address */
|
|
209
220
|
programAddress?: string;
|
|
210
221
|
}
|
|
222
|
+
type ActivityType = "buy" | "sell" | "liquidity_initialize" | "liquidity_add" | "liquidity_remove" | "red_packet_create" | "red_packet_claim" | "red_packet_complete" | "red_packet_refund";
|
|
211
223
|
/**
|
|
212
|
-
*
|
|
224
|
+
* An on-chain activity record (trade, liquidity, red packet, etc.).
|
|
213
225
|
*/
|
|
214
|
-
interface
|
|
226
|
+
interface Activity {
|
|
227
|
+
/** chain id */
|
|
215
228
|
chain: Chain;
|
|
229
|
+
/** wallet address */
|
|
216
230
|
walletAddress: string;
|
|
231
|
+
/** transaction hash */
|
|
217
232
|
txHash: string;
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
233
|
+
/** activity type */
|
|
234
|
+
type: ActivityType;
|
|
235
|
+
/** source token */
|
|
236
|
+
from: ActivityToken;
|
|
237
|
+
/** destination token */
|
|
238
|
+
to: ActivityToken;
|
|
239
|
+
/** dex where the activity happened */
|
|
240
|
+
dex?: ActivityDex;
|
|
241
|
+
/** pool address */
|
|
222
242
|
poolAddress?: string;
|
|
243
|
+
/** activity status */
|
|
223
244
|
status: "pending" | "success" | "failed";
|
|
245
|
+
/** activity time */
|
|
224
246
|
time: Date;
|
|
225
247
|
}
|
|
248
|
+
/**
|
|
249
|
+
* A buy/sell trade record. Narrowed subset of {@link Activity}.
|
|
250
|
+
*/
|
|
251
|
+
interface Trade extends Activity {
|
|
252
|
+
type: "buy" | "sell";
|
|
253
|
+
}
|
|
226
254
|
|
|
255
|
+
declare enum SolanaTokenProtocol {
|
|
256
|
+
BAGS = "bags",
|
|
257
|
+
BELIEVE = "believe",
|
|
258
|
+
BONK = "bonk",
|
|
259
|
+
BOOP = "boop",
|
|
260
|
+
HEAVEN = "heaven",
|
|
261
|
+
JUPSTUDIO = "jupstudio",
|
|
262
|
+
LAUNCHLAB = "launchlab",
|
|
263
|
+
METEORA = "meteora",
|
|
264
|
+
MOONIT = "moonit",
|
|
265
|
+
MOONSHOT = "moonshot",
|
|
266
|
+
ORCA = "orca",
|
|
267
|
+
PUMP = "pump",
|
|
268
|
+
RAYDIUM = "raydium",
|
|
269
|
+
SUGAR = "sugar",
|
|
270
|
+
VIRTUAL_CURVE = "virtual-curve",
|
|
271
|
+
PUMP_AMM = "pump-amm"
|
|
272
|
+
}
|
|
273
|
+
type TokenProtocol = SolanaTokenProtocol | (string & {});
|
|
274
|
+
declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
|
|
227
275
|
interface Token {
|
|
228
276
|
/**
|
|
229
277
|
* chain id.
|
|
@@ -298,10 +346,6 @@ interface Token {
|
|
|
298
346
|
*/
|
|
299
347
|
createdAt?: Date;
|
|
300
348
|
}
|
|
301
|
-
interface TokenHistoryPriceObject {
|
|
302
|
-
time: string;
|
|
303
|
-
value: number;
|
|
304
|
-
}
|
|
305
349
|
interface TokenCreator {
|
|
306
350
|
/**
|
|
307
351
|
* token creator's wallet address.
|
|
@@ -596,15 +640,15 @@ interface TokenMarketData {
|
|
|
596
640
|
*/
|
|
597
641
|
sniperHoldingsRatio?: string;
|
|
598
642
|
/**
|
|
599
|
-
*
|
|
643
|
+
* Pro holders count
|
|
600
644
|
*/
|
|
601
645
|
proHolders?: number;
|
|
602
646
|
/**
|
|
603
|
-
*
|
|
647
|
+
* Pro total holdings
|
|
604
648
|
*/
|
|
605
649
|
proHoldings?: string;
|
|
606
650
|
/**
|
|
607
|
-
*
|
|
651
|
+
* Pro holdings ratio
|
|
608
652
|
*/
|
|
609
653
|
proHoldingsRatio?: string;
|
|
610
654
|
/**
|
|
@@ -777,124 +821,195 @@ interface TokenHolder {
|
|
|
777
821
|
ratio: string;
|
|
778
822
|
}
|
|
779
823
|
|
|
824
|
+
/**
|
|
825
|
+
* Shared cursor-based pagination fields.
|
|
826
|
+
*/
|
|
827
|
+
interface CursorPagination {
|
|
828
|
+
/** pagination start cursor */
|
|
829
|
+
startCursor?: string;
|
|
830
|
+
/** pagination end cursor */
|
|
831
|
+
endCursor?: string;
|
|
832
|
+
/** whether there is a previous page */
|
|
833
|
+
hasPrev?: boolean;
|
|
834
|
+
/** whether there is a next page */
|
|
835
|
+
hasNext?: boolean;
|
|
836
|
+
}
|
|
837
|
+
|
|
780
838
|
/**
|
|
781
839
|
* Portfolio PNL
|
|
782
840
|
*/
|
|
783
841
|
interface PortfolioPnl {
|
|
842
|
+
/** chain id */
|
|
784
843
|
chain: Chain;
|
|
844
|
+
/** token address */
|
|
785
845
|
address: string;
|
|
846
|
+
/** token name */
|
|
786
847
|
name: string;
|
|
848
|
+
/** token symbol */
|
|
787
849
|
symbol: string;
|
|
850
|
+
/** token image url */
|
|
788
851
|
image?: string;
|
|
852
|
+
/** holding token amount */
|
|
789
853
|
amount: string;
|
|
854
|
+
/** holding token amount in usd */
|
|
790
855
|
amountInUsd: string;
|
|
856
|
+
/** token current price in usd */
|
|
791
857
|
priceInUsd: string;
|
|
858
|
+
/** token decimals */
|
|
792
859
|
decimals: number;
|
|
860
|
+
/** open position time */
|
|
793
861
|
openTime?: Date;
|
|
862
|
+
/** close position time */
|
|
794
863
|
closeTime?: Date;
|
|
864
|
+
/** total trades count */
|
|
795
865
|
totalTrades?: number;
|
|
866
|
+
/** total buy txs count */
|
|
796
867
|
buys?: number;
|
|
868
|
+
/** total buy volumes */
|
|
797
869
|
buyVolumes?: string;
|
|
870
|
+
/** total buy volumes in usd */
|
|
798
871
|
buyVolumesInUsd?: string;
|
|
872
|
+
/** average buy price in usd */
|
|
799
873
|
buyAvgPriceInUsd?: string;
|
|
874
|
+
/** total sell txs count */
|
|
800
875
|
sells?: number;
|
|
876
|
+
/** total sell volumes */
|
|
801
877
|
sellVolumes?: string;
|
|
878
|
+
/** total sell volumes in usd */
|
|
802
879
|
sellVolumesInUsd?: string;
|
|
880
|
+
/** average sell price in usd */
|
|
803
881
|
sellAvgPriceInUsd?: string;
|
|
882
|
+
/** realized profit in usd */
|
|
804
883
|
realizedProfitInUsd?: string;
|
|
884
|
+
/** realized profit ratio */
|
|
805
885
|
realizedProfitRatio?: string;
|
|
886
|
+
/** unrealized profit in usd */
|
|
806
887
|
unrealizedProfitInUsd?: string;
|
|
888
|
+
/** unrealized profit ratio */
|
|
807
889
|
unrealizedProfitRatio?: string;
|
|
890
|
+
/** total profit in usd (including both realized and unrealized profit) */
|
|
808
891
|
totalProfitInUsd?: string;
|
|
892
|
+
/** total profit ratio (including both realized and unrealized profit) */
|
|
809
893
|
totalProfitRatio?: string;
|
|
894
|
+
/** average profit per trade in usd */
|
|
810
895
|
avgProfitPerTradeInUsd?: string;
|
|
811
896
|
}
|
|
812
897
|
interface Portfolio {
|
|
898
|
+
/** chain id */
|
|
813
899
|
chain: Chain;
|
|
900
|
+
/** token address */
|
|
814
901
|
address: string;
|
|
902
|
+
/** token name */
|
|
815
903
|
name: string;
|
|
904
|
+
/** token symbol */
|
|
816
905
|
symbol: string;
|
|
906
|
+
/** token image url */
|
|
817
907
|
image?: string;
|
|
908
|
+
/** token current price in usd */
|
|
818
909
|
priceInUsd: string;
|
|
910
|
+
/** token current price in native token */
|
|
819
911
|
priceInNative: string;
|
|
912
|
+
/** holding token amount */
|
|
820
913
|
amount: string;
|
|
914
|
+
/** holding token amount in usd */
|
|
821
915
|
amountInUsd: string;
|
|
916
|
+
/** holding token amount in native token */
|
|
822
917
|
amountInNative: string;
|
|
918
|
+
/** token decimals */
|
|
823
919
|
decimals: number;
|
|
824
920
|
}
|
|
825
921
|
/**
|
|
826
922
|
* Wallet PnL summary
|
|
827
923
|
*/
|
|
828
924
|
interface WalletPnl {
|
|
925
|
+
/** chain id */
|
|
829
926
|
chain: Chain;
|
|
927
|
+
/** wallet address */
|
|
830
928
|
address: string;
|
|
929
|
+
/** total tokens traded */
|
|
831
930
|
tokens?: number;
|
|
931
|
+
/** total buy txs count */
|
|
832
932
|
buys?: number;
|
|
933
|
+
/** total sell txs count */
|
|
833
934
|
sells?: number;
|
|
935
|
+
/** total trades count */
|
|
834
936
|
totalTrades?: number;
|
|
937
|
+
/** total winning trades */
|
|
835
938
|
wins?: number;
|
|
939
|
+
/** total losing trades */
|
|
836
940
|
losses?: number;
|
|
941
|
+
/** win rate, range is 0-1 */
|
|
837
942
|
winRate?: string;
|
|
943
|
+
/** total buy amount in usd */
|
|
838
944
|
buyAmountInUsd?: string;
|
|
945
|
+
/** total sell amount in usd */
|
|
839
946
|
sellAmountInUsd?: string;
|
|
947
|
+
/** total cost in usd */
|
|
840
948
|
totalCostInUsd?: string;
|
|
949
|
+
/** realized profit in usd */
|
|
841
950
|
realizedProfitInUsd?: string;
|
|
951
|
+
/** realized profit ratio */
|
|
842
952
|
realizedProfitRatio?: string;
|
|
953
|
+
/** unrealized profit in usd */
|
|
843
954
|
unrealizedProfitInUsd?: string;
|
|
955
|
+
/** unrealized profit ratio */
|
|
844
956
|
unrealizedProfitRatio?: string;
|
|
957
|
+
/** total profit in usd (including both realized and unrealized profit) */
|
|
845
958
|
totalProfitInUsd?: string;
|
|
959
|
+
/** total profit ratio */
|
|
846
960
|
totalProfitRatio?: string;
|
|
961
|
+
/** average profit per trade in usd */
|
|
847
962
|
avgProfitPerTradeInUsd?: string;
|
|
848
963
|
}
|
|
849
964
|
/**
|
|
850
965
|
* Wallet portfolio PnL details (paged, with summary)
|
|
851
966
|
*/
|
|
852
|
-
interface WalletPortfolioPnls extends WalletPnl {
|
|
967
|
+
interface WalletPortfolioPnls extends WalletPnl, CursorPagination {
|
|
968
|
+
/** per-token portfolio + pnl details */
|
|
853
969
|
portfolios: Array<PortfolioPnl>;
|
|
854
|
-
startCursor?: string;
|
|
855
|
-
endCursor?: string;
|
|
856
|
-
hasPrev?: boolean;
|
|
857
|
-
hasNext?: boolean;
|
|
858
970
|
}
|
|
859
971
|
/**
|
|
860
972
|
* Wallet portfolios
|
|
861
973
|
*/
|
|
862
|
-
interface WalletPortfolios {
|
|
974
|
+
interface WalletPortfolios extends CursorPagination {
|
|
975
|
+
/** chain id */
|
|
863
976
|
chain: Chain;
|
|
977
|
+
/** wallet address */
|
|
864
978
|
address: string;
|
|
979
|
+
/** wallet total balance in usd */
|
|
865
980
|
balanceInUsd: string;
|
|
981
|
+
/** wallet total balance in native token */
|
|
866
982
|
balanceInNative: string;
|
|
983
|
+
/** wallet portfolios */
|
|
867
984
|
portfolios: Array<Portfolio>;
|
|
868
|
-
startCursor?: string;
|
|
869
|
-
endCursor?: string;
|
|
870
|
-
hasPrev?: boolean;
|
|
871
|
-
hasNext?: boolean;
|
|
872
985
|
}
|
|
873
986
|
|
|
874
987
|
/**
|
|
875
988
|
* Cursor list result data
|
|
876
989
|
*/
|
|
877
|
-
interface CursorList<T> {
|
|
878
|
-
startCursor?: string;
|
|
879
|
-
endCursor?: string;
|
|
880
|
-
hasPrev?: boolean;
|
|
881
|
-
hasNext?: boolean;
|
|
990
|
+
interface CursorList<T> extends CursorPagination {
|
|
882
991
|
data: Array<T>;
|
|
883
992
|
}
|
|
884
993
|
/**
|
|
885
994
|
* Cursor list query options
|
|
886
995
|
*/
|
|
887
996
|
interface CursorListOptions {
|
|
997
|
+
/** query cursor */
|
|
888
998
|
cursor?: string;
|
|
999
|
+
/** return limit */
|
|
889
1000
|
limit?: number;
|
|
1001
|
+
/** query direction */
|
|
890
1002
|
direction?: "next" | "prev";
|
|
891
1003
|
}
|
|
892
1004
|
/**
|
|
893
1005
|
* Options for getting token candles
|
|
894
1006
|
*/
|
|
895
1007
|
interface GetTokenCandlesOptions {
|
|
1008
|
+
/** query candles after this timestamp */
|
|
896
1009
|
after?: Date;
|
|
1010
|
+
/** query candles before this timestamp */
|
|
897
1011
|
before?: Date;
|
|
1012
|
+
/** return limit */
|
|
898
1013
|
limit?: number;
|
|
899
1014
|
}
|
|
900
1015
|
/**
|
|
@@ -913,80 +1028,145 @@ interface TokenFilterOption {
|
|
|
913
1028
|
* Options for getting token list
|
|
914
1029
|
*/
|
|
915
1030
|
interface GetTokenListOptions {
|
|
1031
|
+
/** sort field */
|
|
916
1032
|
sortBy?: TokenFieldOption;
|
|
1033
|
+
/** sort direction */
|
|
917
1034
|
sortDirection?: "asc" | "desc";
|
|
1035
|
+
/** filters */
|
|
918
1036
|
filters?: Array<TokenFilterOption>;
|
|
1037
|
+
/** search keywords */
|
|
919
1038
|
keywords?: Array<string>;
|
|
1039
|
+
/** exclude keywords */
|
|
920
1040
|
excludeKeywords?: Array<string>;
|
|
921
1041
|
}
|
|
922
1042
|
/**
|
|
923
1043
|
* Options for searching tokens
|
|
924
1044
|
*/
|
|
925
1045
|
interface SearchTokensOptions extends CursorListOptions {
|
|
1046
|
+
/** chains */
|
|
926
1047
|
chains?: Array<Chain>;
|
|
1048
|
+
/** search keyword */
|
|
927
1049
|
keyword?: string;
|
|
1050
|
+
/** filters */
|
|
928
1051
|
filters?: Array<TokenFilterOption>;
|
|
1052
|
+
/** sort field */
|
|
929
1053
|
sortBy?: TokenFieldOption;
|
|
1054
|
+
/** sort direction */
|
|
930
1055
|
sortDirection?: "asc" | "desc";
|
|
931
1056
|
}
|
|
932
1057
|
/**
|
|
933
1058
|
* Search token cursor list
|
|
934
1059
|
*/
|
|
935
1060
|
interface SearchTokenCursorList extends CursorList<Token> {
|
|
1061
|
+
/** total count */
|
|
936
1062
|
total?: number;
|
|
937
|
-
extra
|
|
1063
|
+
/** extra infos by api provider */
|
|
1064
|
+
extra?: Record<string, unknown>;
|
|
938
1065
|
}
|
|
939
1066
|
declare enum SwapMode {
|
|
940
|
-
EXACT_IN = "
|
|
941
|
-
EXACT_OUT = "
|
|
1067
|
+
EXACT_IN = "exact_in",
|
|
1068
|
+
EXACT_OUT = "exact_out"
|
|
942
1069
|
}
|
|
943
1070
|
interface SwapParams {
|
|
1071
|
+
/** chain id */
|
|
944
1072
|
chain: Chain;
|
|
1073
|
+
/** user wallet address */
|
|
945
1074
|
userAddress: string;
|
|
1075
|
+
/** input token address */
|
|
946
1076
|
input: string;
|
|
1077
|
+
/** output token address */
|
|
947
1078
|
output: string;
|
|
1079
|
+
/** swap mode, e.g. ExactIn, ExactOut */
|
|
948
1080
|
mode: SwapMode;
|
|
1081
|
+
/** input token amount when mode is ExactIn, output token amount when mode is ExactOut */
|
|
949
1082
|
amount: string;
|
|
1083
|
+
/** slippage, range is 0-100 */
|
|
950
1084
|
slippage?: number;
|
|
1085
|
+
/** priority fee */
|
|
951
1086
|
priorityFee?: string;
|
|
1087
|
+
/** tip fee */
|
|
952
1088
|
tipFee?: string;
|
|
1089
|
+
/** whether to use anti-MEV */
|
|
953
1090
|
isAntiMev?: boolean;
|
|
954
1091
|
}
|
|
955
1092
|
interface SwapRoutePlan {
|
|
1093
|
+
/** protocol name / dex name etc. */
|
|
956
1094
|
name: string;
|
|
1095
|
+
/** input token address */
|
|
957
1096
|
input: string;
|
|
1097
|
+
/** input token amount */
|
|
958
1098
|
inputAmount: string;
|
|
1099
|
+
/** output token address */
|
|
959
1100
|
output: string;
|
|
1101
|
+
/** output token amount */
|
|
960
1102
|
outputAmount: string;
|
|
1103
|
+
/** fee quote token address */
|
|
961
1104
|
feeQuote?: string;
|
|
1105
|
+
/** fee amount */
|
|
962
1106
|
feeAmount?: string;
|
|
963
|
-
extra
|
|
1107
|
+
/** extra infos by api provider */
|
|
1108
|
+
extra?: Record<string, unknown>;
|
|
964
1109
|
}
|
|
965
1110
|
interface SwapRoute {
|
|
1111
|
+
/** unsigned tx in base64 format */
|
|
966
1112
|
serializedTx: string;
|
|
1113
|
+
/** swap plans */
|
|
967
1114
|
plans: Array<SwapRoutePlan>;
|
|
968
|
-
extra
|
|
1115
|
+
/** extra infos by api provider */
|
|
1116
|
+
extra?: Record<string, unknown>;
|
|
969
1117
|
}
|
|
970
1118
|
interface SendTxParams {
|
|
1119
|
+
/** chain id */
|
|
971
1120
|
chain: Chain;
|
|
1121
|
+
/** signed tx in base64 format */
|
|
972
1122
|
serializedTx: string;
|
|
973
|
-
extra
|
|
1123
|
+
/** extra infos needed by api provider */
|
|
1124
|
+
extra?: Record<string, unknown>;
|
|
974
1125
|
}
|
|
975
1126
|
interface SendTxResult {
|
|
1127
|
+
/** tx hash */
|
|
976
1128
|
txHash: string;
|
|
977
|
-
extra
|
|
1129
|
+
/** extra infos by api provider */
|
|
1130
|
+
extra?: Record<string, unknown>;
|
|
978
1131
|
}
|
|
979
1132
|
/**
|
|
980
|
-
* Options for getting
|
|
1133
|
+
* Options for getting trades
|
|
981
1134
|
*/
|
|
982
|
-
interface
|
|
1135
|
+
interface GetTradesOptions extends CursorListOptions {
|
|
1136
|
+
/** filter trades before this timestamp */
|
|
983
1137
|
before?: Date;
|
|
1138
|
+
/** filter trades after this timestamp */
|
|
984
1139
|
after?: Date;
|
|
1140
|
+
/** filter trades before this block height */
|
|
985
1141
|
beforeBlockHeight?: number;
|
|
1142
|
+
/** filter trades after this block height */
|
|
986
1143
|
afterBlockHeight?: number;
|
|
1144
|
+
/** filter trades by type */
|
|
987
1145
|
type?: "buy" | "sell";
|
|
1146
|
+
/** filter trades by pool address */
|
|
988
1147
|
poolAddress?: string;
|
|
989
1148
|
}
|
|
1149
|
+
/**
|
|
1150
|
+
* Options for getting activities
|
|
1151
|
+
*/
|
|
1152
|
+
interface GetActivitiesOptions extends CursorListOptions {
|
|
1153
|
+
/** filter activities before this timestamp */
|
|
1154
|
+
before?: Date;
|
|
1155
|
+
/** filter activities after this timestamp */
|
|
1156
|
+
after?: Date;
|
|
1157
|
+
/** filter activities before this block height */
|
|
1158
|
+
beforeBlockHeight?: number;
|
|
1159
|
+
/** filter activities after this block height */
|
|
1160
|
+
afterBlockHeight?: number;
|
|
1161
|
+
/** filter activities by type */
|
|
1162
|
+
type?: ActivityType;
|
|
1163
|
+
/** filter activities by pool address */
|
|
1164
|
+
poolAddress?: string;
|
|
1165
|
+
}
|
|
1166
|
+
/**
|
|
1167
|
+
* Resolution subset supported by the trending token list.
|
|
1168
|
+
*/
|
|
1169
|
+
type TrendingResolution = Extract<TokenResolution, "1m" | "5m" | "1h" | "4h" | "24h">;
|
|
990
1170
|
/**
|
|
991
1171
|
* API client interface
|
|
992
1172
|
*/
|
|
@@ -1071,7 +1251,7 @@ interface IClient {
|
|
|
1071
1251
|
* @param options optional query options
|
|
1072
1252
|
* @returns `Trending` token list
|
|
1073
1253
|
*/
|
|
1074
|
-
getTrendingTokens(chain: Chain, resolution:
|
|
1254
|
+
getTrendingTokens(chain: Chain, resolution: TrendingResolution, options?: GetTokenListOptions): Promise<Array<Token>>;
|
|
1075
1255
|
/**
|
|
1076
1256
|
* fetch `Stock` token list
|
|
1077
1257
|
* @param chain chain id
|
|
@@ -1158,7 +1338,7 @@ interface IClient {
|
|
|
1158
1338
|
* @param options optional query options
|
|
1159
1339
|
* @returns wallet's trade activities
|
|
1160
1340
|
*/
|
|
1161
|
-
|
|
1341
|
+
getWalletTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
|
|
1162
1342
|
/**
|
|
1163
1343
|
* fetch token's trade activities
|
|
1164
1344
|
* @param chain chain id
|
|
@@ -1166,7 +1346,23 @@ interface IClient {
|
|
|
1166
1346
|
* @param options optional query options
|
|
1167
1347
|
* @returns token's trade activities
|
|
1168
1348
|
*/
|
|
1169
|
-
|
|
1349
|
+
getTokenTrades(chain: Chain, address: string, options?: GetTradesOptions): Promise<CursorList<Trade>>;
|
|
1350
|
+
/**
|
|
1351
|
+
* fetch wallet's activities (trades, liquidity, red packets, etc.)
|
|
1352
|
+
* @param chain chain id
|
|
1353
|
+
* @param address wallet address
|
|
1354
|
+
* @param options optional query options
|
|
1355
|
+
* @returns wallet's activities
|
|
1356
|
+
*/
|
|
1357
|
+
getWalletActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
|
|
1358
|
+
/**
|
|
1359
|
+
* fetch token's activities (trades, liquidity, red packets, etc.)
|
|
1360
|
+
* @param chain chain id
|
|
1361
|
+
* @param address token address
|
|
1362
|
+
* @param options optional query options
|
|
1363
|
+
* @returns token's activities
|
|
1364
|
+
*/
|
|
1365
|
+
getTokenActivities(chain: Chain, address: string, options?: GetActivitiesOptions): Promise<CursorList<Activity>>;
|
|
1170
1366
|
/**
|
|
1171
1367
|
* get presigned upload url
|
|
1172
1368
|
* @returns presigned upload url
|
|
@@ -1183,17 +1379,25 @@ interface ISubscription {
|
|
|
1183
1379
|
*/
|
|
1184
1380
|
type TokenSubscribed = Partial<Omit<Token, "chain" | "address">> & Pick<Token, "chain" | "address">;
|
|
1185
1381
|
interface WalletPnlSubscribed extends WalletPnl {
|
|
1382
|
+
/** pnl resolution (e.g. "7d", "30d") */
|
|
1186
1383
|
resolution?: string;
|
|
1187
1384
|
}
|
|
1188
1385
|
interface PortfolioSubscribed {
|
|
1386
|
+
/** chain id */
|
|
1189
1387
|
chain: Chain;
|
|
1388
|
+
/** wallet address */
|
|
1190
1389
|
walletAddress: string;
|
|
1390
|
+
/** token address */
|
|
1191
1391
|
tokenAddress: string;
|
|
1392
|
+
/** token current price in usd */
|
|
1192
1393
|
priceInUsd?: string;
|
|
1394
|
+
/** holding token amount */
|
|
1193
1395
|
amount?: string;
|
|
1194
1396
|
}
|
|
1195
1397
|
type PortfolioPnlSubscribed = Partial<Omit<PortfolioPnl, "address" | "name" | "symbol" | "image">> & {
|
|
1398
|
+
/** wallet address */
|
|
1196
1399
|
walletAddress: string;
|
|
1400
|
+
/** token address */
|
|
1197
1401
|
tokenAddress: string;
|
|
1198
1402
|
};
|
|
1199
1403
|
/**
|
|
@@ -1250,7 +1454,7 @@ interface ISubscribeClient {
|
|
|
1250
1454
|
* @param callback callback function
|
|
1251
1455
|
* @returns subscription
|
|
1252
1456
|
*/
|
|
1253
|
-
|
|
1457
|
+
subscribeWalletTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
|
|
1254
1458
|
/**
|
|
1255
1459
|
* Subscribe token's new trade activities
|
|
1256
1460
|
* @param chain chain id
|
|
@@ -1258,7 +1462,23 @@ interface ISubscribeClient {
|
|
|
1258
1462
|
* @param callback callback function
|
|
1259
1463
|
* @returns subscription
|
|
1260
1464
|
*/
|
|
1261
|
-
|
|
1465
|
+
subscribeTokenTrades(chain: Chain, address: string, callback: (trades: Array<Trade>) => void): ISubscription;
|
|
1466
|
+
/**
|
|
1467
|
+
* Subscribe wallet's new activities (trades, liquidity, etc.)
|
|
1468
|
+
* @param chain chain id
|
|
1469
|
+
* @param address wallet address
|
|
1470
|
+
* @param callback callback function
|
|
1471
|
+
* @returns subscription
|
|
1472
|
+
*/
|
|
1473
|
+
subscribeWalletActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
|
|
1474
|
+
/**
|
|
1475
|
+
* Subscribe token's new activities (trades, liquidity, etc.)
|
|
1476
|
+
* @param chain chain id
|
|
1477
|
+
* @param address token address
|
|
1478
|
+
* @param callback callback function
|
|
1479
|
+
* @returns subscription
|
|
1480
|
+
*/
|
|
1481
|
+
subscribeTokenActivities(chain: Chain, address: string, callback: (activities: Array<Activity>) => void): ISubscription;
|
|
1262
1482
|
/**
|
|
1263
1483
|
* Subscribe to `New` token list real-time updates. The client internally
|
|
1264
1484
|
* manages multiple backend channels (new token events, metadata, stats,
|
|
@@ -1309,9 +1529,11 @@ interface ISubscribeClient {
|
|
|
1309
1529
|
|
|
1310
1530
|
type index_CursorList<T> = CursorList<T>;
|
|
1311
1531
|
type index_CursorListOptions = CursorListOptions;
|
|
1532
|
+
type index_CursorPagination = CursorPagination;
|
|
1533
|
+
type index_GetActivitiesOptions = GetActivitiesOptions;
|
|
1312
1534
|
type index_GetTokenCandlesOptions = GetTokenCandlesOptions;
|
|
1313
1535
|
type index_GetTokenListOptions = GetTokenListOptions;
|
|
1314
|
-
type
|
|
1536
|
+
type index_GetTradesOptions = GetTradesOptions;
|
|
1315
1537
|
type index_IClient = IClient;
|
|
1316
1538
|
type index_ISubscribeClient = ISubscribeClient;
|
|
1317
1539
|
type index_ISubscription = ISubscription;
|
|
@@ -1329,9 +1551,10 @@ type index_SwapRoutePlan = SwapRoutePlan;
|
|
|
1329
1551
|
type index_TokenFieldOption = TokenFieldOption;
|
|
1330
1552
|
type index_TokenFilterOption = TokenFilterOption;
|
|
1331
1553
|
type index_TokenSubscribed = TokenSubscribed;
|
|
1554
|
+
type index_TrendingResolution = TrendingResolution;
|
|
1332
1555
|
type index_WalletPnlSubscribed = WalletPnlSubscribed;
|
|
1333
1556
|
declare namespace index {
|
|
1334
|
-
export { type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type
|
|
1557
|
+
export { type index_CursorList as CursorList, type index_CursorListOptions as CursorListOptions, type index_CursorPagination as CursorPagination, type index_GetActivitiesOptions as GetActivitiesOptions, type index_GetTokenCandlesOptions as GetTokenCandlesOptions, type index_GetTokenListOptions as GetTokenListOptions, type index_GetTradesOptions as GetTradesOptions, type index_IClient as IClient, type index_ISubscribeClient as ISubscribeClient, type index_ISubscription as ISubscription, type index_PortfolioPnlSubscribed as PortfolioPnlSubscribed, type index_PortfolioSubscribed as PortfolioSubscribed, type index_SearchTokenCursorList as SearchTokenCursorList, type index_SearchTokensOptions as SearchTokensOptions, type index_SendTxParams as SendTxParams, type index_SendTxResult as SendTxResult, index_SwapMode as SwapMode, type index_SwapParams as SwapParams, type index_SwapRoute as SwapRoute, type index_SwapRoutePlan as SwapRoutePlan, type index_TokenFieldOption as TokenFieldOption, type index_TokenFilterOption as TokenFilterOption, type index_TokenSubscribed as TokenSubscribed, type index_TrendingResolution as TrendingResolution, type index_WalletPnlSubscribed as WalletPnlSubscribed };
|
|
1335
1558
|
}
|
|
1336
1559
|
|
|
1337
1560
|
declare global {
|
|
@@ -1341,29 +1564,6 @@ declare global {
|
|
|
1341
1564
|
};
|
|
1342
1565
|
}
|
|
1343
1566
|
}
|
|
1344
|
-
declare const _default: "0.1.
|
|
1345
|
-
|
|
1346
|
-
type NetworkId = "testnet" | "mainnet";
|
|
1347
|
-
|
|
1348
|
-
declare enum SolanaTokenProtocol {
|
|
1349
|
-
BAGS = "bags",
|
|
1350
|
-
BELIEVE = "believe",
|
|
1351
|
-
BONK = "bonk",
|
|
1352
|
-
BOOP = "boop",
|
|
1353
|
-
HEAVEN = "heaven",
|
|
1354
|
-
JUPSTUDIO = "jupstudio",
|
|
1355
|
-
LAUNCHLAB = "launchlab",
|
|
1356
|
-
METEORA = "meteora",
|
|
1357
|
-
MOONIT = "moonit",
|
|
1358
|
-
MOONSHOT = "moonshot",
|
|
1359
|
-
ORCA = "orca",
|
|
1360
|
-
PUMP = "pump",
|
|
1361
|
-
RAYDIUM = "raydium",
|
|
1362
|
-
SUGAR = "sugar",
|
|
1363
|
-
VIRTUAL_CURVE = "virtual-curve",
|
|
1364
|
-
PUMP_AMM = "pump-amm"
|
|
1365
|
-
}
|
|
1366
|
-
type TokenProtocol = keyof typeof SolanaTokenProtocol | (string & {});
|
|
1367
|
-
declare const SOLANA_TOKEN_PROTOCOLS: SolanaTokenProtocol[];
|
|
1567
|
+
declare const _default: "0.1.28";
|
|
1368
1568
|
|
|
1369
|
-
export { index as API, Chain, ChainNamespace, type CursorList, type CursorListOptions, type GetTokenCandlesOptions, type GetTokenListOptions, type
|
|
1569
|
+
export { index as API, type Activity, type ActivityDex, type ActivityToken, type ActivityType, Chain, ChainNamespace, type CursorList, type CursorListOptions, type CursorPagination, type GetActivitiesOptions, type GetTokenCandlesOptions, type GetTokenListOptions, type GetTradesOptions, type IClient, type ISubscribeClient, type ISubscription, type Portfolio, type PortfolioPnl, type PortfolioPnlSubscribed, type PortfolioSubscribed, SOLANA_TOKEN_PROTOCOLS, type SearchTokenCursorList, type SearchTokensOptions, type SendTxParams, type SendTxResult, SolanaTokenProtocol, SwapMode, type SwapParams, type SwapRoute, type SwapRoutePlan, type Token, type TokenCandle, type TokenCreator, type TokenFieldOption, type TokenFilterOption, type TokenHolder, type TokenLaunchedFrom, type TokenLiquidity, type TokenMarketData, type TokenMigratedTo, type TokenProtocol, type TokenResolution, type TokenSecurity, type TokenSocialMedias, type TokenStats, type TokenStatsByResolution, type TokenSubscribed, type Trade, type TrendingResolution, type WalletPnl, type WalletPnlSubscribed, type WalletPortfolioPnls, type WalletPortfolios, _default as version };
|
package/dist/index.js
CHANGED
|
@@ -38,17 +38,17 @@ __export(api_exports, {
|
|
|
38
38
|
|
|
39
39
|
// src/api/dex.ts
|
|
40
40
|
var SwapMode = /* @__PURE__ */ ((SwapMode2) => {
|
|
41
|
-
SwapMode2["EXACT_IN"] = "
|
|
42
|
-
SwapMode2["EXACT_OUT"] = "
|
|
41
|
+
SwapMode2["EXACT_IN"] = "exact_in";
|
|
42
|
+
SwapMode2["EXACT_OUT"] = "exact_out";
|
|
43
43
|
return SwapMode2;
|
|
44
44
|
})(SwapMode || {});
|
|
45
45
|
|
|
46
46
|
// src/version.ts
|
|
47
47
|
if (typeof window !== "undefined") {
|
|
48
48
|
window.__LIBERFI_VERSION__ = window.__LIBERFI_VERSION__ || {};
|
|
49
|
-
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.1.
|
|
49
|
+
window.__LIBERFI_VERSION__["@liberfi.io/types"] = "0.1.28";
|
|
50
50
|
}
|
|
51
|
-
var version_default = "0.1.
|
|
51
|
+
var version_default = "0.1.28";
|
|
52
52
|
|
|
53
53
|
// src/chains.ts
|
|
54
54
|
var Chain = /* @__PURE__ */ ((Chain2) => {
|
|
@@ -248,7 +248,7 @@ var ChainNamespace = /* @__PURE__ */ ((ChainNamespace2) => {
|
|
|
248
248
|
return ChainNamespace2;
|
|
249
249
|
})(ChainNamespace || {});
|
|
250
250
|
|
|
251
|
-
// src/
|
|
251
|
+
// src/token.ts
|
|
252
252
|
var SolanaTokenProtocol = /* @__PURE__ */ ((SolanaTokenProtocol2) => {
|
|
253
253
|
SolanaTokenProtocol2["BAGS"] = "bags";
|
|
254
254
|
SolanaTokenProtocol2["BELIEVE"] = "believe";
|