@forevermoney/sdk 0.5.7 → 0.5.8

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/index.d.cts CHANGED
@@ -11,9 +11,9 @@ declare const EVM_WEI_PER_RAO = 1000000000n;
11
11
  declare const SN78_NETUID = 78n;
12
12
  declare const SN10_NETUID = 10n;
13
13
  declare const SN80_NETUID = 80n;
14
- declare const FOREVERMONEY_DEPLOYMENT_VERSION: "1.6.0";
14
+ declare const FOREVERMONEY_DEPLOYMENT_VERSION: "1.6.1";
15
15
  declare const foreverMoneyDeployment: Readonly<{
16
- version: "1.6.0";
16
+ version: "1.6.1";
17
17
  base: Readonly<{
18
18
  key: "base";
19
19
  name: "Base";
@@ -44,7 +44,7 @@ declare const foreverMoneyDeployment: Readonly<{
44
44
  gateway: `0x${string}`;
45
45
  legacyGateways: readonly `0x${string}`[];
46
46
  wrappedTao: `0x${string}`;
47
- wrappedSn78: `0x${string}`;
47
+ wrappedSn78: null;
48
48
  wrappedSn10: `0x${string}`;
49
49
  wrappedSn80: `0x${string}`;
50
50
  ccipRouter: `0x${string}`;
package/dist/index.d.ts CHANGED
@@ -11,9 +11,9 @@ declare const EVM_WEI_PER_RAO = 1000000000n;
11
11
  declare const SN78_NETUID = 78n;
12
12
  declare const SN10_NETUID = 10n;
13
13
  declare const SN80_NETUID = 80n;
14
- declare const FOREVERMONEY_DEPLOYMENT_VERSION: "1.6.0";
14
+ declare const FOREVERMONEY_DEPLOYMENT_VERSION: "1.6.1";
15
15
  declare const foreverMoneyDeployment: Readonly<{
16
- version: "1.6.0";
16
+ version: "1.6.1";
17
17
  base: Readonly<{
18
18
  key: "base";
19
19
  name: "Base";
@@ -44,7 +44,7 @@ declare const foreverMoneyDeployment: Readonly<{
44
44
  gateway: `0x${string}`;
45
45
  legacyGateways: readonly `0x${string}`[];
46
46
  wrappedTao: `0x${string}`;
47
- wrappedSn78: `0x${string}`;
47
+ wrappedSn78: null;
48
48
  wrappedSn10: `0x${string}`;
49
49
  wrappedSn80: `0x${string}`;
50
50
  ccipRouter: `0x${string}`;
package/dist/index.js CHANGED
@@ -11,7 +11,7 @@ var EVM_WEI_PER_RAO = 1000000000n;
11
11
  var SN78_NETUID = 78n;
12
12
  var SN10_NETUID = 10n;
13
13
  var SN80_NETUID = 80n;
14
- var FOREVERMONEY_DEPLOYMENT_VERSION = "1.6.0";
14
+ var FOREVERMONEY_DEPLOYMENT_VERSION = "1.6.1";
15
15
  var foreverMoneyDeployment = Object.freeze({
16
16
  version: FOREVERMONEY_DEPLOYMENT_VERSION,
17
17
  base: Object.freeze({
@@ -70,9 +70,8 @@ var foreverMoneyDeployment = Object.freeze({
70
70
  wrappedTao: getAddress(
71
71
  "0xf3081494B87e8D5fb7960f066E931D1D0e6E3d67"
72
72
  ),
73
- wrappedSn78: getAddress(
74
- "0x6e2feEE56bc5F0Db2104Ab1dac2cf1Fb0334eb49"
75
- ),
73
+ // SN78 is released on Base only.
74
+ wrappedSn78: null,
76
75
  wrappedSn10: getAddress(
77
76
  "0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3"
78
77
  ),
@@ -766,8 +765,15 @@ function bridgeAsset(evmChain, asset = "tao") {
766
765
  }
767
766
  const evm = getForeverMoneyEvmDeployment(evmChain);
768
767
  const tokenKey = asset === "sn78" ? "wrappedSn78" : asset === "sn10" ? "wrappedSn10" : "wrappedSn80";
768
+ const evmToken = asset === "tao" ? evm.contracts.wrappedTao : evm.contracts[tokenKey];
769
+ if (!evmToken) {
770
+ throw new ForeverMoneyError(
771
+ "INVALID_TRANSACTION_PLAN",
772
+ `${asset.toUpperCase()} bridging is not supported on ${evmChain}.`
773
+ );
774
+ }
769
775
  return asset !== "tao" ? {
770
- evmToken: evm.contracts[tokenKey],
776
+ evmToken,
771
777
  subtensorToken: foreverMoneyDeployment.subtensor.contracts[tokenKey],
772
778
  label: asset.toUpperCase(),
773
779
  wrappedLabel: asset.toUpperCase()