@voidaisdk/bridge-sdk 0.0.4 → 0.0.5

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.
@@ -40,7 +40,7 @@ class VoidAIBridgeClient {
40
40
  getLoginUrl() {
41
41
  const baseUrl = this.config.getBaseUrl();
42
42
  const cleanBase = baseUrl.replace(/\/$/, '');
43
- return `${cleanBase}/api/v1/auth/login`;
43
+ return `${cleanBase}/v1/auth/login`;
44
44
  }
45
45
  /**
46
46
  * Get EVM bridge contract address for burn operations.
@@ -222,7 +222,7 @@ class VoidAIBridgeClient {
222
222
  * Bridge swap operation
223
223
  */
224
224
  async bridgeSwap(payload) {
225
- return this.post('api/v1/bridge/swap', payload);
225
+ return this.post('v1/bridge/swap', payload);
226
226
  }
227
227
  /**
228
228
  * Route transaction operation (SWAP / BRIDGE / CCIP)
@@ -234,7 +234,7 @@ class VoidAIBridgeClient {
234
234
  ...payload,
235
235
  amount: String(payload.amount),
236
236
  };
237
- return this.post('api/v1/bridge/route-transaction', normalizedPayload);
237
+ return this.post('v1/bridge/route-transaction', normalizedPayload);
238
238
  }
239
239
  /**
240
240
  * Cancel a CCIP route transaction
@@ -246,7 +246,7 @@ class VoidAIBridgeClient {
246
246
  toToken: params.toToken,
247
247
  uuid: params.uuid,
248
248
  };
249
- return this.delete('api/v1/bridge/cancel-ccip', queryParams);
249
+ return this.delete('v1/bridge/cancel-ccip', queryParams);
250
250
  }
251
251
  /**
252
252
  * Cancel a router swap transaction
@@ -255,13 +255,13 @@ class VoidAIBridgeClient {
255
255
  const queryParams = {
256
256
  uuid: params.uuid,
257
257
  };
258
- return this.delete('api/v1/bridge/cancel-router-swap', queryParams);
258
+ return this.delete('v1/bridge/cancel-router-swap', queryParams);
259
259
  }
260
260
  /**
261
261
  * Cancel a bridge swap transaction
262
262
  */
263
263
  async cancelBridgeSwap(params) {
264
- return this.patch('api/v1/bridge/swap/cancel', params);
264
+ return this.patch('v1/bridge/swap/cancel', params);
265
265
  }
266
266
  /**
267
267
  * Get recent API transactions (tenant-level)
@@ -271,19 +271,19 @@ class VoidAIBridgeClient {
271
271
  page: String(page),
272
272
  limit: String(limit),
273
273
  };
274
- return this.get('api/v1/bridge/api-transactions', queryParams);
274
+ return this.get('v1/bridge/api-transactions', queryParams);
275
275
  }
276
276
  /**
277
277
  * Manually validate a bridge burn transaction (EVM burn completion)
278
278
  */
279
279
  async validateBurn(params) {
280
- return this.post('api/v1/bridge/validate-burn', params);
280
+ return this.post('v1/bridge/validate-burn', params);
281
281
  }
282
282
  /**
283
283
  * Manually confirm a CCIP transaction
284
284
  */
285
285
  async confirmCcipTransaction(params) {
286
- const path = `api/v1/bridge/transactions/${encodeURIComponent(params.transactionId)}/tx`;
286
+ const path = `v1/bridge/transactions/${encodeURIComponent(params.transactionId)}/tx`;
287
287
  const body = {
288
288
  txnHash: params.txnHash,
289
289
  operationType: params.operationType,
@@ -309,7 +309,7 @@ class VoidAIBridgeClient {
309
309
  if (options?.chainId !== undefined) {
310
310
  params.chain_id = options.chainId;
311
311
  }
312
- const response = await this.get('api/v1/chain/chains', params);
312
+ const response = await this.get('v1/chain/chains', params);
313
313
  if (!response.success || !response.data) {
314
314
  throw new Error(response.message || 'Failed to fetch chains');
315
315
  }
@@ -323,7 +323,7 @@ class VoidAIBridgeClient {
323
323
  page: String(page),
324
324
  limit: String(limit),
325
325
  };
326
- const response = await this.get('api/v1/asset/assets', queryParams);
326
+ const response = await this.get('v1/asset/assets', queryParams);
327
327
  if (!response.success || !response.data) {
328
328
  throw new Error(response.message || 'Failed to fetch assets');
329
329
  }
@@ -343,7 +343,7 @@ class VoidAIBridgeClient {
343
343
  toToken: params.toToken,
344
344
  amount: String(params.amount),
345
345
  };
346
- return this.get('api/v1/bridge/call-fee', queryParams);
346
+ return this.get('v1/bridge/call-fee', queryParams);
347
347
  }
348
348
  /**
349
349
  * Get router swap fee estimate
@@ -357,7 +357,7 @@ class VoidAIBridgeClient {
357
357
  operationType: params.operationType,
358
358
  toAddress: params.toAddress,
359
359
  };
360
- return this.get('api/v1/router-swap/call-fee', queryParams);
360
+ return this.get('v1/router-swap/call-fee', queryParams);
361
361
  }
362
362
  /**
363
363
  * Normalize and rethrow errors with backend message (if available) so
package/dist/config.js CHANGED
@@ -27,15 +27,15 @@ class BridgeConfig {
27
27
  exports.BridgeConfig = BridgeConfig;
28
28
  BridgeConfig.DEFAULTS = {
29
29
  devnet: {
30
- baseUrl: 'https://api-sdk-dev.voidai.envistudios.com/',
30
+ baseUrl: 'https://api-sdk-dev.voidai.envistudios.com/api',
31
31
  bridgeContractAddress: '0x6266ce15aC4f32F096Ff91881dd887a0F4bBa569',
32
32
  },
33
33
  testnet: {
34
- baseUrl: 'https://sdk-backend.voidai.com/',
34
+ baseUrl: 'https://sdk-backend.voidai.com/api',
35
35
  bridgeContractAddress: '0x4aA4396BfD6F268b427077079800F420dF947b63',
36
36
  },
37
37
  mainnet: {
38
- baseUrl: 'https://api-sdk.voidai.envistudios.com/',
39
- bridgeContractAddress: '0x604e8Ef901C0E69E79463D997ba7D0724A909b84',
38
+ baseUrl: 'https://d45byonnywfx1.cloudfront.net/sdk',
39
+ bridgeContractAddress: '0x4aA4396BfD6F268b427077079800F420dF947b63',
40
40
  },
41
41
  };