@defuse-protocol/intents-sdk 0.18.0 → 0.19.1
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 +26 -0
- package/dist/index.cjs +482 -110
- package/dist/index.d.cts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.js +486 -99
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -785,6 +785,32 @@ XLM), the destination address must:
|
|
|
785
785
|
Note: This validation only applies to Stellar destinations via Hot Bridge. Other blockchains and routes don't require
|
|
786
786
|
trustline validation.
|
|
787
787
|
|
|
788
|
+
#### Omni Bridge Withdrawal Validation
|
|
789
|
+
|
|
790
|
+
Currently, in this SDK, Omni Bridge can be used only with tokens that are allowlisted by the Omni Relayer for fee payment. Additionally, before each transfer, the SDK verifies that the token exists on the destination chain.
|
|
791
|
+
|
|
792
|
+
```typescript
|
|
793
|
+
import { TokenNotSupportedByOmniRelayerError,TokenNotFoundInDestinationChainError } from '@defuse-protocol/intents-sdk';
|
|
794
|
+
|
|
795
|
+
try {
|
|
796
|
+
const result = await sdk.processWithdrawal({
|
|
797
|
+
withdrawalParams: {
|
|
798
|
+
assetId: 'nep141:aaaaaa20d9e0e2461697782ef11675f668207961.factory.bridge.near', // Aurora token
|
|
799
|
+
amount: 70000000000000000000n, // 70 Aurora (in smallest units)
|
|
800
|
+
destinationAddress: '0x741b0b0F27c4b4047ecFCcDf4690F749C6Cfd66c',
|
|
801
|
+
feeInclusive: false
|
|
802
|
+
}
|
|
803
|
+
});
|
|
804
|
+
} catch (error) {
|
|
805
|
+
if (error instanceof TokenNotSupportedByOmniRelayerError) {
|
|
806
|
+
console.log(`Omni Relayer cannot take the fee in ${error.token} for transfer finalization.`);
|
|
807
|
+
}
|
|
808
|
+
if (error instanceof TokenNotFoundInDestinationChainError) {
|
|
809
|
+
console.log(`Token ${error.token} was not found on ${error.destinationChain}.`);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
```
|
|
813
|
+
|
|
788
814
|
## Supported Networks
|
|
789
815
|
|
|
790
816
|
For a list of supported chains, see
|