@tomo-inc/chains-service 0.0.24 → 0.0.25

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.cjs CHANGED
@@ -3919,7 +3919,8 @@ function getConfig(tomoStage) {
3919
3919
  var CONFIG = {
3920
3920
  prod: getConfig("prod"),
3921
3921
  pre: getConfig("pre"),
3922
- dev: getConfig("dev")
3922
+ dev: getConfig("dev"),
3923
+ "prod-dogeos": getConfig("prod-dogeos")
3923
3924
  };
3924
3925
 
3925
3926
  // src/base/service.ts
@@ -4951,6 +4952,16 @@ var EvmService = class _EvmService extends BaseService {
4951
4952
  }
4952
4953
  };
4953
4954
  }
4955
+ async request(method, params) {
4956
+ try {
4957
+ const rpcClient = await this.createPublicClient({});
4958
+ const res = await rpcClient.request(method, params);
4959
+ return res;
4960
+ } catch (error) {
4961
+ console.error("Failed to request:", error);
4962
+ throw error;
4963
+ }
4964
+ }
4954
4965
  async createPublicClient({ chainId, rpcUrl }) {
4955
4966
  if (rpcUrl) {
4956
4967
  return viem.createPublicClient({
package/dist/index.d.cts CHANGED
@@ -601,6 +601,7 @@ declare class EvmService extends BaseService {
601
601
  eth_signTypedData_v4([address, typedData]: [`0x${string}`, ITypedData]): Promise<`0x${string}`>;
602
602
  eth_getBalance([address, type]: [`0x${string}`, "latest"]): Promise<string>;
603
603
  _queryGasInfo(txData: TransactionParams$1): Promise<QueryGasResponse>;
604
+ request(method: string, params: any): Promise<any>;
604
605
  private createPublicClient;
605
606
  eth_estimateGas(txs: Transaction$1[]): Promise<`0x${string}`>;
606
607
  eth_getTransactionCount([address, type]: [`0x${string}`, "latest" | "pending"]): Promise<number>;
package/dist/index.d.ts CHANGED
@@ -601,6 +601,7 @@ declare class EvmService extends BaseService {
601
601
  eth_signTypedData_v4([address, typedData]: [`0x${string}`, ITypedData]): Promise<`0x${string}`>;
602
602
  eth_getBalance([address, type]: [`0x${string}`, "latest"]): Promise<string>;
603
603
  _queryGasInfo(txData: TransactionParams$1): Promise<QueryGasResponse>;
604
+ request(method: string, params: any): Promise<any>;
604
605
  private createPublicClient;
605
606
  eth_estimateGas(txs: Transaction$1[]): Promise<`0x${string}`>;
606
607
  eth_getTransactionCount([address, type]: [`0x${string}`, "latest" | "pending"]): Promise<number>;
package/dist/index.js CHANGED
@@ -3911,7 +3911,8 @@ function getConfig(tomoStage) {
3911
3911
  var CONFIG = {
3912
3912
  prod: getConfig("prod"),
3913
3913
  pre: getConfig("pre"),
3914
- dev: getConfig("dev")
3914
+ dev: getConfig("dev"),
3915
+ "prod-dogeos": getConfig("prod-dogeos")
3915
3916
  };
3916
3917
 
3917
3918
  // src/base/service.ts
@@ -4943,6 +4944,16 @@ var EvmService = class _EvmService extends BaseService {
4943
4944
  }
4944
4945
  };
4945
4946
  }
4947
+ async request(method, params) {
4948
+ try {
4949
+ const rpcClient = await this.createPublicClient({});
4950
+ const res = await rpcClient.request(method, params);
4951
+ return res;
4952
+ } catch (error) {
4953
+ console.error("Failed to request:", error);
4954
+ throw error;
4955
+ }
4956
+ }
4946
4957
  async createPublicClient({ chainId, rpcUrl }) {
4947
4958
  if (rpcUrl) {
4948
4959
  return createPublicClient({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tomo-inc/chains-service",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "author": "tomo.inc",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -23,7 +23,7 @@
23
23
  "bitcoinjs-lib": "^7.0.0",
24
24
  "crypto-js": "4.2.0",
25
25
  "viem": "2.21.54",
26
- "@tomo-inc/wallet-utils": "0.0.18"
26
+ "@tomo-inc/wallet-utils": "0.0.19"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/supertest": "^2.0.12",
package/src/config.ts CHANGED
@@ -18,4 +18,5 @@ export const CONFIG = {
18
18
  prod: getConfig("prod"),
19
19
  pre: getConfig("pre"),
20
20
  dev: getConfig("dev"),
21
+ "prod-dogeos": getConfig("prod-dogeos"),
21
22
  };
@@ -203,6 +203,17 @@ export class EvmService extends BaseService {
203
203
  };
204
204
  }
205
205
 
206
+ public async request(method: string, params: any): Promise<any> {
207
+ try {
208
+ const rpcClient = await this.createPublicClient({});
209
+ const res = await rpcClient.request(method, params);
210
+ return res;
211
+ } catch (error) {
212
+ console.error("Failed to request:", error);
213
+ throw error;
214
+ }
215
+ }
216
+
206
217
  private async createPublicClient({ chainId, rpcUrl }: { chainId?: string; rpcUrl?: string }): Promise<any> {
207
218
  if (rpcUrl) {
208
219
  return createPublicClient({