@cryptorubic/web3 1.4.6-alpha-rub-2099.0 → 1.4.6-alpha-2214.0

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 CHANGED
@@ -1 +1 @@
1
- # web3
1
+ # web3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "1.4.6-alpha-rub-2099.0",
3
+ "version": "1.4.6-alpha-2214.0",
4
4
  "dependencies": {
5
5
  "@ethersproject/bignumber": "^5.8.0",
6
6
  "@mysten/sui": "^1.24.0",
@@ -7,7 +7,7 @@ export declare class TonApiService {
7
7
  private readonly httpClient;
8
8
  private readonly logger?;
9
9
  private readonly tonApiUrl;
10
- private readonly apiKey;
10
+ private readonly apiHeaders;
11
11
  private readonly tonCenterV3Url;
12
12
  constructor(httpClient: HttpClient, params: TonApiConfig, logger?: ICustomLogger | undefined);
13
13
  /**
@@ -5,7 +5,7 @@ class TonApiService {
5
5
  constructor(httpClient, params, logger) {
6
6
  this.httpClient = httpClient;
7
7
  this.logger = logger;
8
- this.apiKey = params.tonApiKey;
8
+ this.apiHeaders = params.tonApiHeaders;
9
9
  this.tonApiUrl = params?.tonApiUrl || 'https://tonapi.io';
10
10
  this.tonCenterV3Url = params.tonCenterV3Url || 'https://toncenter.com/api/v3';
11
11
  }
@@ -15,7 +15,7 @@ class TonApiService {
15
15
  async getAllFormatsOfAddress(walletAddress) {
16
16
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/address/${walletAddress}/parse`, {
17
17
  headers: {
18
- apiKey: this.apiKey,
18
+ ...this.apiHeaders,
19
19
  referer: 'https://app.rubic.exchange'
20
20
  }
21
21
  });
@@ -31,7 +31,7 @@ class TonApiService {
31
31
  async fetchWalletSeqno(walletAddress) {
32
32
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/wallet/${walletAddress}/seqno`, {
33
33
  headers: {
34
- apiKey: this.apiKey,
34
+ ...this.apiHeaders,
35
35
  referer: 'https://app.rubic.exchange'
36
36
  }
37
37
  });
@@ -43,7 +43,7 @@ class TonApiService {
43
43
  async fetchTxInfo(txHash) {
44
44
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/blockchain/transactions/${txHash}`, {
45
45
  headers: {
46
- apiKey: this.apiKey,
46
+ ...this.apiHeaders,
47
47
  referer: 'https://app.rubic.exchange'
48
48
  }
49
49
  });
@@ -55,7 +55,7 @@ class TonApiService {
55
55
  async fetchTxInfoByMessageHash(txHash) {
56
56
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/blockchain/messages/${txHash}/transaction`, {
57
57
  headers: {
58
- apiKey: this.apiKey,
58
+ ...this.apiHeaders,
59
59
  referer: 'https://app.rubic.exchange'
60
60
  }
61
61
  });
@@ -68,7 +68,7 @@ class TonApiService {
68
68
  try {
69
69
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/events/${txHash}`, {
70
70
  headers: {
71
- apiKey: this.apiKey,
71
+ ...this.apiHeaders,
72
72
  referer: 'https://app.rubic.exchange'
73
73
  }
74
74
  });
@@ -84,7 +84,7 @@ class TonApiService {
84
84
  async healthcheck() {
85
85
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/status`, {
86
86
  headers: {
87
- apiKey: this.apiKey,
87
+ ...this.apiHeaders,
88
88
  referer: 'https://app.rubic.exchange'
89
89
  }
90
90
  });
@@ -117,7 +117,7 @@ class TonApiService {
117
117
  }
118
118
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/blockchain/accounts/${address}/methods/${methodName}${argsParam}`, {
119
119
  headers: {
120
- apiKey: this.apiKey,
120
+ ...this.apiHeaders,
121
121
  referer: 'https://app.rubic.exchange'
122
122
  }
123
123
  });
@@ -130,7 +130,7 @@ class TonApiService {
130
130
  try {
131
131
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/jettons/${tokenAddress}`, {
132
132
  headers: {
133
- apiKey: this.apiKey,
133
+ ...this.apiHeaders,
134
134
  referer: 'https://app.rubic.exchange'
135
135
  }
136
136
  });
@@ -152,7 +152,7 @@ class TonApiService {
152
152
  try {
153
153
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/accounts/${walletAddress}/jettons/${tokenAddress}`, {
154
154
  headers: {
155
- apiKey: this.apiKey,
155
+ ...this.apiHeaders,
156
156
  referer: 'https://app.rubic.exchange'
157
157
  }
158
158
  });
@@ -170,7 +170,7 @@ class TonApiService {
170
170
  async fetchAllNonNullableTokensInfoForWallet(walletAddress) {
171
171
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/accounts/${walletAddress}/jettons`, {
172
172
  headers: {
173
- apiKey: this.apiKey,
173
+ ...this.apiHeaders,
174
174
  referer: 'https://app.rubic.exchange'
175
175
  }
176
176
  });
@@ -185,7 +185,7 @@ class TonApiService {
185
185
  async fetchAccountInfo(walletAddress) {
186
186
  const res = await this.httpClient.get(`${this.tonApiUrl}/v2/accounts/${walletAddress}`, {
187
187
  headers: {
188
- apiKey: this.apiKey,
188
+ ...this.apiHeaders,
189
189
  referer: 'https://app.rubic.exchange'
190
190
  }
191
191
  });
@@ -1,5 +1,5 @@
1
1
  export interface TonApiConfig {
2
2
  tonApiUrl?: string;
3
- tonApiKey: string;
3
+ tonApiHeaders: Record<string, string>;
4
4
  tonCenterV3Url?: string;
5
5
  }