@chainrails/sdk 0.0.6 → 0.0.8
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
|
@@ -31,7 +31,7 @@ yarn add @chainrails/sdk
|
|
|
31
31
|
### 1. Initialize the SDK
|
|
32
32
|
|
|
33
33
|
```typescript
|
|
34
|
-
import crapi,
|
|
34
|
+
import { crapi, Chainrails} from "@chainrails/sdk"
|
|
35
35
|
|
|
36
36
|
// Configure with your API key
|
|
37
37
|
Chainrails.config({
|
|
@@ -472,7 +472,7 @@ The SDK automatically retries failed requests up to 2 times.
|
|
|
472
472
|
### Example 1: Create Intent and Monitor Status
|
|
473
473
|
|
|
474
474
|
```typescript
|
|
475
|
-
import crapi,
|
|
475
|
+
import { crapi, Chainrails } from "@chainrails/sdk"
|
|
476
476
|
|
|
477
477
|
Chainrails.config({ api_key: "your_api_key" })
|
|
478
478
|
|
|
@@ -495,7 +495,7 @@ console.log("Updated status:", updated.intent_status)
|
|
|
495
495
|
### Example 2: Compare Quotes Across Bridges
|
|
496
496
|
|
|
497
497
|
```typescript
|
|
498
|
-
import crapi from "@chainrails/sdk"
|
|
498
|
+
import { crapi } from "@chainrails/sdk"
|
|
499
499
|
|
|
500
500
|
const quotes = await crapi.quotes.getFromAllBridges({
|
|
501
501
|
tokenIn: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
@@ -520,7 +520,7 @@ console.log("Best quote total fee:", best.bestQuote.totalFeeFormatted)
|
|
|
520
520
|
### Example 3: Find Optimal Route
|
|
521
521
|
|
|
522
522
|
```typescript
|
|
523
|
-
import crapi from "@chainrails/sdk"
|
|
523
|
+
import { crapi } from "@chainrails/sdk"
|
|
524
524
|
|
|
525
525
|
const route = await crapi.router.getOptimalRoutes({
|
|
526
526
|
tokenIn: "0xA0b86a33E6411192B1F4ec3eB801B21EB56",
|
|
@@ -536,7 +536,7 @@ console.log("Optimal route:", route)
|
|
|
536
536
|
### Example 4: List All User Intents
|
|
537
537
|
|
|
538
538
|
```typescript
|
|
539
|
-
import crapi from "@chainrails/sdk"
|
|
539
|
+
import { crapi } from "@chainrails/sdk"
|
|
540
540
|
|
|
541
541
|
const userAddress = "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb"
|
|
542
542
|
const intents = await crapi.intents.getForSender(userAddress)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getSupportedInput } from "./types";
|
|
2
2
|
export default class Chains {
|
|
3
|
-
getSupported(input
|
|
3
|
+
getSupported(input?: getSupportedInput): Promise<string[]>;
|
|
4
4
|
}
|
|
5
5
|
export * from "./types";
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chains/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,MAAM;IACnB,YAAY,CAAC,KAAK,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Chains/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,MAAM,CAAC,OAAO,OAAO,MAAM;IACnB,YAAY,CAAC,KAAK,CAAC,EAAE,iBAAiB;CAG7C;AAED,cAAc,SAAS,CAAA"}
|