@voidaisdk/bridge-sdk 0.0.5 → 1.0.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 +31 -27
- package/dist/config.js +3 -3
- package/dist-browser/voidai-sdk.js +1 -1
- package/package.json +6 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# VoidAI Bridge SDK
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/@voidaisdk/bridge-sdk)
|
|
4
4
|
[](https://opensource.org/licenses/MIT)
|
|
5
5
|
|
|
6
6
|
**TypeScript SDK for VoidAI Bridge** - Cross-chain asset bridging and routing across Bittensor, Ethereum, Solana, and other supported chains.
|
|
@@ -20,11 +20,11 @@ Perfect for building DeFi applications, cross-chain DEXs, or any app that needs
|
|
|
20
20
|
## 📦 Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm install
|
|
23
|
+
npm install @voidaisdk/bridge-sdk
|
|
24
24
|
# or
|
|
25
|
-
yarn add
|
|
25
|
+
yarn add @voidaisdk/bridge-sdk
|
|
26
26
|
# or
|
|
27
|
-
pnpm add
|
|
27
|
+
pnpm add @voidaisdk/bridge-sdk
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
### Requirements
|
|
@@ -38,7 +38,7 @@ pnpm add voidai-sdk
|
|
|
38
38
|
### 1. Initialize the SDK
|
|
39
39
|
|
|
40
40
|
```typescript
|
|
41
|
-
import { BridgeSDK } from '
|
|
41
|
+
import { BridgeSDK } from '@voidaisdk/bridge-sdk';
|
|
42
42
|
|
|
43
43
|
const sdk = new BridgeSDK({
|
|
44
44
|
apiKey: process.env.VOIDAI_API_KEY!,
|
|
@@ -170,12 +170,16 @@ console.log('Total fee:', swapFee.totalFee);
|
|
|
170
170
|
|
|
171
171
|
**📖 [Full Documentation](docs/README.md)** - Complete API reference, guides, and examples
|
|
172
172
|
|
|
173
|
-
- [Getting Started
|
|
174
|
-
- [
|
|
175
|
-
- [
|
|
176
|
-
- [
|
|
177
|
-
- [
|
|
178
|
-
- [
|
|
173
|
+
- [Getting Started](docs/getting-started.md) – Installation, authentication, configuration
|
|
174
|
+
- [Wallets](docs/wallets.md) – Bittensor, EVM, Solana wallet connections
|
|
175
|
+
- [Bridge Operations](docs/bridge.md) – Cross-chain bridging
|
|
176
|
+
- [Router Swaps](docs/swap.md) – Token swaps via VoidAI Router
|
|
177
|
+
- [CCIP Routing](docs/ccip.md) – Cross-chain CCIP operations
|
|
178
|
+
- [Transactions](docs/transactions.md) – History, cancel, confirm
|
|
179
|
+
- [Server-Side Usage](docs/server.md) – Backend integration with BridgeSDKServer
|
|
180
|
+
- [API Reference](docs/api-reference.md) – SDK methods and types
|
|
181
|
+
- [FAQ](docs/FAQ.md) – Frequently asked questions
|
|
182
|
+
- [Error Handling](docs/error-handling.md) – Troubleshooting and error codes
|
|
179
183
|
|
|
180
184
|
## 💡 Key Features
|
|
181
185
|
|
|
@@ -224,12 +228,12 @@ console.log('Total fee:', swapFee.totalFee);
|
|
|
224
228
|
For server-side or backend integrations, use `BridgeSDKServer` with both `apiKey` and `secretKey`:
|
|
225
229
|
|
|
226
230
|
```typescript
|
|
227
|
-
import { BridgeSDKServer } from '
|
|
231
|
+
import { BridgeSDKServer } from '@voidaisdk/bridge-sdk';
|
|
228
232
|
|
|
229
233
|
const sdk = new BridgeSDKServer({
|
|
230
234
|
apiKey: process.env.VOIDAI_API_KEY!,
|
|
231
235
|
secretKey: process.env.VOIDAI_SECRET_KEY!,
|
|
232
|
-
environment: '
|
|
236
|
+
environment: 'mainnet', // 'devnet' | 'testnet' | 'mainnet'
|
|
233
237
|
});
|
|
234
238
|
|
|
235
239
|
await sdk.ready;
|
|
@@ -245,24 +249,24 @@ const result = await sdk.bridge.bridge({
|
|
|
245
249
|
|
|
246
250
|
## 🔧 Environment Configuration
|
|
247
251
|
|
|
248
|
-
The SDK supports three environments
|
|
252
|
+
The SDK supports three environments. The base URL and EVM bridge contract address are set per environment in the SDK config.
|
|
249
253
|
|
|
250
|
-
| Environment
|
|
251
|
-
|
|
|
252
|
-
| `
|
|
253
|
-
| `
|
|
254
|
-
| `
|
|
254
|
+
| Environment | Base URL | Bridge Contract (EVM) | Use Case |
|
|
255
|
+
| ----------- | ------------------------------------------------------ | ------------------------------------------- | -------------------------- |
|
|
256
|
+
| `devnet` | `https://api-sdk-dev.voidai.envistudios.com/api` | `0x6266ce15aC4f32F096Ff91881dd887a0F4bBa569` | Development & testing |
|
|
257
|
+
| `testnet` | `https://sdk-backend.voidai.com/sdk` | `0x4aA4396BfD6F268b427077079800F420dF947b63` | Staging / pre-production |
|
|
258
|
+
| `mainnet` | `https://sdk.voidai.com/sdk` | `0x604e8Ef901C0E69E79463D997ba7D0724A909b84` | Production |
|
|
255
259
|
|
|
256
260
|
## 📝 Example: Complete Bridge Flow
|
|
257
261
|
|
|
258
262
|
```typescript
|
|
259
|
-
import { BridgeSDK } from '
|
|
263
|
+
import { BridgeSDK } from '@voidaisdk/bridge-sdk';
|
|
260
264
|
|
|
261
265
|
async function bridgeTAO() {
|
|
262
266
|
// 1. Initialize SDK
|
|
263
267
|
const sdk = new BridgeSDK({
|
|
264
268
|
apiKey: process.env.VOIDAI_API_KEY!,
|
|
265
|
-
environment: '
|
|
269
|
+
environment: 'testnet', // or 'mainnet' for production
|
|
266
270
|
});
|
|
267
271
|
|
|
268
272
|
await sdk.ready;
|
|
@@ -365,11 +369,11 @@ bridge-sdk/
|
|
|
365
369
|
|
|
366
370
|
```html
|
|
367
371
|
<script type="module">
|
|
368
|
-
import { BridgeSDK } from './node_modules/
|
|
372
|
+
import { BridgeSDK } from './node_modules/@voidaisdk/bridge-sdk/dist-browser/voidai-sdk.js';
|
|
369
373
|
|
|
370
374
|
const sdk = new BridgeSDK({
|
|
371
375
|
apiKey: 'your-api-key',
|
|
372
|
-
environment: '
|
|
376
|
+
environment: 'mainnet', // 'devnet' | 'testnet' | 'mainnet'
|
|
373
377
|
});
|
|
374
378
|
</script>
|
|
375
379
|
```
|
|
@@ -377,10 +381,10 @@ bridge-sdk/
|
|
|
377
381
|
### Bundler (Webpack/Vite/Rollup)
|
|
378
382
|
|
|
379
383
|
```typescript
|
|
380
|
-
import { BridgeSDK } from '
|
|
384
|
+
import { BridgeSDK } from '@voidaisdk/bridge-sdk';
|
|
381
385
|
|
|
382
386
|
// Use normally - bundler will handle it
|
|
383
|
-
const sdk = new BridgeSDK({ apiKey, environment: '
|
|
387
|
+
const sdk = new BridgeSDK({ apiKey, environment: 'mainnet' }); // 'devnet' | 'testnet' | 'mainnet'
|
|
384
388
|
```
|
|
385
389
|
|
|
386
390
|
## ⚠️ Error Handling
|
|
@@ -412,7 +416,7 @@ See [Error Handling Guide](docs/error-handling.md) for detailed patterns.
|
|
|
412
416
|
- ✅ **Validate user inputs** before passing to SDK
|
|
413
417
|
- ✅ **Keep dependencies updated** - Monitor security advisories
|
|
414
418
|
|
|
415
|
-
See [
|
|
419
|
+
See [Full Documentation](docs/README.md) for more guidance.
|
|
416
420
|
|
|
417
421
|
## 📖 Examples
|
|
418
422
|
|
|
@@ -429,7 +433,7 @@ Check out the [example frontend app](examples/frontend/) for a complete integrat
|
|
|
429
433
|
|
|
430
434
|
- **Documentation**: [Full docs](docs/README.md)
|
|
431
435
|
- **Issues**: [GitHub Issues](https://github.com/your-org/bridge-sdk/issues)
|
|
432
|
-
- **FAQ**: [
|
|
436
|
+
- **FAQ**: [FAQ](docs/FAQ.md)
|
|
433
437
|
|
|
434
438
|
## 📄 License
|
|
435
439
|
|
package/dist/config.js
CHANGED
|
@@ -31,11 +31,11 @@ BridgeConfig.DEFAULTS = {
|
|
|
31
31
|
bridgeContractAddress: '0x6266ce15aC4f32F096Ff91881dd887a0F4bBa569',
|
|
32
32
|
},
|
|
33
33
|
testnet: {
|
|
34
|
-
baseUrl: 'https://sdk-backend.voidai.com/
|
|
34
|
+
baseUrl: 'https://sdk-backend.voidai.com/sdk',
|
|
35
35
|
bridgeContractAddress: '0x4aA4396BfD6F268b427077079800F420dF947b63',
|
|
36
36
|
},
|
|
37
37
|
mainnet: {
|
|
38
|
-
baseUrl: 'https://
|
|
39
|
-
bridgeContractAddress: '
|
|
38
|
+
baseUrl: 'https://sdk.voidai.com/sdk',
|
|
39
|
+
bridgeContractAddress: '0x604e8Ef901C0E69E79463D997ba7D0724A909b84',
|
|
40
40
|
},
|
|
41
41
|
};
|