@forevermoney/sdk 0.5.5 → 0.5.7
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 +11 -0
- package/README.md +26 -0
- package/dist/index.cjs +37 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -4
- package/dist/index.d.ts +12 -4
- package/dist/index.js +37 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.7
|
|
4
|
+
|
|
5
|
+
- Add Umi SN78 on Base, Robinhood and Subtensor, with staked-only subnet 78 approvals and bridge plans.
|
|
6
|
+
- Extend live integration coverage to SN10 and SN78.
|
|
7
|
+
|
|
8
|
+
## 0.5.6 — 2026-09-22
|
|
9
|
+
|
|
10
|
+
- Add Pareton (SN10) deployment metadata on Base, Robinhood and Subtensor.
|
|
11
|
+
- Support staked-only SN10 bridge plans and preparation in both directions
|
|
12
|
+
on both EVM spokes, enforcing netuid 10. Deployment version is 1.5.0.
|
|
13
|
+
|
|
3
14
|
## 0.5.5 — 2026-09-21
|
|
4
15
|
|
|
5
16
|
- Discover destination off-ramps from the canonical CCIP router for the source
|
package/README.md
CHANGED
|
@@ -134,6 +134,32 @@ 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'` or `'robinhood'`.
|
|
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
|
+
|
|
148
|
+
## Bridge Pareton (SN10)
|
|
149
|
+
|
|
150
|
+
Use `asset: 'sn10'` with `evmChain: 'base'` or `'robinhood'` in the
|
|
151
|
+
bridge plan and preparation APIs. Finney input and delivery must be staked;
|
|
152
|
+
netuid defaults to 10 and any other netuid is rejected. Amounts use 18 decimals
|
|
153
|
+
and must be whole alpha RAO. Approval, quoting and tracking use the same APIs
|
|
154
|
+
as SN80 below.
|
|
155
|
+
|
|
156
|
+
Canonical `contracts.wrappedSn10` addresses:
|
|
157
|
+
|
|
158
|
+
- Base and Robinhood: `0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3`.
|
|
159
|
+
- Subtensor (964): `0xcd0836D1ecE4AEDf5B39f2792e0790BBE79449b3`.
|
|
160
|
+
|
|
161
|
+
The Subtensor ERC-20 remains named "Subnet 10"; the application displays Pareton.
|
|
162
|
+
|
|
137
163
|
## Bridge SN80 on Base and Robinhood
|
|
138
164
|
|
|
139
165
|
Pass `asset: 'sn80'` to bridge Base or Robinhood SN80 to a Finney subnet-80
|
package/dist/index.cjs
CHANGED
|
@@ -37,6 +37,8 @@ __export(index_exports, {
|
|
|
37
37
|
RAO_PER_TAO: () => RAO_PER_TAO,
|
|
38
38
|
ROBINHOOD_CCIP_SELECTOR: () => ROBINHOOD_CCIP_SELECTOR,
|
|
39
39
|
ROBINHOOD_CHAIN_ID: () => ROBINHOOD_CHAIN_ID,
|
|
40
|
+
SN10_NETUID: () => SN10_NETUID,
|
|
41
|
+
SN78_NETUID: () => SN78_NETUID,
|
|
40
42
|
SN80_NETUID: () => SN80_NETUID,
|
|
41
43
|
SUBTENSOR_CCIP_SELECTOR: () => SUBTENSOR_CCIP_SELECTOR,
|
|
42
44
|
SUBTENSOR_CHAIN_ID: () => SUBTENSOR_CHAIN_ID,
|
|
@@ -94,8 +96,10 @@ var ROBINHOOD_CCIP_SELECTOR = 6180753054346818345n;
|
|
|
94
96
|
var SUBTENSOR_CCIP_SELECTOR = 2135107236357186872n;
|
|
95
97
|
var RAO_PER_TAO = 1000000000n;
|
|
96
98
|
var EVM_WEI_PER_RAO = 1000000000n;
|
|
99
|
+
var SN78_NETUID = 78n;
|
|
100
|
+
var SN10_NETUID = 10n;
|
|
97
101
|
var SN80_NETUID = 80n;
|
|
98
|
-
var FOREVERMONEY_DEPLOYMENT_VERSION = "1.
|
|
102
|
+
var FOREVERMONEY_DEPLOYMENT_VERSION = "1.6.0";
|
|
99
103
|
var foreverMoneyDeployment = Object.freeze({
|
|
100
104
|
version: FOREVERMONEY_DEPLOYMENT_VERSION,
|
|
101
105
|
base: Object.freeze({
|
|
@@ -113,6 +117,12 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
113
117
|
wrappedTao: (0, import_viem.getAddress)(
|
|
114
118
|
"0xf3081494b87e8d5fb7960f066e931d1d0e6e3d67"
|
|
115
119
|
),
|
|
120
|
+
wrappedSn78: (0, import_viem.getAddress)(
|
|
121
|
+
"0x6e2feEE56bc5F0Db2104Ab1dac2cf1Fb0334eb49"
|
|
122
|
+
),
|
|
123
|
+
wrappedSn10: (0, import_viem.getAddress)(
|
|
124
|
+
"0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3"
|
|
125
|
+
),
|
|
116
126
|
wrappedSn80: (0, import_viem.getAddress)(
|
|
117
127
|
"0x6f63d869011f95274498023b4abfc00b30c34378"
|
|
118
128
|
),
|
|
@@ -148,6 +158,12 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
148
158
|
wrappedTao: (0, import_viem.getAddress)(
|
|
149
159
|
"0xf3081494B87e8D5fb7960f066E931D1D0e6E3d67"
|
|
150
160
|
),
|
|
161
|
+
wrappedSn78: (0, import_viem.getAddress)(
|
|
162
|
+
"0x6e2feEE56bc5F0Db2104Ab1dac2cf1Fb0334eb49"
|
|
163
|
+
),
|
|
164
|
+
wrappedSn10: (0, import_viem.getAddress)(
|
|
165
|
+
"0xDdDE5965D49e69b6362BD8743e139a45dBFEb7b3"
|
|
166
|
+
),
|
|
151
167
|
wrappedSn80: (0, import_viem.getAddress)(
|
|
152
168
|
"0x6f63d869011f95274498023b4abfc00b30c34378"
|
|
153
169
|
),
|
|
@@ -177,6 +193,12 @@ var foreverMoneyDeployment = Object.freeze({
|
|
|
177
193
|
wrappedTao: (0, import_viem.getAddress)(
|
|
178
194
|
"0xC5b6C1632d34901239396F5E1BDe54B342900256"
|
|
179
195
|
),
|
|
196
|
+
wrappedSn78: (0, import_viem.getAddress)(
|
|
197
|
+
"0xF2a747b004fACa8EAB646948117499E25CB8641d"
|
|
198
|
+
),
|
|
199
|
+
wrappedSn10: (0, import_viem.getAddress)(
|
|
200
|
+
"0xcd0836D1ecE4AEDf5B39f2792e0790BBE79449b3"
|
|
201
|
+
),
|
|
180
202
|
wrappedSn80: (0, import_viem.getAddress)(
|
|
181
203
|
"0xfD628dE75EF96f0A5C59659159C6cA81E0DC2222"
|
|
182
204
|
),
|
|
@@ -812,18 +834,19 @@ function assertPartnerFeeAllowed(fee, maxBps) {
|
|
|
812
834
|
}
|
|
813
835
|
}
|
|
814
836
|
function bridgeAsset(evmChain, asset = "tao") {
|
|
815
|
-
if (asset !== "tao" && asset !== "sn80") {
|
|
837
|
+
if (asset !== "tao" && asset !== "sn80" && asset !== "sn10" && asset !== "sn78") {
|
|
816
838
|
throw new ForeverMoneyError(
|
|
817
839
|
"INVALID_TRANSACTION_PLAN",
|
|
818
|
-
'Asset must be "tao" or "
|
|
840
|
+
'Asset must be "tao", "sn80", "sn10", or "sn78".'
|
|
819
841
|
);
|
|
820
842
|
}
|
|
821
843
|
const evm = getForeverMoneyEvmDeployment(evmChain);
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
844
|
+
const tokenKey = asset === "sn78" ? "wrappedSn78" : asset === "sn10" ? "wrappedSn10" : "wrappedSn80";
|
|
845
|
+
return asset !== "tao" ? {
|
|
846
|
+
evmToken: evm.contracts[tokenKey],
|
|
847
|
+
subtensorToken: foreverMoneyDeployment.subtensor.contracts[tokenKey],
|
|
848
|
+
label: asset.toUpperCase(),
|
|
849
|
+
wrappedLabel: asset.toUpperCase()
|
|
827
850
|
} : {
|
|
828
851
|
evmToken: evm.contracts.wrappedTao,
|
|
829
852
|
subtensorToken: foreverMoneyDeployment.subtensor.contracts.wrappedTao,
|
|
@@ -832,16 +855,17 @@ function bridgeAsset(evmChain, asset = "tao") {
|
|
|
832
855
|
};
|
|
833
856
|
}
|
|
834
857
|
function assertAssetMode(asset, mode) {
|
|
835
|
-
if (asset === "sn80" && mode !== "staked") {
|
|
858
|
+
if ((asset === "sn80" || asset === "sn10" || asset === "sn78") && mode !== "staked") {
|
|
836
859
|
throw new ForeverMoneyError(
|
|
837
860
|
"INVALID_TRANSACTION_PLAN",
|
|
838
|
-
|
|
861
|
+
`${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.`
|
|
839
862
|
);
|
|
840
863
|
}
|
|
841
864
|
}
|
|
842
865
|
function sourceNetuid(input) {
|
|
843
866
|
if (input.source !== "staked") return void 0;
|
|
844
|
-
const
|
|
867
|
+
const assetNetuid = input.asset === "sn78" ? SN78_NETUID : input.asset === "sn10" ? SN10_NETUID : input.asset === "sn80" ? SN80_NETUID : void 0;
|
|
868
|
+
const netuid = input.netuid ?? assetNetuid;
|
|
845
869
|
if (netuid === void 0) {
|
|
846
870
|
throw new ForeverMoneyError(
|
|
847
871
|
"INVALID_TRANSACTION_PLAN",
|
|
@@ -849,10 +873,10 @@ function sourceNetuid(input) {
|
|
|
849
873
|
);
|
|
850
874
|
}
|
|
851
875
|
assertNonNegativeAmount(netuid, "netuid");
|
|
852
|
-
if (
|
|
876
|
+
if (assetNetuid !== void 0 && netuid !== assetNetuid) {
|
|
853
877
|
throw new ForeverMoneyError(
|
|
854
878
|
"INVALID_TRANSACTION_PLAN",
|
|
855
|
-
|
|
879
|
+
`${input.asset.toUpperCase()} staking approvals must use netuid ${assetNetuid}.`
|
|
856
880
|
);
|
|
857
881
|
}
|
|
858
882
|
return netuid;
|