@iotexproject/kit 0.1.36 → 0.1.38
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/index.d.ts +116 -0
- package/dist/index.js +1 -1
- package/package.json +5 -1
package/dist/index.d.ts
CHANGED
|
@@ -8855,6 +8855,108 @@ declare class PointsPlatform {
|
|
|
8855
8855
|
data?: undefined;
|
|
8856
8856
|
}>;
|
|
8857
8857
|
}
|
|
8858
|
+
export type LaunchPadParam = {
|
|
8859
|
+
recipient: `0x${string}`;
|
|
8860
|
+
name: string;
|
|
8861
|
+
symbol: string;
|
|
8862
|
+
initialBuyAmount: string;
|
|
8863
|
+
};
|
|
8864
|
+
export type CreateProjectParams = {
|
|
8865
|
+
recipient: `0x${string}`;
|
|
8866
|
+
projectName: string;
|
|
8867
|
+
tokenAddress: string;
|
|
8868
|
+
owner: string;
|
|
8869
|
+
image?: string;
|
|
8870
|
+
description?: string;
|
|
8871
|
+
twitter?: string;
|
|
8872
|
+
telegram?: string;
|
|
8873
|
+
website?: string;
|
|
8874
|
+
};
|
|
8875
|
+
export type SwapParams = {
|
|
8876
|
+
amount: string;
|
|
8877
|
+
slippage?: {
|
|
8878
|
+
denominator?: number;
|
|
8879
|
+
numerator?: number;
|
|
8880
|
+
};
|
|
8881
|
+
recipient: `0x${string}`;
|
|
8882
|
+
token: `0x${string}`;
|
|
8883
|
+
tradeType: "BUY" | "SELL";
|
|
8884
|
+
};
|
|
8885
|
+
declare class BondingCurve {
|
|
8886
|
+
db: ReturnType<typeof postgres>;
|
|
8887
|
+
constructor();
|
|
8888
|
+
launchToken(args: LaunchPadParam, ctx?: ConfigContext): Promise<{
|
|
8889
|
+
address: `0x${string}`;
|
|
8890
|
+
data: any;
|
|
8891
|
+
chainId: string;
|
|
8892
|
+
value: string;
|
|
8893
|
+
error?: undefined;
|
|
8894
|
+
} | {
|
|
8895
|
+
error: unknown;
|
|
8896
|
+
address?: undefined;
|
|
8897
|
+
data?: undefined;
|
|
8898
|
+
chainId?: undefined;
|
|
8899
|
+
value?: undefined;
|
|
8900
|
+
}>;
|
|
8901
|
+
upsertProject(args: CreateProjectParams, ctx?: ConfigContext): Promise<{
|
|
8902
|
+
ok: boolean;
|
|
8903
|
+
error?: undefined;
|
|
8904
|
+
} | {
|
|
8905
|
+
error: unknown;
|
|
8906
|
+
ok?: undefined;
|
|
8907
|
+
}>;
|
|
8908
|
+
projectList(args: {}, ctx?: ConfigContext): Promise<postgres.RowList<postgres.Row[]>>;
|
|
8909
|
+
tokenList(args: {
|
|
8910
|
+
account: `0x${string}`;
|
|
8911
|
+
}, ctx?: ConfigContext): Promise<{
|
|
8912
|
+
address: `0x${string}`;
|
|
8913
|
+
chainId: string;
|
|
8914
|
+
isEther: boolean;
|
|
8915
|
+
type: () => Promise<string>;
|
|
8916
|
+
totalSupply: number;
|
|
8917
|
+
name: string;
|
|
8918
|
+
symbol: string;
|
|
8919
|
+
decimals: () => Promise<number | undefined>;
|
|
8920
|
+
balanceOf: {
|
|
8921
|
+
value: string;
|
|
8922
|
+
format: string;
|
|
8923
|
+
originFormat: string;
|
|
8924
|
+
decimals: string;
|
|
8925
|
+
};
|
|
8926
|
+
balanceUSD: (account?: `0x${string}`) => Promise<string | {
|
|
8927
|
+
value: string;
|
|
8928
|
+
format: string;
|
|
8929
|
+
originFormat: string;
|
|
8930
|
+
decimals: string;
|
|
8931
|
+
}>;
|
|
8932
|
+
allowance: (owner: string, spender: string) => Promise<any>;
|
|
8933
|
+
approve: (spender: `0x${string}`, amount: string, owner: `0x${string}`) => Promise<`0x${string}` | null>;
|
|
8934
|
+
priceUSD: () => Promise<any>;
|
|
8935
|
+
tokenUrl: () => Promise<any>;
|
|
8936
|
+
}[]>;
|
|
8937
|
+
swap(args: SwapParams, ctx?: ConfigContext): Promise<{
|
|
8938
|
+
data: {
|
|
8939
|
+
address: `0x${string}`;
|
|
8940
|
+
data: any;
|
|
8941
|
+
chainId: string;
|
|
8942
|
+
value: string;
|
|
8943
|
+
}[];
|
|
8944
|
+
quote: string;
|
|
8945
|
+
error?: undefined;
|
|
8946
|
+
} | {
|
|
8947
|
+
data: {
|
|
8948
|
+
address: `0x${string}`;
|
|
8949
|
+
data: any;
|
|
8950
|
+
chainId: string;
|
|
8951
|
+
}[];
|
|
8952
|
+
quote: string;
|
|
8953
|
+
error?: undefined;
|
|
8954
|
+
} | {
|
|
8955
|
+
error: unknown;
|
|
8956
|
+
data?: undefined;
|
|
8957
|
+
quote?: undefined;
|
|
8958
|
+
}>;
|
|
8959
|
+
}
|
|
8858
8960
|
declare const modules: {
|
|
8859
8961
|
mimo: Mimo;
|
|
8860
8962
|
staking: Staking;
|
|
@@ -8865,6 +8967,7 @@ declare const modules: {
|
|
|
8865
8967
|
hub: UseHub;
|
|
8866
8968
|
health: Health;
|
|
8867
8969
|
points: PointsPlatform;
|
|
8970
|
+
bondingcurve: BondingCurve;
|
|
8868
8971
|
};
|
|
8869
8972
|
export type ModuleType = typeof modules;
|
|
8870
8973
|
declare class ClickHouseSDK {
|
|
@@ -9195,6 +9298,18 @@ declare class Resource {
|
|
|
9195
9298
|
declare class IoPay extends BaseDBModule {
|
|
9196
9299
|
get_point_task(): Promise<import("postgres").RowList<import("postgres").Row[]>>;
|
|
9197
9300
|
}
|
|
9301
|
+
declare class Mimo$1 extends BaseDBModule {
|
|
9302
|
+
metrics(): Promise<{
|
|
9303
|
+
totalVolumeUSD: any;
|
|
9304
|
+
totalLiquidityUSD: any;
|
|
9305
|
+
txCount: any;
|
|
9306
|
+
pairCount: any;
|
|
9307
|
+
last24hVolumeUSD: string;
|
|
9308
|
+
depinTokenCount: any;
|
|
9309
|
+
last24hTxCount: string;
|
|
9310
|
+
last24hFee: string;
|
|
9311
|
+
}>;
|
|
9312
|
+
}
|
|
9198
9313
|
declare const modules$1: {
|
|
9199
9314
|
account: Account;
|
|
9200
9315
|
analyzer: Analyzer;
|
|
@@ -9206,6 +9321,7 @@ declare const modules$1: {
|
|
|
9206
9321
|
contract: Contract;
|
|
9207
9322
|
resource: Resource;
|
|
9208
9323
|
iopay: IoPay;
|
|
9324
|
+
mimo: Mimo$1;
|
|
9209
9325
|
};
|
|
9210
9326
|
export type DBModuleType = typeof modules$1;
|
|
9211
9327
|
export interface ConfigOptions {
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var U=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{for(let K in b){if(typeof b[K]==="object")b[K]=JSON.stringify(b[K],(Q,N)=>typeof N==="bigint"?N.toString():N);if(b[K]==null)delete b[K]}const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;let D;if(z)D=await fetch(H,{headers:{...z}});else D=await fetch(H);return D.json()}}})}}),S=async({args:j={},prop:z,method:L,url:B,fetchRequestInit:G})=>{if(!G?.method||G?.method==="GET"){for(let b in j){if(typeof j[b]==="object")j[b]=JSON.stringify(j[b],(H,D)=>typeof D==="bigint"?D.toString():D);if(j[b]==null)delete j[b]}const J=`${B}/${String(z)}/${String(L)}?${new URLSearchParams(j).toString()}`;return(await fetch(J,{...G})).json()}if(G?.method==="POST"){const J=`${B}/${String(z)}/${String(L)}`;return(await fetch(J,{...G,body:JSON.stringify(j)})).json()}},V=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),W=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{return S({args:b,prop:B,method:C,url:j,fetchRequestInit:z})}}})}}),X=({url:j="http://localhost:9527",fetchRequestInit:z})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{const H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;return(await fetch(H,{method:"GET",...z})).json()}}})}}),Y=({url:j="http://localhost:9527",ctx:z}={})=>new Proxy({},{get(L,B,G){return new Proxy({},{get(J,C){return async(b)=>{let H=!1;for(let N in b){if(typeof b[N]==="object")H=!0;if(b[N]==null)delete b[N]}let D,K,Q={};if(H)D=`${j}/${String(B)}/${String(C)}`;else D=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`;if(z)Q.headers={...z};if(H)Q.method="POST",Q.body=JSON.stringify(b);return K=await fetch(D,Q),K.json()}}})}});export{X as createIotexscanClient,Y as createIoidClient,W as createClientWithIoPayServer,V as createClientWithDBServer,U as createClient};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@iotexproject/kit",
|
|
3
3
|
"module": "index.ts",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "v0.1.
|
|
5
|
+
"version": "v0.1.38",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"@tryghost/content-api": "^1.11.21",
|
|
29
29
|
"@types/bn.js": "^5.1.6",
|
|
30
30
|
"@types/utf8": "^3.0.3",
|
|
31
|
+
"apollo-cache-inmemory": "^1.6.6",
|
|
32
|
+
"apollo-client": "^2.6.10",
|
|
33
|
+
"apollo-link-http": "^1.5.17",
|
|
31
34
|
"axios": "^1.7.2",
|
|
32
35
|
"bech32": "^2.0.0",
|
|
33
36
|
"bentocache": "^1.0.0-beta.9",
|
|
@@ -38,6 +41,7 @@
|
|
|
38
41
|
"dayjs": "^1.11.12",
|
|
39
42
|
"ethers": "^6.13.2",
|
|
40
43
|
"graphql-request": "^7.1.0",
|
|
44
|
+
"graphql-tag": "^2.12.6",
|
|
41
45
|
"ioredis": "^5.4.1",
|
|
42
46
|
"jsonwebtoken": "^9.0.2",
|
|
43
47
|
"lodash": "^4.17.21",
|