@defuse-protocol/intents-sdk 0.60.0 → 0.61.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/dist/src/bridges/omni-bridge/omni-bridge-utils.cjs +3 -2
- package/dist/src/bridges/omni-bridge/omni-bridge-utils.js +3 -2
- package/dist/src/lib/caip2.cjs +2 -1
- package/dist/src/lib/caip2.d.cts +1 -0
- package/dist/src/lib/caip2.d.ts +1 -0
- package/dist/src/lib/caip2.js +2 -1
- package/dist/src/lib/validateAddress.cjs +2 -1
- package/dist/src/lib/validateAddress.js +2 -1
- package/package.json +3 -3
|
@@ -62,7 +62,8 @@ const CHAIN_MAPPINGS = [
|
|
|
62
62
|
[require_caip2.Chains.Arbitrum, _omni_bridge_core.ChainKind.Arb],
|
|
63
63
|
[require_caip2.Chains.Solana, _omni_bridge_core.ChainKind.Sol],
|
|
64
64
|
[require_caip2.Chains.BNB, _omni_bridge_core.ChainKind.Bnb],
|
|
65
|
-
[require_caip2.Chains.Bitcoin, _omni_bridge_core.ChainKind.Btc]
|
|
65
|
+
[require_caip2.Chains.Bitcoin, _omni_bridge_core.ChainKind.Btc],
|
|
66
|
+
[require_caip2.Chains.Abstract, _omni_bridge_core.ChainKind.Abs]
|
|
66
67
|
];
|
|
67
68
|
function caip2ToChainKind(network) {
|
|
68
69
|
return CHAIN_MAPPINGS.find(([chain]) => chain === network)?.[1] ?? null;
|
|
@@ -94,7 +95,7 @@ async function getAccountOmniStorageBalance(nearProvider, accountId) {
|
|
|
94
95
|
})])
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
const OmniAddressSchema = valibot.custom((input) => typeof input === "string" && (input.startsWith("eth:") || input.startsWith("near:") || input.startsWith("sol:") || input.startsWith("arb:") || input.startsWith("base:") || input.startsWith("btc:") || input.startsWith("bnb:")), "Must comply with omni address schema");
|
|
98
|
+
const OmniAddressSchema = valibot.custom((input) => typeof input === "string" && (input.startsWith("eth:") || input.startsWith("near:") || input.startsWith("sol:") || input.startsWith("arb:") || input.startsWith("base:") || input.startsWith("btc:") || input.startsWith("bnb:") || input.startsWith("abs:")), "Must comply with omni address schema");
|
|
98
99
|
/**
|
|
99
100
|
* Converts a token address from one chain to its equivalent on another chain.
|
|
100
101
|
* @param nearProvider Near provider used for querying the contract
|
|
@@ -60,7 +60,8 @@ const CHAIN_MAPPINGS = [
|
|
|
60
60
|
[Chains.Arbitrum, ChainKind.Arb],
|
|
61
61
|
[Chains.Solana, ChainKind.Sol],
|
|
62
62
|
[Chains.BNB, ChainKind.Bnb],
|
|
63
|
-
[Chains.Bitcoin, ChainKind.Btc]
|
|
63
|
+
[Chains.Bitcoin, ChainKind.Btc],
|
|
64
|
+
[Chains.Abstract, ChainKind.Abs]
|
|
64
65
|
];
|
|
65
66
|
function caip2ToChainKind(network) {
|
|
66
67
|
return CHAIN_MAPPINGS.find(([chain]) => chain === network)?.[1] ?? null;
|
|
@@ -92,7 +93,7 @@ async function getAccountOmniStorageBalance(nearProvider, accountId) {
|
|
|
92
93
|
})])
|
|
93
94
|
});
|
|
94
95
|
}
|
|
95
|
-
const OmniAddressSchema = v.custom((input) => typeof input === "string" && (input.startsWith("eth:") || input.startsWith("near:") || input.startsWith("sol:") || input.startsWith("arb:") || input.startsWith("base:") || input.startsWith("btc:") || input.startsWith("bnb:")), "Must comply with omni address schema");
|
|
96
|
+
const OmniAddressSchema = v.custom((input) => typeof input === "string" && (input.startsWith("eth:") || input.startsWith("near:") || input.startsWith("sol:") || input.startsWith("arb:") || input.startsWith("base:") || input.startsWith("btc:") || input.startsWith("bnb:") || input.startsWith("abs:")), "Must comply with omni address schema");
|
|
96
97
|
/**
|
|
97
98
|
* Converts a token address from one chain to its equivalent on another chain.
|
|
98
99
|
* @param nearProvider Near provider used for querying the contract
|
package/dist/src/lib/caip2.cjs
CHANGED
|
@@ -36,7 +36,8 @@ const Chains = {
|
|
|
36
36
|
Plasma: "eip155:9745",
|
|
37
37
|
Scroll: "eip155:534352",
|
|
38
38
|
Aleo: "aleo:0",
|
|
39
|
-
Dash: "bip122:00000ffd590b1485b3caadc19b22e637"
|
|
39
|
+
Dash: "bip122:00000ffd590b1485b3caadc19b22e637",
|
|
40
|
+
Abstract: "eip155:2741"
|
|
40
41
|
};
|
|
41
42
|
function getEIP155ChainId(chain) {
|
|
42
43
|
(0, _defuse_protocol_internal_utils.assert)(chain.startsWith("eip155:"), "Chain is not an EIP-155 chain");
|
package/dist/src/lib/caip2.d.cts
CHANGED
|
@@ -34,6 +34,7 @@ declare const Chains: {
|
|
|
34
34
|
readonly Scroll: "eip155:534352";
|
|
35
35
|
readonly Aleo: "aleo:0";
|
|
36
36
|
readonly Dash: "bip122:00000ffd590b1485b3caadc19b22e637";
|
|
37
|
+
readonly Abstract: "eip155:2741";
|
|
37
38
|
};
|
|
38
39
|
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
39
40
|
//#endregion
|
package/dist/src/lib/caip2.d.ts
CHANGED
|
@@ -34,6 +34,7 @@ declare const Chains: {
|
|
|
34
34
|
readonly Scroll: "eip155:534352";
|
|
35
35
|
readonly Aleo: "aleo:0";
|
|
36
36
|
readonly Dash: "bip122:00000ffd590b1485b3caadc19b22e637";
|
|
37
|
+
readonly Abstract: "eip155:2741";
|
|
37
38
|
};
|
|
38
39
|
type Chain = (typeof Chains)[keyof typeof Chains];
|
|
39
40
|
//#endregion
|
package/dist/src/lib/caip2.js
CHANGED
|
@@ -35,7 +35,8 @@ const Chains = {
|
|
|
35
35
|
Plasma: "eip155:9745",
|
|
36
36
|
Scroll: "eip155:534352",
|
|
37
37
|
Aleo: "aleo:0",
|
|
38
|
-
Dash: "bip122:00000ffd590b1485b3caadc19b22e637"
|
|
38
|
+
Dash: "bip122:00000ffd590b1485b3caadc19b22e637",
|
|
39
|
+
Abstract: "eip155:2741"
|
|
39
40
|
};
|
|
40
41
|
function getEIP155ChainId(chain) {
|
|
41
42
|
assert(chain.startsWith("eip155:"), "Chain is not an EIP-155 chain");
|
|
@@ -45,7 +45,8 @@ function validateAddress(address, blockchain) {
|
|
|
45
45
|
case require_caip2.Chains.Avalanche:
|
|
46
46
|
case require_caip2.Chains.Berachain:
|
|
47
47
|
case require_caip2.Chains.Plasma:
|
|
48
|
-
case require_caip2.Chains.Scroll:
|
|
48
|
+
case require_caip2.Chains.Scroll:
|
|
49
|
+
case require_caip2.Chains.Abstract: return validateEthAddress(address);
|
|
49
50
|
case require_caip2.Chains.Aleo: return validateAleoAddress(address);
|
|
50
51
|
case require_caip2.Chains.Dash: return validateDashAddress(address);
|
|
51
52
|
default: return false;
|
|
@@ -44,7 +44,8 @@ function validateAddress(address, blockchain) {
|
|
|
44
44
|
case Chains.Avalanche:
|
|
45
45
|
case Chains.Berachain:
|
|
46
46
|
case Chains.Plasma:
|
|
47
|
-
case Chains.Scroll:
|
|
47
|
+
case Chains.Scroll:
|
|
48
|
+
case Chains.Abstract: return validateEthAddress(address);
|
|
48
49
|
case Chains.Aleo: return validateAleoAddress(address);
|
|
49
50
|
case Chains.Dash: return validateDashAddress(address);
|
|
50
51
|
default: return false;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defuse-protocol/intents-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.61.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"@hot-labs/omni-sdk": "2.24.8",
|
|
35
35
|
"@isaacs/ttlcache": "^1.0.0",
|
|
36
36
|
"@lifeomic/attempt": "^3.0.0",
|
|
37
|
-
"@omni-bridge/core": "0.
|
|
38
|
-
"@omni-bridge/near": "0.
|
|
37
|
+
"@omni-bridge/core": "0.6.1",
|
|
38
|
+
"@omni-bridge/near": "0.6.1",
|
|
39
39
|
"@noble/hashes": "^1.7.1",
|
|
40
40
|
"@scure/base": "^1.0.0",
|
|
41
41
|
"@solana/web3.js": "^1.0.0",
|