@defuse-protocol/intents-sdk 0.16.0 → 0.16.2
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 +10 -1
- package/dist/index.cjs +10 -0
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +5 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -154,6 +154,7 @@ Examples:
|
|
|
154
154
|
- `nep141:wrap.near` - Wrapped NEAR (native NEAR)
|
|
155
155
|
- `nep245:v2_1.omni.hot.tg:137_qiStmoQJDQPTebaPjgx5VBxZv6L` - Polygon USDC through Hot
|
|
156
156
|
- `nep141:base-0x833589fcd6edb6e08f4c7c32d4f71b54bda02913.omft.near` - Base USDC through PoA
|
|
157
|
+
- `nep141:sol.omdep.near` - SOL bridged through Omni Bridge
|
|
157
158
|
|
|
158
159
|
### Intent Execution
|
|
159
160
|
|
|
@@ -190,7 +191,7 @@ Deposit funds into Near Intents *(Coming Soon)*.
|
|
|
190
191
|
Complete withdrawal functionality from Near Intents to external chains:
|
|
191
192
|
|
|
192
193
|
- **Cross-Chain Transfers**: Withdraw to 20+ supported blockchains
|
|
193
|
-
- **Multi-Bridge Support**: Hot Bridge, PoA Bridge
|
|
194
|
+
- **Multi-Bridge Support**: Hot Bridge, PoA Bridge, Omni Bridge
|
|
194
195
|
- **Batch Processing**: Process multiple withdrawals at a time
|
|
195
196
|
- **Fee Management**: Automatic fee estimation with quote support
|
|
196
197
|
- **Validation**: Built-in validation for withdrawal constraints
|
|
@@ -222,6 +223,7 @@ import {RouteEnum} from '@defuse-protocol/intents-sdk';
|
|
|
222
223
|
|
|
223
224
|
console.log(RouteEnum.HotBridge); // "hot_bridge" - Cross-chain via HOT protocol
|
|
224
225
|
console.log(RouteEnum.PoaBridge); // "poa_bridge" - Cross-chain via PoA bridge
|
|
226
|
+
console.log(RouteEnum.OmniBridge); // "omni_bridge" - Cross-chain via Omni bridge
|
|
225
227
|
console.log(RouteEnum.NearWithdrawal); // "near_withdrawal" - Direct to NEAR blockchain
|
|
226
228
|
console.log(RouteEnum.VirtualChain); // "virtual_chain" - To Aurora Engine chains
|
|
227
229
|
console.log(RouteEnum.InternalTransfer); // "internal_transfer" - Between protocol users
|
|
@@ -237,6 +239,7 @@ import {BridgeNameEnum} from '@defuse-protocol/intents-sdk';
|
|
|
237
239
|
|
|
238
240
|
console.log(BridgeNameEnum.Hot); // "hot" - HOT Labs bridge infrastructure
|
|
239
241
|
console.log(BridgeNameEnum.Poa); // "poa" - Proof-of-Authority bridge by Defuse Labs
|
|
242
|
+
console.log(BridgeNameEnum.Omni); // "omni" - Omni bridge by NEAR
|
|
240
243
|
console.log(BridgeNameEnum.None); // null - No external bridge (NEAR-native or internal)
|
|
241
244
|
```
|
|
242
245
|
|
|
@@ -266,6 +269,12 @@ The SDK automatically detects and supports multiple route types based on asset i
|
|
|
266
269
|
- **Use Case**: Cross-chain transfers for assets bridged through PoA protocol
|
|
267
270
|
- **Route Type**: `poa_bridge`
|
|
268
271
|
|
|
272
|
+
##### Omni Bridge Route
|
|
273
|
+
- **Purpose**: multi-chain asset bridge developed by Near
|
|
274
|
+
- **Supported Assets**: Fungible tokens (NEP-141) supported by omni bridge relayer.
|
|
275
|
+
- **Use Case**: multi-chain transfers for supported list of chains
|
|
276
|
+
- **Route Type**: `omni_bridge`
|
|
277
|
+
|
|
269
278
|
##### Internal Transfer Route
|
|
270
279
|
|
|
271
280
|
- **Purpose**: Transfer between Near Intents users within the protocol
|
package/dist/index.cjs
CHANGED
|
@@ -42,6 +42,8 @@ __export(index_exports, {
|
|
|
42
42
|
IntentSettlementError: () => import_internal_utils25.IntentSettlementError,
|
|
43
43
|
IntentsSDK: () => IntentsSDK,
|
|
44
44
|
MinWithdrawalAmountError: () => MinWithdrawalAmountError,
|
|
45
|
+
OmniTransferDestinationChainHashNotFoundError: () => OmniTransferDestinationChainHashNotFoundError,
|
|
46
|
+
OmniTransferNotFoundError: () => OmniTransferNotFoundError,
|
|
45
47
|
PoaWithdrawalInvariantError: () => import_internal_utils22.PoaWithdrawalInvariantError,
|
|
46
48
|
PoaWithdrawalNotFoundError: () => import_internal_utils22.PoaWithdrawalNotFoundError,
|
|
47
49
|
PoaWithdrawalPendingError: () => import_internal_utils22.PoaWithdrawalPendingError,
|
|
@@ -50,6 +52,8 @@ __export(index_exports, {
|
|
|
50
52
|
RouteEnum: () => RouteEnum,
|
|
51
53
|
RpcRequestError: () => import_internal_utils23.RpcRequestError,
|
|
52
54
|
TimeoutError: () => import_internal_utils23.TimeoutError,
|
|
55
|
+
TokenNotFoundInDestinationChainError: () => TokenNotFoundInDestinationChainError,
|
|
56
|
+
TokenNotSupportedByOmniRelayerError: () => TokenNotSupportedByOmniRelayerError,
|
|
53
57
|
TrustlineNotFoundError: () => TrustlineNotFoundError,
|
|
54
58
|
UnsupportedDestinationMemoError: () => UnsupportedDestinationMemoError,
|
|
55
59
|
createDefaultRoute: () => createDefaultRoute,
|
|
@@ -59,6 +63,7 @@ __export(index_exports, {
|
|
|
59
63
|
createIntentSignerViem: () => createIntentSignerViem,
|
|
60
64
|
createInternalTransferRoute: () => createInternalTransferRoute,
|
|
61
65
|
createNearWithdrawalRoute: () => createNearWithdrawalRoute,
|
|
66
|
+
createOmniWithdrawalRoute: () => createOmniWithdrawalRoute,
|
|
62
67
|
createPoaBridgeRoute: () => createPoaBridgeRoute,
|
|
63
68
|
createVirtualChainRoute: () => createVirtualChainRoute
|
|
64
69
|
});
|
|
@@ -2448,6 +2453,8 @@ var import_internal_utils25 = require("@defuse-protocol/internal-utils");
|
|
|
2448
2453
|
IntentSettlementError,
|
|
2449
2454
|
IntentsSDK,
|
|
2450
2455
|
MinWithdrawalAmountError,
|
|
2456
|
+
OmniTransferDestinationChainHashNotFoundError,
|
|
2457
|
+
OmniTransferNotFoundError,
|
|
2451
2458
|
PoaWithdrawalInvariantError,
|
|
2452
2459
|
PoaWithdrawalNotFoundError,
|
|
2453
2460
|
PoaWithdrawalPendingError,
|
|
@@ -2456,6 +2463,8 @@ var import_internal_utils25 = require("@defuse-protocol/internal-utils");
|
|
|
2456
2463
|
RouteEnum,
|
|
2457
2464
|
RpcRequestError,
|
|
2458
2465
|
TimeoutError,
|
|
2466
|
+
TokenNotFoundInDestinationChainError,
|
|
2467
|
+
TokenNotSupportedByOmniRelayerError,
|
|
2459
2468
|
TrustlineNotFoundError,
|
|
2460
2469
|
UnsupportedDestinationMemoError,
|
|
2461
2470
|
createDefaultRoute,
|
|
@@ -2465,6 +2474,7 @@ var import_internal_utils25 = require("@defuse-protocol/internal-utils");
|
|
|
2465
2474
|
createIntentSignerViem,
|
|
2466
2475
|
createInternalTransferRoute,
|
|
2467
2476
|
createNearWithdrawalRoute,
|
|
2477
|
+
createOmniWithdrawalRoute,
|
|
2468
2478
|
createPoaBridgeRoute,
|
|
2469
2479
|
createVirtualChainRoute
|
|
2470
2480
|
});
|
package/dist/index.d.cts
CHANGED
|
@@ -427,6 +427,7 @@ declare function createIntentSignerViem(config: IntentSignerViemConfig): IIntent
|
|
|
427
427
|
|
|
428
428
|
declare function createInternalTransferRoute(): InternalTransferRouteConfig;
|
|
429
429
|
declare function createNearWithdrawalRoute(msg?: string): NearWithdrawalRouteConfig;
|
|
430
|
+
declare function createOmniWithdrawalRoute(): OmniBridgeRouteConfig;
|
|
430
431
|
declare function createVirtualChainRoute(auroraEngineContractId: string, proxyTokenContractId: string | null): VirtualChainRouteConfig;
|
|
431
432
|
declare function createPoaBridgeRoute(chain: Chain): PoaBridgeRouteConfig;
|
|
432
433
|
declare function createHotBridgeRoute(chain: Chain): HotBridgeRouteConfig;
|
|
@@ -493,4 +494,34 @@ declare class HotWithdrawalCancelledError extends BaseError {
|
|
|
493
494
|
constructor(txHash: string, index: number);
|
|
494
495
|
}
|
|
495
496
|
|
|
496
|
-
|
|
497
|
+
type OmniTransferNotFoundErrorType = OmniTransferNotFoundError & {
|
|
498
|
+
name: "OmniTransferNotFoundError";
|
|
499
|
+
};
|
|
500
|
+
declare class OmniTransferNotFoundError extends BaseError {
|
|
501
|
+
txHash: string;
|
|
502
|
+
constructor(txHash: string);
|
|
503
|
+
}
|
|
504
|
+
type OmniTransferDestinationChainHashNotFoundErrorType = OmniTransferDestinationChainHashNotFoundError & {
|
|
505
|
+
name: "OmniTransferDestinationChainHashNotFoundError";
|
|
506
|
+
};
|
|
507
|
+
declare class OmniTransferDestinationChainHashNotFoundError extends BaseError {
|
|
508
|
+
txHash: string;
|
|
509
|
+
destinationChain: string | undefined;
|
|
510
|
+
constructor(txHash: string, destinationChain: string | undefined);
|
|
511
|
+
}
|
|
512
|
+
type TokenNotSupportedByOmniRelayerErrorType = TokenNotSupportedByOmniRelayerError & {
|
|
513
|
+
name: "TokenNotSupportedByOmniRelayerError";
|
|
514
|
+
};
|
|
515
|
+
declare class TokenNotSupportedByOmniRelayerError extends BaseError {
|
|
516
|
+
token: string;
|
|
517
|
+
constructor(token: string);
|
|
518
|
+
}
|
|
519
|
+
type TokenNotFoundInDestinationChainErrorType = TokenNotFoundInDestinationChainError & {
|
|
520
|
+
name: "TokenNotFoundInDestinationChainError";
|
|
521
|
+
};
|
|
522
|
+
declare class TokenNotFoundInDestinationChainError extends BaseError {
|
|
523
|
+
token: string;
|
|
524
|
+
constructor(token: string, chainKind: Chain);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export { type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, type IIntentSigner, type IntentPayload, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, type IntentSettlementStatus, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, type ProcessWithdrawalArgs, type RouteConfig, RouteEnum, type RouteEnumValues, type SignAndSendWithdrawalArgs, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TokenNotSupportedByOmniRelayerError, type TokenNotSupportedByOmniRelayerErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniWithdrawalRoute, createPoaBridgeRoute, createVirtualChainRoute };
|
package/dist/index.d.ts
CHANGED
|
@@ -427,6 +427,7 @@ declare function createIntentSignerViem(config: IntentSignerViemConfig): IIntent
|
|
|
427
427
|
|
|
428
428
|
declare function createInternalTransferRoute(): InternalTransferRouteConfig;
|
|
429
429
|
declare function createNearWithdrawalRoute(msg?: string): NearWithdrawalRouteConfig;
|
|
430
|
+
declare function createOmniWithdrawalRoute(): OmniBridgeRouteConfig;
|
|
430
431
|
declare function createVirtualChainRoute(auroraEngineContractId: string, proxyTokenContractId: string | null): VirtualChainRouteConfig;
|
|
431
432
|
declare function createPoaBridgeRoute(chain: Chain): PoaBridgeRouteConfig;
|
|
432
433
|
declare function createHotBridgeRoute(chain: Chain): HotBridgeRouteConfig;
|
|
@@ -493,4 +494,34 @@ declare class HotWithdrawalCancelledError extends BaseError {
|
|
|
493
494
|
constructor(txHash: string, index: number);
|
|
494
495
|
}
|
|
495
496
|
|
|
496
|
-
|
|
497
|
+
type OmniTransferNotFoundErrorType = OmniTransferNotFoundError & {
|
|
498
|
+
name: "OmniTransferNotFoundError";
|
|
499
|
+
};
|
|
500
|
+
declare class OmniTransferNotFoundError extends BaseError {
|
|
501
|
+
txHash: string;
|
|
502
|
+
constructor(txHash: string);
|
|
503
|
+
}
|
|
504
|
+
type OmniTransferDestinationChainHashNotFoundErrorType = OmniTransferDestinationChainHashNotFoundError & {
|
|
505
|
+
name: "OmniTransferDestinationChainHashNotFoundError";
|
|
506
|
+
};
|
|
507
|
+
declare class OmniTransferDestinationChainHashNotFoundError extends BaseError {
|
|
508
|
+
txHash: string;
|
|
509
|
+
destinationChain: string | undefined;
|
|
510
|
+
constructor(txHash: string, destinationChain: string | undefined);
|
|
511
|
+
}
|
|
512
|
+
type TokenNotSupportedByOmniRelayerErrorType = TokenNotSupportedByOmniRelayerError & {
|
|
513
|
+
name: "TokenNotSupportedByOmniRelayerError";
|
|
514
|
+
};
|
|
515
|
+
declare class TokenNotSupportedByOmniRelayerError extends BaseError {
|
|
516
|
+
token: string;
|
|
517
|
+
constructor(token: string);
|
|
518
|
+
}
|
|
519
|
+
type TokenNotFoundInDestinationChainErrorType = TokenNotFoundInDestinationChainError & {
|
|
520
|
+
name: "TokenNotFoundInDestinationChainError";
|
|
521
|
+
};
|
|
522
|
+
declare class TokenNotFoundInDestinationChainError extends BaseError {
|
|
523
|
+
token: string;
|
|
524
|
+
constructor(token: string, chainKind: Chain);
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
export { type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, type IIntentSigner, type IntentPayload, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, type IntentSettlementStatus, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, type ProcessWithdrawalArgs, type RouteConfig, RouteEnum, type RouteEnumValues, type SignAndSendWithdrawalArgs, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TokenNotSupportedByOmniRelayerError, type TokenNotSupportedByOmniRelayerErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniWithdrawalRoute, createPoaBridgeRoute, createVirtualChainRoute };
|
package/dist/index.js
CHANGED
|
@@ -2450,6 +2450,8 @@ export {
|
|
|
2450
2450
|
IntentSettlementError,
|
|
2451
2451
|
IntentsSDK,
|
|
2452
2452
|
MinWithdrawalAmountError,
|
|
2453
|
+
OmniTransferDestinationChainHashNotFoundError,
|
|
2454
|
+
OmniTransferNotFoundError,
|
|
2453
2455
|
PoaWithdrawalInvariantError,
|
|
2454
2456
|
PoaWithdrawalNotFoundError,
|
|
2455
2457
|
PoaWithdrawalPendingError,
|
|
@@ -2458,6 +2460,8 @@ export {
|
|
|
2458
2460
|
RouteEnum,
|
|
2459
2461
|
RpcRequestError,
|
|
2460
2462
|
TimeoutError,
|
|
2463
|
+
TokenNotFoundInDestinationChainError,
|
|
2464
|
+
TokenNotSupportedByOmniRelayerError,
|
|
2461
2465
|
TrustlineNotFoundError,
|
|
2462
2466
|
UnsupportedDestinationMemoError,
|
|
2463
2467
|
createDefaultRoute,
|
|
@@ -2467,6 +2471,7 @@ export {
|
|
|
2467
2471
|
createIntentSignerViem,
|
|
2468
2472
|
createInternalTransferRoute,
|
|
2469
2473
|
createNearWithdrawalRoute,
|
|
2474
|
+
createOmniWithdrawalRoute,
|
|
2470
2475
|
createPoaBridgeRoute,
|
|
2471
2476
|
createVirtualChainRoute
|
|
2472
2477
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defuse-protocol/intents-sdk",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@near-js/accounts": "^2.0.1",
|
|
35
35
|
"@near-js/keystores": "^2.0.1",
|
|
36
36
|
"@defuse-protocol/contract-types": "0.0.3",
|
|
37
|
-
"@defuse-protocol/internal-utils": "0.
|
|
37
|
+
"@defuse-protocol/internal-utils": "0.8.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@biomejs/biome": "1.9.4",
|