@iotexproject/kit 0.1.36 → 0.1.37

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 CHANGED
@@ -8855,6 +8855,107 @@ 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
+ projectTokenList(args: {
8909
+ account: `0x${string}`;
8910
+ }, ctx?: ConfigContext): Promise<{
8911
+ address: `0x${string}`;
8912
+ chainId: string;
8913
+ isEther: boolean;
8914
+ type: () => Promise<string>;
8915
+ totalSupply: number;
8916
+ name: string;
8917
+ symbol: string;
8918
+ decimals: () => Promise<number | undefined>;
8919
+ balanceOf: {
8920
+ value: string;
8921
+ format: string;
8922
+ originFormat: string;
8923
+ decimals: string;
8924
+ };
8925
+ balanceUSD: (account?: `0x${string}`) => Promise<string | {
8926
+ value: string;
8927
+ format: string;
8928
+ originFormat: string;
8929
+ decimals: string;
8930
+ }>;
8931
+ allowance: (owner: string, spender: string) => Promise<any>;
8932
+ approve: (spender: `0x${string}`, amount: string, owner: `0x${string}`) => Promise<`0x${string}` | null>;
8933
+ priceUSD: () => Promise<any>;
8934
+ tokenUrl: () => Promise<any>;
8935
+ }[]>;
8936
+ swap(args: SwapParams, ctx?: ConfigContext): Promise<{
8937
+ data: {
8938
+ address: `0x${string}`;
8939
+ data: any;
8940
+ chainId: string;
8941
+ value: string;
8942
+ }[];
8943
+ quote: string;
8944
+ error?: undefined;
8945
+ } | {
8946
+ data: {
8947
+ address: `0x${string}`;
8948
+ data: any;
8949
+ chainId: string;
8950
+ }[];
8951
+ quote: string;
8952
+ error?: undefined;
8953
+ } | {
8954
+ error: unknown;
8955
+ data?: undefined;
8956
+ quote?: undefined;
8957
+ }>;
8958
+ }
8858
8959
  declare const modules: {
8859
8960
  mimo: Mimo;
8860
8961
  staking: Staking;
@@ -8865,6 +8966,7 @@ declare const modules: {
8865
8966
  hub: UseHub;
8866
8967
  health: Health;
8867
8968
  points: PointsPlatform;
8969
+ bondingcurve: BondingCurve;
8868
8970
  };
8869
8971
  export type ModuleType = typeof modules;
8870
8972
  declare class ClickHouseSDK {
@@ -9195,6 +9297,18 @@ declare class Resource {
9195
9297
  declare class IoPay extends BaseDBModule {
9196
9298
  get_point_task(): Promise<import("postgres").RowList<import("postgres").Row[]>>;
9197
9299
  }
9300
+ declare class Mimo$1 extends BaseDBModule {
9301
+ metrics(): Promise<{
9302
+ totalVolumeUSD: any;
9303
+ totalLiquidityUSD: any;
9304
+ txCount: any;
9305
+ pairCount: any;
9306
+ last24hVolumeUSD: string;
9307
+ depinTokenCount: any;
9308
+ last24hTxCount: string;
9309
+ last24hFee: string;
9310
+ }>;
9311
+ }
9198
9312
  declare const modules$1: {
9199
9313
  account: Account;
9200
9314
  analyzer: Analyzer;
@@ -9206,6 +9320,7 @@ declare const modules$1: {
9206
9320
  contract: Contract;
9207
9321
  resource: Resource;
9208
9322
  iopay: IoPay;
9323
+ mimo: Mimo$1;
9209
9324
  };
9210
9325
  export type DBModuleType = typeof modules$1;
9211
9326
  export interface ConfigOptions {
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var L=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{for(let E in T){if(typeof T[E]==="object")T[E]=JSON.stringify(T[E],(J,H)=>typeof H==="bigint"?H.toString():H);if(T[E]==null)delete T[E]}const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;let b;if(B)b=await fetch(w,{headers:{...B}});else b=await fetch(w);return b.json()}}})}}),K=async({args:A={},prop:B,method:G,url:C,fetchRequestInit:j})=>{if(!j?.method||j?.method==="GET"){for(let T in A){if(typeof A[T]==="object")A[T]=JSON.stringify(A[T],(w,b)=>typeof b==="bigint"?b.toString():b);if(A[T]==null)delete A[T]}const z=`${C}/${String(B)}/${String(G)}?${new URLSearchParams(A).toString()}`;return(await fetch(z,{...j})).json()}if(j?.method==="POST"){const z=`${C}/${String(B)}/${String(G)}`;return(await fetch(z,{...j,body:JSON.stringify(A)})).json()}},N=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),Q=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{return K({args:T,prop:C,method:D,url:A,fetchRequestInit:B})}}})}}),S=({url:A="http://localhost:9527",fetchRequestInit:B})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{const w=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;return(await fetch(w,{method:"GET",...B})).json()}}})}}),U=({url:A="http://localhost:9527",ctx:B}={})=>new Proxy({},{get(G,C,j){return new Proxy({},{get(z,D){return async(T)=>{let w=!1;for(let H in T){if(typeof T[H]==="object")w=!0;if(T[H]==null)delete T[H]}let b,E,J={};if(w)b=`${A}/${String(C)}/${String(D)}`;else b=`${A}/${String(C)}/${String(D)}?${new URLSearchParams(T).toString()}`;if(B)J.headers={...B};if(w)J.method="POST",J.body=JSON.stringify(T);return E=await fetch(b,J),E.json()}}})}});export{S as createIotexscanClient,U as createIoidClient,Q as createClientWithIoPayServer,N as createClientWithDBServer,L as createClient};
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.36",
5
+ "version": "v0.1.37",
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",