@defuse-protocol/intents-sdk 0.77.0 → 0.78.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.
@@ -68,7 +68,8 @@ const CHAIN_MAPPINGS = [
68
68
  [require_caip2.Chains.Starknet, _omni_bridge_core.ChainKind.Strk],
69
69
  [require_caip2.Chains.Fogo, _omni_bridge_core.ChainKind.Fogo],
70
70
  [require_caip2.Chains.Polygon, _omni_bridge_core.ChainKind.Pol],
71
- [require_caip2.Chains.Aptos, _omni_bridge_core.ChainKind.Aptos]
71
+ [require_caip2.Chains.Aptos, _omni_bridge_core.ChainKind.Aptos],
72
+ [require_caip2.Chains.HyperEvm, _omni_bridge_core.ChainKind.HyperEvm]
72
73
  ];
73
74
  function caip2ToChainKind(network) {
74
75
  return CHAIN_MAPPINGS.find(([chain]) => chain === network)?.[1] ?? null;
@@ -100,7 +101,7 @@ async function getAccountOmniStorageBalance(nearProvider, accountId) {
100
101
  })])
101
102
  });
102
103
  }
103
- 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:") || input.startsWith("strk:") || input.startsWith("fogo:") || input.startsWith("pol:") || input.startsWith("aptos:")), "Must comply with omni address schema");
104
+ 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:") || input.startsWith("strk:") || input.startsWith("fogo:") || input.startsWith("pol:") || input.startsWith("aptos:") || input.startsWith("hlevm:")), "Must comply with omni address schema");
104
105
  /**
105
106
  * Converts a token address from one chain to its equivalent on another chain.
106
107
  * @param nearProvider Near provider used for querying the contract
@@ -66,7 +66,8 @@ const CHAIN_MAPPINGS = [
66
66
  [Chains.Starknet, ChainKind.Strk],
67
67
  [Chains.Fogo, ChainKind.Fogo],
68
68
  [Chains.Polygon, ChainKind.Pol],
69
- [Chains.Aptos, ChainKind.Aptos]
69
+ [Chains.Aptos, ChainKind.Aptos],
70
+ [Chains.HyperEvm, ChainKind.HyperEvm]
70
71
  ];
71
72
  function caip2ToChainKind(network) {
72
73
  return CHAIN_MAPPINGS.find(([chain]) => chain === network)?.[1] ?? null;
@@ -98,7 +99,7 @@ async function getAccountOmniStorageBalance(nearProvider, accountId) {
98
99
  })])
99
100
  });
100
101
  }
101
- 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:") || input.startsWith("strk:") || input.startsWith("fogo:") || input.startsWith("pol:") || input.startsWith("aptos:")), "Must comply with omni address schema");
102
+ 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:") || input.startsWith("strk:") || input.startsWith("fogo:") || input.startsWith("pol:") || input.startsWith("aptos:") || input.startsWith("hlevm:")), "Must comply with omni address schema");
102
103
  /**
103
104
  * Converts a token address from one chain to its equivalent on another chain.
104
105
  * @param nearProvider Near provider used for querying the contract
@@ -40,7 +40,8 @@ const Chains = {
40
40
  Aleo: "aleo:0",
41
41
  Dash: "bip122:00000ffd590b1485b3caadc19b22e637",
42
42
  Abstract: "eip155:2741",
43
- HyperCore: "hlcore:mainnet"
43
+ HyperCore: "hlcore:mainnet",
44
+ HyperEvm: "eip155:999"
44
45
  };
45
46
  function getEIP155ChainId(chain) {
46
47
  (0, _defuse_protocol_internal_utils.assert)(chain.startsWith("eip155:"), "Chain is not an EIP-155 chain");
@@ -38,6 +38,7 @@ declare const Chains: {
38
38
  readonly Dash: "bip122:00000ffd590b1485b3caadc19b22e637";
39
39
  readonly Abstract: "eip155:2741";
40
40
  readonly HyperCore: "hlcore:mainnet";
41
+ readonly HyperEvm: "eip155:999";
41
42
  };
42
43
  type Chain = (typeof Chains)[keyof typeof Chains];
43
44
  //#endregion
@@ -38,6 +38,7 @@ declare const Chains: {
38
38
  readonly Dash: "bip122:00000ffd590b1485b3caadc19b22e637";
39
39
  readonly Abstract: "eip155:2741";
40
40
  readonly HyperCore: "hlcore:mainnet";
41
+ readonly HyperEvm: "eip155:999";
41
42
  };
42
43
  type Chain = (typeof Chains)[keyof typeof Chains];
43
44
  //#endregion
@@ -39,7 +39,8 @@ const Chains = {
39
39
  Aleo: "aleo:0",
40
40
  Dash: "bip122:00000ffd590b1485b3caadc19b22e637",
41
41
  Abstract: "eip155:2741",
42
- HyperCore: "hlcore:mainnet"
42
+ HyperCore: "hlcore:mainnet",
43
+ HyperEvm: "eip155:999"
43
44
  };
44
45
  function getEIP155ChainId(chain) {
45
46
  assert(chain.startsWith("eip155:"), "Chain is not an EIP-155 chain");
@@ -49,7 +49,8 @@ function validateAddress(address, blockchain) {
49
49
  case require_caip2.Chains.Plasma:
50
50
  case require_caip2.Chains.Scroll:
51
51
  case require_caip2.Chains.Abstract:
52
- case require_caip2.Chains.HyperCore: return validateEthAddress(address);
52
+ case require_caip2.Chains.HyperCore:
53
+ case require_caip2.Chains.HyperEvm: return validateEthAddress(address);
53
54
  case require_caip2.Chains.Aleo: return validateAleoAddress(address);
54
55
  case require_caip2.Chains.Dash: return validateDashAddress(address);
55
56
  default: return false;
@@ -48,7 +48,8 @@ function validateAddress(address, blockchain) {
48
48
  case Chains.Plasma:
49
49
  case Chains.Scroll:
50
50
  case Chains.Abstract:
51
- case Chains.HyperCore: return validateEthAddress(address);
51
+ case Chains.HyperCore:
52
+ case Chains.HyperEvm: return validateEthAddress(address);
52
53
  case Chains.Aleo: return validateAleoAddress(address);
53
54
  case Chains.Dash: return validateDashAddress(address);
54
55
  default: return false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.77.0",
3
+ "version": "0.78.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -48,8 +48,8 @@
48
48
  "ripple-address-codec": "^5.0.0",
49
49
  "valibot": "^1.0.0",
50
50
  "viem": "^2.0.0",
51
- "@defuse-protocol/contract-types": "0.6.4",
52
- "@defuse-protocol/internal-utils": "0.35.2"
51
+ "@defuse-protocol/internal-utils": "0.35.2",
52
+ "@defuse-protocol/contract-types": "0.6.4"
53
53
  },
54
54
  "devDependencies": {
55
55
  "@ton/core": "^0.60.0",