@forevermoney/sdk 0.5.6 → 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/CHANGELOG.md +10 -0
- package/README.md +11 -0
- package/dist/index.cjs +25 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +25 -8
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.8
|
|
4
|
+
|
|
5
|
+
- Restrict SN78 to Base; expose a null Robinhood token and reject unsupported bridge plans in both directions. Base and Subtensor SN78 addresses and other assets remain unchanged.
|
|
6
|
+
- Deployment metadata version 1.6.1.
|
|
7
|
+
|
|
8
|
+
## 0.5.7
|
|
9
|
+
|
|
10
|
+
- Add Umi SN78 on Base, Robinhood and Subtensor, with staked-only subnet 78 approvals and bridge plans.
|
|
11
|
+
- Extend live integration coverage to SN10 and SN78.
|
|
12
|
+
|
|
3
13
|
## 0.5.6 — 2026-09-22
|
|
4
14
|
|
|
5
15
|
- Add Pareton (SN10) deployment metadata on Base, Robinhood and Subtensor.
|
package/README.md
CHANGED
|
@@ -134,6 +134,17 @@ The bridge does not deduct its fee from the destination amount. For both
|
|
|
134
134
|
directions, the SDK encodes the bridge amount itself as the contract's minimum
|
|
135
135
|
output; callers cannot weaken that invariant.
|
|
136
136
|
|
|
137
|
+
## Bridge Umi (SN78)
|
|
138
|
+
|
|
139
|
+
Use `asset: 'sn78'` with `evmChain: 'base'`. SN78 is Base-only; Robinhood routes are rejected.
|
|
140
|
+
SN78 supports staked subnet 78 input and delivery only; liquid conversion is
|
|
141
|
+
rejected. The SDK supplies netuid 78 and rejects a conflicting netuid.
|
|
142
|
+
|
|
143
|
+
Canonical `contracts.wrappedSn78` addresses:
|
|
144
|
+
|
|
145
|
+
- Base and Robinhood: `0x6e2feEE56bc5F0Db2104Ab1dac2cf1Fb0334eb49`
|
|
146
|
+
- Subtensor (964): `0xF2a747b004fACa8EAB646948117499E25CB8641d`
|
|
147
|
+
|
|
137
148
|
## Bridge Pareton (SN10)
|
|
138
149
|
|
|
139
150
|
Use `asset: 'sn10'` with `evmChain: 'base'` or `'robinhood'` in the
|
package/dist/index.cjs
CHANGED
|
@@ -38,6 +38,7 @@ __export(index_exports, {
|
|
|
38
38
|
ROBINHOOD_CCIP_SELECTOR: () => ROBINHOOD_CCIP_SELECTOR,
|
|
39
39
|
ROBINHOOD_CHAIN_ID: () => ROBINHOOD_CHAIN_ID,
|
|
40
40
|
SN10_NETUID: () => SN10_NETUID,
|
|
41
|
+
SN78_NETUID: () => SN78_NETUID,
|
|
41
42
|
SN80_NETUID: () => SN80_NETUID,
|
|
42
43
|
SUBTENSOR_CCIP_SELECTOR: () => SUBTENSOR_CCIP_SELECTOR,
|
|
43
44
|
SUBTENSOR_CHAIN_ID: () => SUBTENSOR_CHAIN_ID,
|
|
@@ -95,9 +96,10 @@ var ROBINHOOD_CCIP_SELECTOR = 6180753054346818345n;
|
|
|
95
96
|
var SUBTENSOR_CCIP_SELECTOR = 2135107236357186872n;
|
|
96
97
|
var RAO_PER_TAO = 1000000000n;
|
|
97
98
|
var EVM_WEI_PER_RAO = 1000000000n;
|
|
99
|
+
var SN78_NETUID = 78n;
|
|
98
100
|
var SN10_NETUID = 10n;
|
|
99
101
|
var SN80_NETUID = 80n;
|
|
100
|
-
var FOREVERMONEY_DEPLOYMENT_VERSION = "1.
|
|
102
|
+
var FOREVERMONEY_DEPLOYMENT_VERSION = "1.6.1";
|
|
101
103
|
var foreverMoneyDeployment = Object.freeze({
|
|
102
104
|
version: FOREVERMONEY_DEPLOYMENT_VERSION,
|
|
103
105
|
base: Object.freeze({
|
|
@@ -115,6 +117,9 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
115
117
|
wrappedTao: (0, import_viem.getAddress)(
|
|
116
118
|
"0xf3081494b87e8d5fb7960f066e931d1d0e6e3d67"
|
|
117
119
|
),
|
|
120
|
+
wrappedSn78: (0, import_viem.getAddress)(
|
|
121
|
+
"0x6e2feEE56bc5F0Db2104Ab1dac2cf1Fb0334eb49"
|
|
122
|
+
),
|
|
118
123
|
wrappedSn10: (0, import_viem.getAddress)(
|
|
119
124
|
"0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3"
|
|
120
125
|
),
|
|
@@ -153,6 +158,8 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
153
158
|
wrappedTao: (0, import_viem.getAddress)(
|
|
154
159
|
"0xf3081494B87e8D5fb7960f066E931D1D0e6E3d67"
|
|
155
160
|
),
|
|
161
|
+
// SN78 is released on Base only.
|
|
162
|
+
wrappedSn78: null,
|
|
156
163
|
wrappedSn10: (0, import_viem.getAddress)(
|
|
157
164
|
"0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3"
|
|
158
165
|
),
|
|
@@ -185,6 +192,9 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
185
192
|
wrappedTao: (0, import_viem.getAddress)(
|
|
186
193
|
"0xC5b6C1632d34901239396F5E1BDe54B342900256"
|
|
187
194
|
),
|
|
195
|
+
wrappedSn78: (0, import_viem.getAddress)(
|
|
196
|
+
"0xF2a747b004fACa8EAB646948117499E25CB8641d"
|
|
197
|
+
),
|
|
188
198
|
wrappedSn10: (0, import_viem.getAddress)(
|
|
189
199
|
"0xcd0836D1ecE4AEDf5B39f2792e0790BBE79449b3"
|
|
190
200
|
),
|
|
@@ -823,16 +833,23 @@ function assertPartnerFeeAllowed(fee, maxBps) {
|
|
|
823
833
|
}
|
|
824
834
|
}
|
|
825
835
|
function bridgeAsset(evmChain, asset = "tao") {
|
|
826
|
-
if (asset !== "tao" && asset !== "sn80" && asset !== "sn10") {
|
|
836
|
+
if (asset !== "tao" && asset !== "sn80" && asset !== "sn10" && asset !== "sn78") {
|
|
827
837
|
throw new ForeverMoneyError(
|
|
828
838
|
"INVALID_TRANSACTION_PLAN",
|
|
829
|
-
'Asset must be "tao", "sn80", or "
|
|
839
|
+
'Asset must be "tao", "sn80", "sn10", or "sn78".'
|
|
830
840
|
);
|
|
831
841
|
}
|
|
832
842
|
const evm = getForeverMoneyEvmDeployment(evmChain);
|
|
833
|
-
const tokenKey = asset === "sn10" ? "wrappedSn10" : "wrappedSn80";
|
|
843
|
+
const tokenKey = asset === "sn78" ? "wrappedSn78" : asset === "sn10" ? "wrappedSn10" : "wrappedSn80";
|
|
844
|
+
const evmToken = asset === "tao" ? evm.contracts.wrappedTao : evm.contracts[tokenKey];
|
|
845
|
+
if (!evmToken) {
|
|
846
|
+
throw new ForeverMoneyError(
|
|
847
|
+
"INVALID_TRANSACTION_PLAN",
|
|
848
|
+
`${asset.toUpperCase()} bridging is not supported on ${evmChain}.`
|
|
849
|
+
);
|
|
850
|
+
}
|
|
834
851
|
return asset !== "tao" ? {
|
|
835
|
-
evmToken
|
|
852
|
+
evmToken,
|
|
836
853
|
subtensorToken: foreverMoneyDeployment.subtensor.contracts[tokenKey],
|
|
837
854
|
label: asset.toUpperCase(),
|
|
838
855
|
wrappedLabel: asset.toUpperCase()
|
|
@@ -844,16 +861,16 @@ function bridgeAsset(evmChain, asset = "tao") {
|
|
|
844
861
|
};
|
|
845
862
|
}
|
|
846
863
|
function assertAssetMode(asset, mode) {
|
|
847
|
-
if ((asset === "sn80" || asset === "sn10") && mode !== "staked") {
|
|
864
|
+
if ((asset === "sn80" || asset === "sn10" || asset === "sn78") && mode !== "staked") {
|
|
848
865
|
throw new ForeverMoneyError(
|
|
849
866
|
"INVALID_TRANSACTION_PLAN",
|
|
850
|
-
`${asset.toUpperCase()} bridging requires staked subnet ${asset === "sn10" ? SN10_NETUID : SN80_NETUID} input or delivery; liquid TAO conversion is not supported.`
|
|
867
|
+
`${asset.toUpperCase()} bridging requires staked subnet ${asset === "sn78" ? SN78_NETUID : asset === "sn10" ? SN10_NETUID : SN80_NETUID} input or delivery; liquid TAO conversion is not supported.`
|
|
851
868
|
);
|
|
852
869
|
}
|
|
853
870
|
}
|
|
854
871
|
function sourceNetuid(input) {
|
|
855
872
|
if (input.source !== "staked") return void 0;
|
|
856
|
-
const assetNetuid = input.asset === "sn10" ? SN10_NETUID : input.asset === "sn80" ? SN80_NETUID : void 0;
|
|
873
|
+
const assetNetuid = input.asset === "sn78" ? SN78_NETUID : input.asset === "sn10" ? SN10_NETUID : input.asset === "sn80" ? SN80_NETUID : void 0;
|
|
857
874
|
const netuid = input.netuid ?? assetNetuid;
|
|
858
875
|
if (netuid === void 0) {
|
|
859
876
|
throw new ForeverMoneyError(
|