@iotexproject/kit 0.1.50 → 0.1.52

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
@@ -7948,7 +7948,7 @@ declare class SmartChefEntity {
7948
7948
  decimals: string;
7949
7949
  };
7950
7950
  myPoolBalanceUSD: string;
7951
- }>;
7951
+ } | null>;
7952
7952
  apr(): Promise<string | undefined>;
7953
7953
  myPendingReward(account: `0x${string}`): Promise<{
7954
7954
  pendingReward: {
@@ -7957,27 +7957,17 @@ declare class SmartChefEntity {
7957
7957
  originFormat: string;
7958
7958
  decimals: string;
7959
7959
  };
7960
- pendingRewardUSD: {
7961
- value: string;
7962
- format: string;
7963
- originFormat: string;
7964
- decimals: string;
7965
- };
7960
+ pendingRewardUSD: string;
7966
7961
  }>;
7967
7962
  totalReward(): Promise<{
7968
- totalRewardUSD: {
7969
- value: string;
7970
- format: string;
7971
- originFormat: string;
7972
- decimals: string;
7973
- };
7963
+ totalRewardUSD: string;
7974
7964
  totalReward: {
7975
7965
  value: string;
7976
7966
  format: string;
7977
7967
  originFormat: string;
7978
7968
  decimals: string;
7979
7969
  };
7980
- } | undefined>;
7970
+ } | null | undefined>;
7981
7971
  totalStakedBalance(): Promise<{
7982
7972
  totalStakedBalance: {
7983
7973
  value: string;
@@ -8000,6 +7990,36 @@ declare class SmartChefEntity {
8000
7990
  decimals: true;
8001
7991
  tokenUrl: true;
8002
7992
  }>>;
7993
+ getStakeTokenInner(): Promise<import("@dappworks/kit/aiem").QueryReturnType<LPTokenEntity, {
7994
+ address: true;
7995
+ decimals: true;
7996
+ symbol: true;
7997
+ balanceOf: [
7998
+ `0x${string}`
7999
+ ];
8000
+ priceUSD: true;
8001
+ tokenUrl: true;
8002
+ type: true;
8003
+ token0: true;
8004
+ token1: true;
8005
+ }> | import("@dappworks/kit/aiem").QueryReturnType<ERC20Entity, {
8006
+ decimals: true;
8007
+ address: true;
8008
+ symbol: true;
8009
+ balanceOf: [
8010
+ `0x${string}`
8011
+ ];
8012
+ priceUSD: true;
8013
+ tokenUrl: true;
8014
+ type: true;
8015
+ }> | undefined>;
8016
+ getRewardTokenInnter(): Promise<import("@dappworks/kit/aiem").QueryReturnType<ERC20Entity, {
8017
+ address: true;
8018
+ symbol: true;
8019
+ priceUSD: true;
8020
+ decimals: true;
8021
+ tokenUrl: true;
8022
+ }>>;
8003
8023
  StakedToken(): Promise<import("@dappworks/kit/aiem").QueryReturnType<LPTokenEntity, {
8004
8024
  address: true;
8005
8025
  decimals: true;
@@ -8054,12 +8074,17 @@ declare class LiquidityMining {
8054
8074
  address: `0x${string}`;
8055
8075
  amount: string;
8056
8076
  account: `0x${string}`;
8057
- }, ctx?: ConfigContext): Promise<{
8077
+ }, ctx?: ConfigContext): Promise<({
8078
+ data: `0x${string}`;
8079
+ address: `0x${string}` | undefined;
8080
+ chainId: string;
8081
+ type: string;
8082
+ } | {
8058
8083
  data: any;
8059
8084
  address: `0x${string}`;
8060
8085
  chainId: string;
8061
8086
  type: string;
8062
- }[]>;
8087
+ })[]>;
8063
8088
  harvest({ address }: {
8064
8089
  address: `0x${string}`;
8065
8090
  }, ctx?: ConfigContext): Promise<{
package/dist/index.js CHANGED
@@ -1 +1 @@
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]}let H=`${j}/${String(B)}/${String(C)}?${new URLSearchParams(b).toString()}`,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]}let J=`${B}/${String(z)}/${String(L)}?${new URLSearchParams(j).toString()}`;return(await fetch(J,{...G})).json()}if(G?.method==="POST"){let 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)=>{let 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};
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.50",
5
+ "version": "v0.1.52",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "scripts": {
@@ -14,7 +14,8 @@
14
14
  "build": "bun run build.mjs",
15
15
  "prepublishOnly": "bun run build",
16
16
  "gen:grpc": "protoc --plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts --ts_out=grpc_js:./lib/grpc/generated -I ./lib/grpc/protos ./lib/grpc/protos/*.proto",
17
- "generate-prisma": "prisma generate --schema=./prisma/schema.prisma"
17
+ "generate-prisma": "prisma generate --schema=./prisma/schema.prisma",
18
+ "dev-db-with-prisma": "bun generate-prisma && bun server-db.ts"
18
19
  },
19
20
  "files": [
20
21
  "dist"