@rhea-finance/cross-chain-sdk 0.1.18 → 0.1.19
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 +9 -0
- package/dist/index.cjs +336 -165
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -5
- package/dist/index.d.ts +28 -5
- package/dist/index.js +334 -164
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1181,12 +1181,14 @@ if (
|
|
|
1181
1181
|
- `setSdkEnv` - Switch SDK environment between `prd` and `stg`
|
|
1182
1182
|
- `getSdkEnv` - Get current SDK environment
|
|
1183
1183
|
- `setCustomNodeUrl` - Set custom RPC node URL for NEAR chain. This function allows you to customize the RPC endpoint used for NEAR chain interactions.
|
|
1184
|
+
- `setCustomNodeUrls` - Set multiple custom NEAR RPC node URLs. The SDK falls back to the next URL when the active RPC is rate limited or unavailable.
|
|
1184
1185
|
|
|
1185
1186
|
```typescript
|
|
1186
1187
|
import {
|
|
1187
1188
|
setSdkEnv,
|
|
1188
1189
|
getSdkEnv,
|
|
1189
1190
|
setCustomNodeUrl,
|
|
1191
|
+
setCustomNodeUrls,
|
|
1190
1192
|
} from "@rhea-finance/cross-chain-sdk";
|
|
1191
1193
|
|
|
1192
1194
|
// Default environment is prd
|
|
@@ -1202,12 +1204,19 @@ console.log(getSdkEnv()); // "prd"
|
|
|
1202
1204
|
|
|
1203
1205
|
// Set custom NEAR RPC node URL for the current environment
|
|
1204
1206
|
setCustomNodeUrl("https://your-custom-near-rpc-url.com");
|
|
1207
|
+
|
|
1208
|
+
// Set custom NEAR RPC failover URLs for the current environment
|
|
1209
|
+
setCustomNodeUrls([
|
|
1210
|
+
"https://your-primary-near-rpc-url.com",
|
|
1211
|
+
"https://your-secondary-near-rpc-url.com",
|
|
1212
|
+
]);
|
|
1205
1213
|
```
|
|
1206
1214
|
|
|
1207
1215
|
Notes:
|
|
1208
1216
|
- The default SDK environment is `prd`.
|
|
1209
1217
|
- `setSdkEnv("stg" | "prd")` only switches the SDK environment.
|
|
1210
1218
|
- `setCustomNodeUrl(...)` only overrides the NEAR RPC URL of the current environment and does not switch between `stg` and `prd`.
|
|
1219
|
+
- By default, NEAR view and balance calls use `https://free.rpc.fastnear.com` first and fall back to `https://nearinner.deltarpc.com` on transient failures such as HTTP 429, HTTP 408, HTTP 5xx, or network errors.
|
|
1211
1220
|
|
|
1212
1221
|
### Type Definitions
|
|
1213
1222
|
|