starknet 2.1.1 → 2.2.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/CHANGELOG.md CHANGED
@@ -1,9 +1,32 @@
1
+ # [2.2.0](https://github.com/seanjameshan/starknet.js/compare/v2.1.0...v2.2.0) (2021-11-30)
2
+
3
+ ### Bug Fixes
4
+
5
+ - bump version ([02c8d07](https://github.com/seanjameshan/starknet.js/commit/02c8d0772e42c81e35a3a841169eb25cde68716e))
6
+ - correctly parse structs in Starknet return types ([5a4a318](https://github.com/seanjameshan/starknet.js/commit/5a4a318dad4c78fe84540ad92063fc1879317ac1))
7
+ - make Typescript compiler happy with constant types ([aedd895](https://github.com/seanjameshan/starknet.js/commit/aedd895a62e6018dd1d7330b004d54360007967f))
8
+ - use urljoin ([4f1a040](https://github.com/seanjameshan/starknet.js/commit/4f1a04090f26f8e8565c516921d5d3332b6a4649))
9
+
10
+ ### Features
11
+
12
+ - bump version ([fd22f41](https://github.com/seanjameshan/starknet.js/commit/fd22f41e39ec1c7f71c32019309f82ad0f4d66a9))
13
+
14
+ ## [2.1.1](https://github.com/seanjameshan/starknet.js/compare/v2.1.0...v2.1.1) (2021-11-30)
15
+
16
+ ### Bug Fixes
17
+
18
+ - bump version ([02c8d07](https://github.com/seanjameshan/starknet.js/commit/02c8d0772e42c81e35a3a841169eb25cde68716e))
19
+ - correctly parse structs in Starknet return types ([5a4a318](https://github.com/seanjameshan/starknet.js/commit/5a4a318dad4c78fe84540ad92063fc1879317ac1))
20
+ - make Typescript compiler happy with constant types ([aedd895](https://github.com/seanjameshan/starknet.js/commit/aedd895a62e6018dd1d7330b004d54360007967f))
21
+ - use urljoin ([4f1a040](https://github.com/seanjameshan/starknet.js/commit/4f1a04090f26f8e8565c516921d5d3332b6a4649))
22
+
1
23
  ## [2.1.1](https://github.com/seanjameshan/starknet.js/compare/v2.1.0...v2.1.1) (2021-11-30)
2
24
 
3
25
  ### Bug Fixes
4
26
 
5
27
  - correctly parse structs in Starknet return types ([5a4a318](https://github.com/seanjameshan/starknet.js/commit/5a4a318dad4c78fe84540ad92063fc1879317ac1))
6
28
  - make Typescript compiler happy with constant types ([aedd895](https://github.com/seanjameshan/starknet.js/commit/aedd895a62e6018dd1d7330b004d54360007967f))
29
+ - use urljoin ([4f1a040](https://github.com/seanjameshan/starknet.js/commit/4f1a04090f26f8e8565c516921d5d3332b6a4649))
7
30
 
8
31
  # [2.1.0](https://github.com/seanjameshan/starknet.js/compare/v2.0.1...v2.1.0) (2021-11-30)
9
32
 
@@ -12,7 +12,7 @@ export declare class Provider implements ProviderInterface {
12
12
  feederGatewayUrl: string;
13
13
  gatewayUrl: string;
14
14
  constructor(optionsOrProvider?: ProviderOptions | Provider);
15
- protected static getNetworkFromName(name: NetworkName): "http://alpha-mainnet.starknet.io/" | "https://alpha4.starknet.io";
15
+ protected static getNetworkFromName(name: NetworkName): "https://alpha-mainnet.starknet.io" | "https://alpha4.starknet.io";
16
16
  /**
17
17
  * Gets the smart contract address on the goerli testnet.
18
18
  *
@@ -52,6 +52,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
52
52
  Object.defineProperty(exports, "__esModule", { value: true });
53
53
  exports.Provider = void 0;
54
54
  var axios_1 = __importDefault(require("axios"));
55
+ var url_join_1 = __importDefault(require("url-join"));
55
56
  var json_1 = require("../utils/json");
56
57
  var number_1 = require("../utils/number");
57
58
  var stark_1 = require("../utils/stark");
@@ -71,14 +72,14 @@ var Provider = /** @class */ (function () {
71
72
  ? optionsOrProvider.baseUrl
72
73
  : Provider.getNetworkFromName(optionsOrProvider.network);
73
74
  this.baseUrl = baseUrl;
74
- this.feederGatewayUrl = baseUrl + "/feeder_gateway";
75
- this.gatewayUrl = baseUrl + "/gateway";
75
+ this.feederGatewayUrl = (0, url_join_1.default)(baseUrl, 'feeder_gateway');
76
+ this.gatewayUrl = (0, url_join_1.default)(baseUrl, 'gateway');
76
77
  }
77
78
  }
78
79
  Provider.getNetworkFromName = function (name) {
79
80
  switch (name) {
80
81
  case 'mainnet-alpha':
81
- return 'http://alpha-mainnet.starknet.io/';
82
+ return 'https://alpha-mainnet.starknet.io';
82
83
  case 'georli-alpha':
83
84
  default:
84
85
  return 'https://alpha4.starknet.io';
@@ -95,7 +96,7 @@ var Provider = /** @class */ (function () {
95
96
  var data;
96
97
  return __generator(this, function (_a) {
97
98
  switch (_a.label) {
98
- case 0: return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_contract_addresses")];
99
+ case 0: return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_contract_addresses'))];
99
100
  case 1:
100
101
  data = (_a.sent()).data;
101
102
  return [2 /*return*/, data];
@@ -117,7 +118,7 @@ var Provider = /** @class */ (function () {
117
118
  var data;
118
119
  return __generator(this, function (_a) {
119
120
  switch (_a.label) {
120
- case 0: return [4 /*yield*/, axios_1.default.post(this.feederGatewayUrl + "/call_contract?blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null'), __assign({ signature: [], calldata: [] }, invokeTx))];
121
+ case 0: return [4 /*yield*/, axios_1.default.post((0, url_join_1.default)(this.feederGatewayUrl, 'call_contract', "?blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null')), __assign({ signature: [], calldata: [] }, invokeTx))];
121
122
  case 1:
122
123
  data = (_a.sent()).data;
123
124
  return [2 /*return*/, data];
@@ -138,7 +139,7 @@ var Provider = /** @class */ (function () {
138
139
  var data;
139
140
  return __generator(this, function (_a) {
140
141
  switch (_a.label) {
141
- case 0: return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_block?blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null'))];
142
+ case 0: return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_block', "?blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null')))];
142
143
  case 1:
143
144
  data = (_a.sent()).data;
144
145
  return [2 /*return*/, data];
@@ -160,7 +161,7 @@ var Provider = /** @class */ (function () {
160
161
  var data;
161
162
  return __generator(this, function (_a) {
162
163
  switch (_a.label) {
163
- case 0: return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_code?contractAddress=" + contractAddress + "&blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null'))];
164
+ case 0: return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_code', "?contractAddress=" + contractAddress + "&blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null')))];
164
165
  case 1:
165
166
  data = (_a.sent()).data;
166
167
  return [2 /*return*/, data];
@@ -184,7 +185,7 @@ var Provider = /** @class */ (function () {
184
185
  var data;
185
186
  return __generator(this, function (_a) {
186
187
  switch (_a.label) {
187
- case 0: return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_storage_at?contractAddress=" + contractAddress + "&key=" + key + "&blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null'))];
188
+ case 0: return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_storage_at', "?contractAddress=" + contractAddress + "&key=" + key + "&blockId=" + (blockId !== null && blockId !== void 0 ? blockId : 'null')))];
188
189
  case 1:
189
190
  data = (_a.sent()).data;
190
191
  return [2 /*return*/, data];
@@ -207,7 +208,7 @@ var Provider = /** @class */ (function () {
207
208
  switch (_a.label) {
208
209
  case 0:
209
210
  txHashBn = (0, number_1.toBN)(txHash);
210
- return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_transaction_status?transactionHash=" + (0, number_1.toHex)(txHashBn))];
211
+ return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_transaction_status', "?transactionHash=" + (0, number_1.toHex)(txHashBn)))];
211
212
  case 1:
212
213
  data = (_a.sent()).data;
213
214
  return [2 /*return*/, data];
@@ -230,7 +231,7 @@ var Provider = /** @class */ (function () {
230
231
  switch (_a.label) {
231
232
  case 0:
232
233
  txHashBn = (0, number_1.toBN)(txHash);
233
- return [4 /*yield*/, axios_1.default.get(this.feederGatewayUrl + "/get_transaction?transactionHash=" + (0, number_1.toHex)(txHashBn))];
234
+ return [4 /*yield*/, axios_1.default.get((0, url_join_1.default)(this.feederGatewayUrl, 'get_transaction', "?transactionHash=" + (0, number_1.toHex)(txHashBn)))];
234
235
  case 1:
235
236
  data = (_a.sent()).data;
236
237
  return [2 /*return*/, data];
@@ -254,7 +255,7 @@ var Provider = /** @class */ (function () {
254
255
  case 0:
255
256
  signature = tx.type === 'INVOKE_FUNCTION' && (0, stark_1.formatSignature)(tx.signature);
256
257
  contract_address_salt = tx.type === 'DEPLOY' && (0, number_1.toHex)((0, number_1.toBN)(tx.contract_address_salt));
257
- return [4 /*yield*/, axios_1.default.post(this.gatewayUrl + "/add_transaction", (0, json_1.stringify)(__assign(__assign(__assign({}, tx), (Array.isArray(signature) && { signature: signature })), (contract_address_salt && { contract_address_salt: contract_address_salt }))), { headers: { 'Content-Type': 'application/json' } })];
258
+ return [4 /*yield*/, axios_1.default.post((0, url_join_1.default)(this.gatewayUrl, 'add_transaction'), (0, json_1.stringify)(__assign(__assign(__assign({}, tx), (Array.isArray(signature) && { signature: signature })), (contract_address_salt && { contract_address_salt: contract_address_salt }))), { headers: { 'Content-Type': 'application/json' } })];
258
259
  case 1:
259
260
  data = (_a.sent()).data;
260
261
  return [2 /*return*/, data];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "starknet",
3
- "version": "2.1.1",
3
+ "version": "2.2.0",
4
4
  "description": "JavaScript library for StarkNet",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -40,6 +40,7 @@
40
40
  "@types/json-bigint": "^1.0.1",
41
41
  "@types/minimalistic-assert": "^1.0.1",
42
42
  "@types/pako": "^1.0.2",
43
+ "@types/url-join": "^4.0.1",
43
44
  "@typescript-eslint/eslint-plugin": "^5.0.0",
44
45
  "@typescript-eslint/parser": "^5.0.0",
45
46
  "eslint": "^7.32.0",
@@ -65,7 +66,8 @@
65
66
  "hash.js": "^1.1.7",
66
67
  "json-bigint": "^1.0.0",
67
68
  "minimalistic-assert": "^1.0.1",
68
- "pako": "^2.0.4"
69
+ "pako": "^2.0.4",
70
+ "url-join": "^4.0.1"
69
71
  },
70
72
  "lint-staged": {
71
73
  "*.ts": "eslint --cache --fix",
@@ -27,7 +27,7 @@ export declare class Provider implements ProviderInterface {
27
27
  constructor(optionsOrProvider?: ProviderOptions | Provider);
28
28
  protected static getNetworkFromName(
29
29
  name: NetworkName
30
- ): 'http://alpha-mainnet.starknet.io/' | 'https://alpha4.starknet.io';
30
+ ): 'https://alpha-mainnet.starknet.io' | 'https://alpha4.starknet.io';
31
31
  /**
32
32
  * Gets the smart contract address on the goerli testnet.
33
33
  *
@@ -152,6 +152,7 @@ var __importDefault =
152
152
  Object.defineProperty(exports, '__esModule', { value: true });
153
153
  exports.Provider = void 0;
154
154
  var axios_1 = __importDefault(require('axios'));
155
+ var url_join_1 = __importDefault(require('url-join'));
155
156
  var json_1 = require('../utils/json');
156
157
  var number_1 = require('../utils/number');
157
158
  var stark_1 = require('../utils/stark');
@@ -175,14 +176,14 @@ var Provider = /** @class */ (function () {
175
176
  ? optionsOrProvider.baseUrl
176
177
  : Provider.getNetworkFromName(optionsOrProvider.network);
177
178
  this.baseUrl = baseUrl;
178
- this.feederGatewayUrl = baseUrl + '/feeder_gateway';
179
- this.gatewayUrl = baseUrl + '/gateway';
179
+ this.feederGatewayUrl = (0, url_join_1.default)(baseUrl, 'feeder_gateway');
180
+ this.gatewayUrl = (0, url_join_1.default)(baseUrl, 'gateway');
180
181
  }
181
182
  }
182
183
  Provider.getNetworkFromName = function (name) {
183
184
  switch (name) {
184
185
  case 'mainnet-alpha':
185
- return 'http://alpha-mainnet.starknet.io/';
186
+ return 'https://alpha-mainnet.starknet.io';
186
187
  case 'georli-alpha':
187
188
  default:
188
189
  return 'https://alpha4.starknet.io';
@@ -202,7 +203,9 @@ var Provider = /** @class */ (function () {
202
203
  case 0:
203
204
  return [
204
205
  4 /*yield*/,
205
- axios_1.default.get(this.feederGatewayUrl + '/get_contract_addresses'),
206
+ axios_1.default.get(
207
+ (0, url_join_1.default)(this.feederGatewayUrl, 'get_contract_addresses')
208
+ ),
206
209
  ];
207
210
  case 1:
208
211
  data = _a.sent().data;
@@ -229,9 +232,11 @@ var Provider = /** @class */ (function () {
229
232
  return [
230
233
  4 /*yield*/,
231
234
  axios_1.default.post(
232
- this.feederGatewayUrl +
233
- '/call_contract?blockId=' +
234
- (blockId !== null && blockId !== void 0 ? blockId : 'null'),
235
+ (0, url_join_1.default)(
236
+ this.feederGatewayUrl,
237
+ 'call_contract',
238
+ '?blockId=' + (blockId !== null && blockId !== void 0 ? blockId : 'null')
239
+ ),
235
240
  __assign({ signature: [], calldata: [] }, invokeTx)
236
241
  ),
237
242
  ];
@@ -259,9 +264,11 @@ var Provider = /** @class */ (function () {
259
264
  return [
260
265
  4 /*yield*/,
261
266
  axios_1.default.get(
262
- this.feederGatewayUrl +
263
- '/get_block?blockId=' +
264
- (blockId !== null && blockId !== void 0 ? blockId : 'null')
267
+ (0, url_join_1.default)(
268
+ this.feederGatewayUrl,
269
+ 'get_block',
270
+ '?blockId=' + (blockId !== null && blockId !== void 0 ? blockId : 'null')
271
+ )
265
272
  ),
266
273
  ];
267
274
  case 1:
@@ -289,11 +296,14 @@ var Provider = /** @class */ (function () {
289
296
  return [
290
297
  4 /*yield*/,
291
298
  axios_1.default.get(
292
- this.feederGatewayUrl +
293
- '/get_code?contractAddress=' +
294
- contractAddress +
295
- '&blockId=' +
296
- (blockId !== null && blockId !== void 0 ? blockId : 'null')
299
+ (0, url_join_1.default)(
300
+ this.feederGatewayUrl,
301
+ 'get_code',
302
+ '?contractAddress=' +
303
+ contractAddress +
304
+ '&blockId=' +
305
+ (blockId !== null && blockId !== void 0 ? blockId : 'null')
306
+ )
297
307
  ),
298
308
  ];
299
309
  case 1:
@@ -323,13 +333,16 @@ var Provider = /** @class */ (function () {
323
333
  return [
324
334
  4 /*yield*/,
325
335
  axios_1.default.get(
326
- this.feederGatewayUrl +
327
- '/get_storage_at?contractAddress=' +
328
- contractAddress +
329
- '&key=' +
330
- key +
331
- '&blockId=' +
332
- (blockId !== null && blockId !== void 0 ? blockId : 'null')
336
+ (0, url_join_1.default)(
337
+ this.feederGatewayUrl,
338
+ 'get_storage_at',
339
+ '?contractAddress=' +
340
+ contractAddress +
341
+ '&key=' +
342
+ key +
343
+ '&blockId=' +
344
+ (blockId !== null && blockId !== void 0 ? blockId : 'null')
345
+ )
333
346
  ),
334
347
  ];
335
348
  case 1:
@@ -357,9 +370,11 @@ var Provider = /** @class */ (function () {
357
370
  return [
358
371
  4 /*yield*/,
359
372
  axios_1.default.get(
360
- this.feederGatewayUrl +
361
- '/get_transaction_status?transactionHash=' +
362
- (0, number_1.toHex)(txHashBn)
373
+ (0, url_join_1.default)(
374
+ this.feederGatewayUrl,
375
+ 'get_transaction_status',
376
+ '?transactionHash=' + (0, number_1.toHex)(txHashBn)
377
+ )
363
378
  ),
364
379
  ];
365
380
  case 1:
@@ -387,9 +402,11 @@ var Provider = /** @class */ (function () {
387
402
  return [
388
403
  4 /*yield*/,
389
404
  axios_1.default.get(
390
- this.feederGatewayUrl +
391
- '/get_transaction?transactionHash=' +
392
- (0, number_1.toHex)(txHashBn)
405
+ (0, url_join_1.default)(
406
+ this.feederGatewayUrl,
407
+ 'get_transaction',
408
+ '?transactionHash=' + (0, number_1.toHex)(txHashBn)
409
+ )
393
410
  ),
394
411
  ];
395
412
  case 1:
@@ -420,7 +437,7 @@ var Provider = /** @class */ (function () {
420
437
  return [
421
438
  4 /*yield*/,
422
439
  axios_1.default.post(
423
- this.gatewayUrl + '/add_transaction',
440
+ (0, url_join_1.default)(this.gatewayUrl, 'add_transaction'),
424
441
  (0, json_1.stringify)(
425
442
  __assign(
426
443
  __assign(
@@ -1,4 +1,5 @@
1
1
  import axios from 'axios';
2
+ import urljoin from 'url-join';
2
3
 
3
4
  import {
4
5
  AddTransactionResponse,
@@ -49,15 +50,15 @@ export class Provider implements ProviderInterface {
49
50
  ? optionsOrProvider.baseUrl
50
51
  : Provider.getNetworkFromName(optionsOrProvider.network);
51
52
  this.baseUrl = baseUrl;
52
- this.feederGatewayUrl = `${baseUrl}/feeder_gateway`;
53
- this.gatewayUrl = `${baseUrl}/gateway`;
53
+ this.feederGatewayUrl = urljoin(baseUrl, 'feeder_gateway');
54
+ this.gatewayUrl = urljoin(baseUrl, 'gateway');
54
55
  }
55
56
  }
56
57
 
57
58
  protected static getNetworkFromName(name: NetworkName) {
58
59
  switch (name) {
59
60
  case 'mainnet-alpha':
60
- return 'http://alpha-mainnet.starknet.io/';
61
+ return 'https://alpha-mainnet.starknet.io';
61
62
  case 'georli-alpha':
62
63
  default:
63
64
  return 'https://alpha4.starknet.io';
@@ -72,7 +73,7 @@ export class Provider implements ProviderInterface {
72
73
  */
73
74
  public async getContractAddresses(): Promise<GetContractAddressesResponse> {
74
75
  const { data } = await axios.get<GetContractAddressesResponse>(
75
- `${this.feederGatewayUrl}/get_contract_addresses`
76
+ urljoin(this.feederGatewayUrl, 'get_contract_addresses')
76
77
  );
77
78
  return data;
78
79
  }
@@ -91,7 +92,7 @@ export class Provider implements ProviderInterface {
91
92
  blockId?: number
92
93
  ): Promise<CallContractResponse> {
93
94
  const { data } = await axios.post<CallContractResponse>(
94
- `${this.feederGatewayUrl}/call_contract?blockId=${blockId ?? 'null'}`,
95
+ urljoin(this.feederGatewayUrl, 'call_contract', `?blockId=${blockId ?? 'null'}`),
95
96
  {
96
97
  signature: [],
97
98
  calldata: [],
@@ -111,7 +112,7 @@ export class Provider implements ProviderInterface {
111
112
  */
112
113
  public async getBlock(blockId?: number): Promise<GetBlockResponse> {
113
114
  const { data } = await axios.get<GetBlockResponse>(
114
- `${this.feederGatewayUrl}/get_block?blockId=${blockId ?? 'null'}`
115
+ urljoin(this.feederGatewayUrl, 'get_block', `?blockId=${blockId ?? 'null'}`)
115
116
  );
116
117
  return data;
117
118
  }
@@ -127,9 +128,11 @@ export class Provider implements ProviderInterface {
127
128
  */
128
129
  public async getCode(contractAddress: string, blockId?: number): Promise<GetCodeResponse> {
129
130
  const { data } = await axios.get<GetCodeResponse>(
130
- `${this.feederGatewayUrl}/get_code?contractAddress=${contractAddress}&blockId=${
131
- blockId ?? 'null'
132
- }`
131
+ urljoin(
132
+ this.feederGatewayUrl,
133
+ 'get_code',
134
+ `?contractAddress=${contractAddress}&blockId=${blockId ?? 'null'}`
135
+ )
133
136
  );
134
137
  return data;
135
138
  }
@@ -151,9 +154,11 @@ export class Provider implements ProviderInterface {
151
154
  blockId?: number
152
155
  ): Promise<object> {
153
156
  const { data } = await axios.get<object>(
154
- `${
155
- this.feederGatewayUrl
156
- }/get_storage_at?contractAddress=${contractAddress}&key=${key}&blockId=${blockId ?? 'null'}`
157
+ urljoin(
158
+ this.feederGatewayUrl,
159
+ 'get_storage_at',
160
+ `?contractAddress=${contractAddress}&key=${key}&blockId=${blockId ?? 'null'}`
161
+ )
157
162
  );
158
163
  return data;
159
164
  }
@@ -169,7 +174,11 @@ export class Provider implements ProviderInterface {
169
174
  public async getTransactionStatus(txHash: BigNumberish): Promise<GetTransactionStatusResponse> {
170
175
  const txHashBn = toBN(txHash);
171
176
  const { data } = await axios.get<GetTransactionStatusResponse>(
172
- `${this.feederGatewayUrl}/get_transaction_status?transactionHash=${toHex(txHashBn)}`
177
+ urljoin(
178
+ this.feederGatewayUrl,
179
+ 'get_transaction_status',
180
+ `?transactionHash=${toHex(txHashBn)}`
181
+ )
173
182
  );
174
183
  return data;
175
184
  }
@@ -185,7 +194,7 @@ export class Provider implements ProviderInterface {
185
194
  public async getTransaction(txHash: BigNumberish): Promise<GetTransactionResponse> {
186
195
  const txHashBn = toBN(txHash);
187
196
  const { data } = await axios.get<GetTransactionResponse>(
188
- `${this.feederGatewayUrl}/get_transaction?transactionHash=${toHex(txHashBn)}`
197
+ urljoin(this.feederGatewayUrl, 'get_transaction', `?transactionHash=${toHex(txHashBn)}`)
189
198
  );
190
199
  return data;
191
200
  }
@@ -203,7 +212,7 @@ export class Provider implements ProviderInterface {
203
212
  const contract_address_salt = tx.type === 'DEPLOY' && toHex(toBN(tx.contract_address_salt));
204
213
 
205
214
  const { data } = await axios.post<AddTransactionResponse>(
206
- `${this.gatewayUrl}/add_transaction`,
215
+ urljoin(this.gatewayUrl, 'add_transaction'),
207
216
  stringify({
208
217
  ...tx, // the tx can contain BigInts, so we use our own `stringify`
209
218
  ...(Array.isArray(signature) && { signature }), // not needed on deploy tx