@ecency/wallets 1.4.18 → 1.4.19
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/browser/index.d.ts +72 -2
- package/dist/browser/index.js +132 -11
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +133 -10
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +132 -11
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -129,17 +129,47 @@ declare function getHiveAssetGeneralInfoQueryOptions(username: string): _tanstac
|
|
|
129
129
|
title: string;
|
|
130
130
|
price: number;
|
|
131
131
|
accountBalance: number;
|
|
132
|
+
parts?: undefined;
|
|
133
|
+
} | {
|
|
134
|
+
name: string;
|
|
135
|
+
title: string;
|
|
136
|
+
price: number;
|
|
137
|
+
accountBalance: number;
|
|
138
|
+
parts: {
|
|
139
|
+
name: string;
|
|
140
|
+
balance: number;
|
|
141
|
+
}[];
|
|
132
142
|
}, Error, {
|
|
133
143
|
name: string;
|
|
134
144
|
title: string;
|
|
135
145
|
price: number;
|
|
136
146
|
accountBalance: number;
|
|
147
|
+
parts?: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
name: string;
|
|
150
|
+
title: string;
|
|
151
|
+
price: number;
|
|
152
|
+
accountBalance: number;
|
|
153
|
+
parts: {
|
|
154
|
+
name: string;
|
|
155
|
+
balance: number;
|
|
156
|
+
}[];
|
|
137
157
|
}, string[]>, "queryFn"> & {
|
|
138
158
|
queryFn?: _tanstack_react_query.QueryFunction<{
|
|
139
159
|
name: string;
|
|
140
160
|
title: string;
|
|
141
161
|
price: number;
|
|
142
162
|
accountBalance: number;
|
|
163
|
+
parts?: undefined;
|
|
164
|
+
} | {
|
|
165
|
+
name: string;
|
|
166
|
+
title: string;
|
|
167
|
+
price: number;
|
|
168
|
+
accountBalance: number;
|
|
169
|
+
parts: {
|
|
170
|
+
name: string;
|
|
171
|
+
balance: number;
|
|
172
|
+
}[];
|
|
143
173
|
}, string[], never> | undefined;
|
|
144
174
|
} & {
|
|
145
175
|
queryKey: string[] & {
|
|
@@ -148,6 +178,16 @@ declare function getHiveAssetGeneralInfoQueryOptions(username: string): _tanstac
|
|
|
148
178
|
title: string;
|
|
149
179
|
price: number;
|
|
150
180
|
accountBalance: number;
|
|
181
|
+
parts?: undefined;
|
|
182
|
+
} | {
|
|
183
|
+
name: string;
|
|
184
|
+
title: string;
|
|
185
|
+
price: number;
|
|
186
|
+
accountBalance: number;
|
|
187
|
+
parts: {
|
|
188
|
+
name: string;
|
|
189
|
+
balance: number;
|
|
190
|
+
}[];
|
|
151
191
|
};
|
|
152
192
|
[dataTagErrorSymbol]: Error;
|
|
153
193
|
};
|
|
@@ -697,10 +737,12 @@ interface TransformedSpkMarkets {
|
|
|
697
737
|
declare enum AssetOperation {
|
|
698
738
|
Transfer = "transfer",
|
|
699
739
|
TransferToSavings = "transfer-saving",
|
|
740
|
+
WithdrawFromSavings = "withdraw-saving",
|
|
700
741
|
Delegate = "delegate",
|
|
701
742
|
PowerUp = "power-up",
|
|
702
743
|
PowerDown = "power-down",
|
|
703
|
-
WithdrawRoutes = "withdraw-
|
|
744
|
+
WithdrawRoutes = "withdraw-routes",
|
|
745
|
+
ClaimInterest = "claim-interest",
|
|
704
746
|
Swap = "swap",
|
|
705
747
|
Gift = "gift",
|
|
706
748
|
Promote = "promote",
|
|
@@ -749,6 +791,20 @@ declare function transferToSavingsHive<T extends HiveBasedAssetSignType>(payload
|
|
|
749
791
|
key: PrivateKey;
|
|
750
792
|
} : Payload$4<T>): Promise<unknown>;
|
|
751
793
|
|
|
794
|
+
interface PayloadBase$1 {
|
|
795
|
+
from: string;
|
|
796
|
+
to: string;
|
|
797
|
+
amount: string;
|
|
798
|
+
memo: string;
|
|
799
|
+
request_id?: number;
|
|
800
|
+
}
|
|
801
|
+
interface PayloadWithKey$1<T extends HiveBasedAssetSignType> extends PayloadBase$1 {
|
|
802
|
+
type: T;
|
|
803
|
+
}
|
|
804
|
+
declare function transferFromSavingsHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? PayloadWithKey$1<T> & {
|
|
805
|
+
key: PrivateKey;
|
|
806
|
+
} : PayloadWithKey$1<T>): Promise<unknown>;
|
|
807
|
+
|
|
752
808
|
interface Payload$3<T extends HiveBasedAssetSignType> {
|
|
753
809
|
from: string;
|
|
754
810
|
to: string;
|
|
@@ -793,6 +849,20 @@ declare function withdrawVestingRouteHive<T extends HiveBasedAssetSignType>(payl
|
|
|
793
849
|
|
|
794
850
|
declare function useClaimRewards(username: string, onSuccess: () => void): ReturnType<typeof useBroadcastMutation<void>>;
|
|
795
851
|
|
|
852
|
+
interface PayloadBase {
|
|
853
|
+
from: string;
|
|
854
|
+
to: string;
|
|
855
|
+
amount: string;
|
|
856
|
+
memo: string;
|
|
857
|
+
request_id?: number;
|
|
858
|
+
}
|
|
859
|
+
interface PayloadWithKey<T extends HiveBasedAssetSignType> extends PayloadBase {
|
|
860
|
+
type: T;
|
|
861
|
+
}
|
|
862
|
+
declare function claimInterestHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? PayloadWithKey<T> & {
|
|
863
|
+
key: PrivateKey;
|
|
864
|
+
} : PayloadWithKey<T>): Promise<unknown>;
|
|
865
|
+
|
|
796
866
|
declare enum Symbol {
|
|
797
867
|
HIVE = "HIVE",
|
|
798
868
|
HBD = "HBD",
|
|
@@ -1681,4 +1751,4 @@ declare function buildExternalTx(currency: EcencyWalletCurrency, tx: ExternalTxP
|
|
|
1681
1751
|
|
|
1682
1752
|
declare function getBoundFetch(): typeof fetch;
|
|
1683
1753
|
|
|
1684
|
-
export { type AccountPointsResponse, type Asset, AssetOperation, type DelegateEnginePayload, type EcencyHiveKeys, type EcencyTokenMetadata, EcencyWalletBasicTokens, EcencyWalletCurrency, index as EcencyWalletsPrivateApi, type ExternalTxParams, type ExternalWalletBalance, type GeneralAssetInfo, type GeneralAssetTransaction, type HiveBasedAssetSignType, type HiveEngineMarketResponse, type HiveEngineMetric, type HiveEngineTokenBalance, type HiveEngineTokenMetadataResponse, type HiveEngineTransaction, type HiveKeyDerivation, type HiveRole, NaiMap, type PointTransaction, PointTransactionType, type Points, type PointsResponse, type SpkApiWallet, type SpkMarkets, type StakeEnginePayload, Symbol, type TransferEnginePayload, type TransferPayload, type TransformedSpkMarkets, type UndelegateEnginePayload, type UnstakeEnginePayload, buildAptTx, buildEthTx, buildExternalTx, buildPsbt, buildSolTx, buildTonTx, buildTronTx, decryptMemoWithAccounts, decryptMemoWithKeys, delay, delegateEngineToken, delegateHive, deriveHiveKey, deriveHiveKeys, deriveHiveMasterPasswordKey, deriveHiveMasterPasswordKeys, detectHiveKeyDerivation, encryptMemoWithAccounts, encryptMemoWithKeys, getAccountWalletAssetInfoQueryOptions, getAccountWalletListQueryOptions, getAllTokensListQueryOptions, getBoundFetch, getHbdAssetGeneralInfoQueryOptions, getHbdAssetTransactionsQueryOptions, getHiveAssetGeneralInfoQueryOptions, getHiveAssetMetricQueryOptions, getHiveAssetTransactionsQueryOptions, getHiveAssetWithdrawalRoutesQueryOptions, getHiveEngineTokenGeneralInfoQueryOptions, getHiveEngineTokenTransactionsQueryOptions, getHiveEngineTokensBalancesQueryOptions, getHiveEngineTokensMarketQueryOptions, getHiveEngineTokensMetadataQueryOptions, getHiveEngineTokensMetricsQueryOptions, getHivePowerAssetGeneralInfoQueryOptions, getHivePowerAssetTransactionsQueryOptions, getHivePowerDelegatesInfiniteQueryOptions, getHivePowerDelegatingsQueryOptions, getLarynxAssetGeneralInfoQueryOptions, getLarynxPowerAssetGeneralInfoQueryOptions, getPointsAssetGeneralInfoQueryOptions, getPointsAssetTransactionsQueryOptions, getPointsQueryOptions, getSpkAssetGeneralInfoQueryOptions, getSpkMarketsQueryOptions, getTokenOperationsQueryOptions, getTokenPriceQueryOptions, getWallet, isEmptyDate, lockLarynx, mnemonicToSeedBip39, parseAsset, powerDownHive, powerUpHive, powerUpLarynx, rewardSpk, signDigest, signExternalTx, signExternalTxAndBroadcast, signTx, signTxAndBroadcast, stakeEngineToken, transferEngineToken, transferHive, transferLarynx, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
|
1754
|
+
export { type AccountPointsResponse, type Asset, AssetOperation, type DelegateEnginePayload, type EcencyHiveKeys, type EcencyTokenMetadata, EcencyWalletBasicTokens, EcencyWalletCurrency, index as EcencyWalletsPrivateApi, type ExternalTxParams, type ExternalWalletBalance, type GeneralAssetInfo, type GeneralAssetTransaction, type HiveBasedAssetSignType, type HiveEngineMarketResponse, type HiveEngineMetric, type HiveEngineTokenBalance, type HiveEngineTokenMetadataResponse, type HiveEngineTransaction, type HiveKeyDerivation, type HiveRole, NaiMap, type PointTransaction, PointTransactionType, type Points, type PointsResponse, type SpkApiWallet, type SpkMarkets, type StakeEnginePayload, Symbol, type TransferEnginePayload, type TransferPayload, type TransformedSpkMarkets, type UndelegateEnginePayload, type UnstakeEnginePayload, buildAptTx, buildEthTx, buildExternalTx, buildPsbt, buildSolTx, buildTonTx, buildTronTx, claimInterestHive, decryptMemoWithAccounts, decryptMemoWithKeys, delay, delegateEngineToken, delegateHive, deriveHiveKey, deriveHiveKeys, deriveHiveMasterPasswordKey, deriveHiveMasterPasswordKeys, detectHiveKeyDerivation, encryptMemoWithAccounts, encryptMemoWithKeys, getAccountWalletAssetInfoQueryOptions, getAccountWalletListQueryOptions, getAllTokensListQueryOptions, getBoundFetch, getHbdAssetGeneralInfoQueryOptions, getHbdAssetTransactionsQueryOptions, getHiveAssetGeneralInfoQueryOptions, getHiveAssetMetricQueryOptions, getHiveAssetTransactionsQueryOptions, getHiveAssetWithdrawalRoutesQueryOptions, getHiveEngineTokenGeneralInfoQueryOptions, getHiveEngineTokenTransactionsQueryOptions, getHiveEngineTokensBalancesQueryOptions, getHiveEngineTokensMarketQueryOptions, getHiveEngineTokensMetadataQueryOptions, getHiveEngineTokensMetricsQueryOptions, getHivePowerAssetGeneralInfoQueryOptions, getHivePowerAssetTransactionsQueryOptions, getHivePowerDelegatesInfiniteQueryOptions, getHivePowerDelegatingsQueryOptions, getLarynxAssetGeneralInfoQueryOptions, getLarynxPowerAssetGeneralInfoQueryOptions, getPointsAssetGeneralInfoQueryOptions, getPointsAssetTransactionsQueryOptions, getPointsQueryOptions, getSpkAssetGeneralInfoQueryOptions, getSpkMarketsQueryOptions, getTokenOperationsQueryOptions, getTokenPriceQueryOptions, getWallet, isEmptyDate, lockLarynx, mnemonicToSeedBip39, parseAsset, powerDownHive, powerUpHive, powerUpLarynx, rewardSpk, signDigest, signExternalTx, signExternalTxAndBroadcast, signTx, signTxAndBroadcast, stakeEngineToken, transferEngineToken, transferFromSavingsHive, transferHive, transferLarynx, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
package/dist/browser/index.js
CHANGED
|
@@ -654,11 +654,31 @@ function getHiveAssetGeneralInfoQueryOptions(username) {
|
|
|
654
654
|
);
|
|
655
655
|
const marketTicker = await CONFIG.hiveClient.call("condenser_api", "get_ticker", []).catch(() => void 0);
|
|
656
656
|
const marketPrice = Number.parseFloat(marketTicker?.latest ?? "");
|
|
657
|
+
if (!accountData) {
|
|
658
|
+
return {
|
|
659
|
+
name: "HIVE",
|
|
660
|
+
title: "Hive",
|
|
661
|
+
price: Number.isFinite(marketPrice) ? marketPrice : dynamicProps ? dynamicProps.base / dynamicProps.quote : 0,
|
|
662
|
+
accountBalance: 0
|
|
663
|
+
};
|
|
664
|
+
}
|
|
665
|
+
const liquidBalance = parseAsset(accountData.balance).amount;
|
|
666
|
+
const savingsBalance = parseAsset(accountData.savings_balance).amount;
|
|
657
667
|
return {
|
|
658
668
|
name: "HIVE",
|
|
659
669
|
title: "Hive",
|
|
660
670
|
price: Number.isFinite(marketPrice) ? marketPrice : dynamicProps ? dynamicProps.base / dynamicProps.quote : 0,
|
|
661
|
-
accountBalance:
|
|
671
|
+
accountBalance: liquidBalance + savingsBalance,
|
|
672
|
+
parts: [
|
|
673
|
+
{
|
|
674
|
+
name: "current",
|
|
675
|
+
balance: liquidBalance
|
|
676
|
+
},
|
|
677
|
+
{
|
|
678
|
+
name: "savings",
|
|
679
|
+
balance: savingsBalance
|
|
680
|
+
}
|
|
681
|
+
]
|
|
662
682
|
};
|
|
663
683
|
}
|
|
664
684
|
});
|
|
@@ -784,7 +804,7 @@ function getHbdAssetGeneralInfoQueryOptions(username) {
|
|
|
784
804
|
apr: ((dynamicProps?.hbdInterestRate ?? 0) / 100).toFixed(3),
|
|
785
805
|
parts: [
|
|
786
806
|
{
|
|
787
|
-
name: "
|
|
807
|
+
name: "current",
|
|
788
808
|
balance: parseAsset(accountData.hbd_balance).amount
|
|
789
809
|
},
|
|
790
810
|
{
|
|
@@ -1160,6 +1180,36 @@ async function transferToSavingsHive(payload) {
|
|
|
1160
1180
|
);
|
|
1161
1181
|
}
|
|
1162
1182
|
}
|
|
1183
|
+
async function transferFromSavingsHive(payload) {
|
|
1184
|
+
const requestId = payload.request_id ?? Date.now() >>> 0;
|
|
1185
|
+
const operationPayload = {
|
|
1186
|
+
from: payload.from,
|
|
1187
|
+
to: payload.to,
|
|
1188
|
+
amount: payload.amount,
|
|
1189
|
+
memo: payload.memo,
|
|
1190
|
+
request_id: requestId
|
|
1191
|
+
};
|
|
1192
|
+
if (payload.type === "key" && "key" in payload) {
|
|
1193
|
+
const { key } = payload;
|
|
1194
|
+
return CONFIG.hiveClient.broadcast.sendOperations(
|
|
1195
|
+
[["transfer_from_savings", operationPayload]],
|
|
1196
|
+
key
|
|
1197
|
+
);
|
|
1198
|
+
}
|
|
1199
|
+
if (payload.type === "keychain") {
|
|
1200
|
+
return Keychain.broadcast(
|
|
1201
|
+
payload.from,
|
|
1202
|
+
[["transfer_from_savings", operationPayload]],
|
|
1203
|
+
"Active"
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
return hs.sendOperation(
|
|
1207
|
+
["transfer_from_savings", operationPayload],
|
|
1208
|
+
{ callback: `https://ecency.com/@${payload.from}/wallet` },
|
|
1209
|
+
() => {
|
|
1210
|
+
}
|
|
1211
|
+
);
|
|
1212
|
+
}
|
|
1163
1213
|
async function powerUpHive(payload) {
|
|
1164
1214
|
if (payload.type === "key" && "key" in payload) {
|
|
1165
1215
|
const { key, type, ...params } = payload;
|
|
@@ -1298,15 +1348,60 @@ function useClaimRewards(username, onSuccess) {
|
|
|
1298
1348
|
}
|
|
1299
1349
|
);
|
|
1300
1350
|
}
|
|
1351
|
+
async function claimInterestHive(payload) {
|
|
1352
|
+
const requestId = payload.request_id ?? Date.now() >>> 0;
|
|
1353
|
+
const baseOperation = {
|
|
1354
|
+
from: payload.from,
|
|
1355
|
+
to: payload.to,
|
|
1356
|
+
amount: payload.amount,
|
|
1357
|
+
memo: payload.memo,
|
|
1358
|
+
request_id: requestId
|
|
1359
|
+
};
|
|
1360
|
+
const cancelOperation = {
|
|
1361
|
+
from: payload.from,
|
|
1362
|
+
request_id: requestId
|
|
1363
|
+
};
|
|
1364
|
+
if (payload.type === "key" && "key" in payload) {
|
|
1365
|
+
const { key } = payload;
|
|
1366
|
+
return CONFIG.hiveClient.broadcast.sendOperations(
|
|
1367
|
+
[
|
|
1368
|
+
["transfer_from_savings", baseOperation],
|
|
1369
|
+
["cancel_transfer_from_savings", cancelOperation]
|
|
1370
|
+
],
|
|
1371
|
+
key
|
|
1372
|
+
);
|
|
1373
|
+
}
|
|
1374
|
+
if (payload.type === "keychain") {
|
|
1375
|
+
return Keychain.broadcast(
|
|
1376
|
+
payload.from,
|
|
1377
|
+
[
|
|
1378
|
+
["transfer_from_savings", baseOperation],
|
|
1379
|
+
["cancel_transfer_from_savings", cancelOperation]
|
|
1380
|
+
],
|
|
1381
|
+
"Active"
|
|
1382
|
+
);
|
|
1383
|
+
}
|
|
1384
|
+
return hs.sendOperations(
|
|
1385
|
+
[
|
|
1386
|
+
["transfer_from_savings", baseOperation],
|
|
1387
|
+
["cancel_transfer_from_savings", cancelOperation]
|
|
1388
|
+
],
|
|
1389
|
+
{ callback: `https://ecency.com/@${payload.from}/wallet` },
|
|
1390
|
+
() => {
|
|
1391
|
+
}
|
|
1392
|
+
);
|
|
1393
|
+
}
|
|
1301
1394
|
|
|
1302
1395
|
// src/modules/assets/types/asset-operation.ts
|
|
1303
1396
|
var AssetOperation = /* @__PURE__ */ ((AssetOperation2) => {
|
|
1304
1397
|
AssetOperation2["Transfer"] = "transfer";
|
|
1305
1398
|
AssetOperation2["TransferToSavings"] = "transfer-saving";
|
|
1399
|
+
AssetOperation2["WithdrawFromSavings"] = "withdraw-saving";
|
|
1306
1400
|
AssetOperation2["Delegate"] = "delegate";
|
|
1307
1401
|
AssetOperation2["PowerUp"] = "power-up";
|
|
1308
1402
|
AssetOperation2["PowerDown"] = "power-down";
|
|
1309
|
-
AssetOperation2["WithdrawRoutes"] = "withdraw-
|
|
1403
|
+
AssetOperation2["WithdrawRoutes"] = "withdraw-routes";
|
|
1404
|
+
AssetOperation2["ClaimInterest"] = "claim-interest";
|
|
1310
1405
|
AssetOperation2["Swap"] = "swap";
|
|
1311
1406
|
AssetOperation2["Gift"] = "gift";
|
|
1312
1407
|
AssetOperation2["Promote"] = "promote";
|
|
@@ -2962,26 +3057,50 @@ function getTokenOperationsQueryOptions(token, username, isForOwner = false) {
|
|
|
2962
3057
|
return queryOptions({
|
|
2963
3058
|
queryKey: ["wallets", "token-operations", token, username, isForOwner],
|
|
2964
3059
|
queryFn: async () => {
|
|
3060
|
+
const queryClient = getQueryClient();
|
|
3061
|
+
const ensureAssetInfo = async () => {
|
|
3062
|
+
if (!isForOwner || !username) {
|
|
3063
|
+
return void 0;
|
|
3064
|
+
}
|
|
3065
|
+
return await queryClient.ensureQueryData(
|
|
3066
|
+
getAccountWalletAssetInfoQueryOptions(username, token)
|
|
3067
|
+
);
|
|
3068
|
+
};
|
|
2965
3069
|
switch (token) {
|
|
2966
|
-
case "HIVE" /* Hive */:
|
|
3070
|
+
case "HIVE" /* Hive */: {
|
|
3071
|
+
const assetInfo = await ensureAssetInfo();
|
|
3072
|
+
const savingsBalance = assetInfo?.parts?.find(
|
|
3073
|
+
(part) => part.name === "savings"
|
|
3074
|
+
)?.balance;
|
|
2967
3075
|
return [
|
|
2968
3076
|
"transfer" /* Transfer */,
|
|
2969
3077
|
...isForOwner ? [
|
|
3078
|
+
...savingsBalance && savingsBalance > 0 ? ["withdraw-saving" /* WithdrawFromSavings */] : [],
|
|
2970
3079
|
"transfer-saving" /* TransferToSavings */,
|
|
2971
3080
|
"power-up" /* PowerUp */,
|
|
2972
3081
|
"swap" /* Swap */
|
|
2973
3082
|
] : []
|
|
2974
3083
|
];
|
|
3084
|
+
}
|
|
2975
3085
|
case "HP" /* HivePower */:
|
|
2976
3086
|
return [
|
|
2977
3087
|
"delegate" /* Delegate */,
|
|
2978
|
-
...isForOwner ? ["power-down" /* PowerDown */, "withdraw-
|
|
3088
|
+
...isForOwner ? ["power-down" /* PowerDown */, "withdraw-routes" /* WithdrawRoutes */] : ["power-up" /* PowerUp */]
|
|
2979
3089
|
];
|
|
2980
|
-
case "HBD" /* HiveDollar */:
|
|
3090
|
+
case "HBD" /* HiveDollar */: {
|
|
3091
|
+
const assetInfo = await ensureAssetInfo();
|
|
3092
|
+
const savingsBalance = assetInfo?.parts?.find(
|
|
3093
|
+
(part) => part.name === "savings"
|
|
3094
|
+
)?.balance;
|
|
2981
3095
|
return [
|
|
2982
3096
|
"transfer" /* Transfer */,
|
|
2983
|
-
...isForOwner ? [
|
|
3097
|
+
...isForOwner ? [
|
|
3098
|
+
...savingsBalance && savingsBalance > 0 ? ["withdraw-saving" /* WithdrawFromSavings */] : [],
|
|
3099
|
+
"transfer-saving" /* TransferToSavings */,
|
|
3100
|
+
"swap" /* Swap */
|
|
3101
|
+
] : []
|
|
2984
3102
|
];
|
|
3103
|
+
}
|
|
2985
3104
|
case "POINTS" /* Points */:
|
|
2986
3105
|
return [
|
|
2987
3106
|
"gift" /* Gift */,
|
|
@@ -3015,7 +3134,6 @@ function getTokenOperationsQueryOptions(token, username, isForOwner = false) {
|
|
|
3015
3134
|
if (!username) {
|
|
3016
3135
|
return ["transfer" /* Transfer */];
|
|
3017
3136
|
}
|
|
3018
|
-
const queryClient = getQueryClient();
|
|
3019
3137
|
const balancesListQuery = getHiveEngineTokensBalancesQueryOptions(username);
|
|
3020
3138
|
const balances = await queryClient.ensureQueryData(balancesListQuery);
|
|
3021
3139
|
const tokensQuery = getHiveEngineTokensMetadataQueryOptions(
|
|
@@ -3382,16 +3500,19 @@ var operationToFunctionMap = {
|
|
|
3382
3500
|
HIVE: {
|
|
3383
3501
|
["transfer" /* Transfer */]: transferHive,
|
|
3384
3502
|
["transfer-saving" /* TransferToSavings */]: transferToSavingsHive,
|
|
3503
|
+
["withdraw-saving" /* WithdrawFromSavings */]: transferFromSavingsHive,
|
|
3385
3504
|
["power-up" /* PowerUp */]: powerUpHive
|
|
3386
3505
|
},
|
|
3387
3506
|
HBD: {
|
|
3388
3507
|
["transfer" /* Transfer */]: transferHive,
|
|
3389
|
-
["transfer-saving" /* TransferToSavings */]: transferToSavingsHive
|
|
3508
|
+
["transfer-saving" /* TransferToSavings */]: transferToSavingsHive,
|
|
3509
|
+
["withdraw-saving" /* WithdrawFromSavings */]: transferFromSavingsHive,
|
|
3510
|
+
["claim-interest" /* ClaimInterest */]: claimInterestHive
|
|
3390
3511
|
},
|
|
3391
3512
|
HP: {
|
|
3392
3513
|
["power-down" /* PowerDown */]: powerDownHive,
|
|
3393
3514
|
["delegate" /* Delegate */]: delegateHive,
|
|
3394
|
-
["withdraw-
|
|
3515
|
+
["withdraw-routes" /* WithdrawRoutes */]: withdrawVestingRouteHive
|
|
3395
3516
|
},
|
|
3396
3517
|
POINTS: {
|
|
3397
3518
|
["gift" /* Gift */]: transferPoint
|
|
@@ -3455,6 +3576,6 @@ function useWalletOperation(username, asset, operation) {
|
|
|
3455
3576
|
// src/index.ts
|
|
3456
3577
|
rememberScryptBsvVersion();
|
|
3457
3578
|
|
|
3458
|
-
export { AssetOperation, EcencyWalletBasicTokens, EcencyWalletCurrency, private_api_exports as EcencyWalletsPrivateApi, NaiMap, PointTransactionType, Symbol2 as Symbol, buildAptTx, buildEthTx, buildExternalTx, buildPsbt, buildSolTx, buildTonTx, buildTronTx, decryptMemoWithAccounts, decryptMemoWithKeys, delay, delegateEngineToken, delegateHive, deriveHiveKey, deriveHiveKeys, deriveHiveMasterPasswordKey, deriveHiveMasterPasswordKeys, detectHiveKeyDerivation, encryptMemoWithAccounts, encryptMemoWithKeys, getAccountWalletAssetInfoQueryOptions, getAccountWalletListQueryOptions, getAllTokensListQueryOptions, getBoundFetch, getHbdAssetGeneralInfoQueryOptions, getHbdAssetTransactionsQueryOptions, getHiveAssetGeneralInfoQueryOptions, getHiveAssetMetricQueryOptions, getHiveAssetTransactionsQueryOptions, getHiveAssetWithdrawalRoutesQueryOptions, getHiveEngineTokenGeneralInfoQueryOptions, getHiveEngineTokenTransactionsQueryOptions, getHiveEngineTokensBalancesQueryOptions, getHiveEngineTokensMarketQueryOptions, getHiveEngineTokensMetadataQueryOptions, getHiveEngineTokensMetricsQueryOptions, getHivePowerAssetGeneralInfoQueryOptions, getHivePowerAssetTransactionsQueryOptions, getHivePowerDelegatesInfiniteQueryOptions, getHivePowerDelegatingsQueryOptions, getLarynxAssetGeneralInfoQueryOptions, getLarynxPowerAssetGeneralInfoQueryOptions, getPointsAssetGeneralInfoQueryOptions, getPointsAssetTransactionsQueryOptions, getPointsQueryOptions, getSpkAssetGeneralInfoQueryOptions, getSpkMarketsQueryOptions, getTokenOperationsQueryOptions, getTokenPriceQueryOptions, getWallet, isEmptyDate, lockLarynx, mnemonicToSeedBip39, parseAsset, powerDownHive, powerUpHive, powerUpLarynx, rewardSpk, signDigest, signExternalTx, signExternalTxAndBroadcast, signTx, signTxAndBroadcast, stakeEngineToken, transferEngineToken, transferHive, transferLarynx, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
|
3579
|
+
export { AssetOperation, EcencyWalletBasicTokens, EcencyWalletCurrency, private_api_exports as EcencyWalletsPrivateApi, NaiMap, PointTransactionType, Symbol2 as Symbol, buildAptTx, buildEthTx, buildExternalTx, buildPsbt, buildSolTx, buildTonTx, buildTronTx, claimInterestHive, decryptMemoWithAccounts, decryptMemoWithKeys, delay, delegateEngineToken, delegateHive, deriveHiveKey, deriveHiveKeys, deriveHiveMasterPasswordKey, deriveHiveMasterPasswordKeys, detectHiveKeyDerivation, encryptMemoWithAccounts, encryptMemoWithKeys, getAccountWalletAssetInfoQueryOptions, getAccountWalletListQueryOptions, getAllTokensListQueryOptions, getBoundFetch, getHbdAssetGeneralInfoQueryOptions, getHbdAssetTransactionsQueryOptions, getHiveAssetGeneralInfoQueryOptions, getHiveAssetMetricQueryOptions, getHiveAssetTransactionsQueryOptions, getHiveAssetWithdrawalRoutesQueryOptions, getHiveEngineTokenGeneralInfoQueryOptions, getHiveEngineTokenTransactionsQueryOptions, getHiveEngineTokensBalancesQueryOptions, getHiveEngineTokensMarketQueryOptions, getHiveEngineTokensMetadataQueryOptions, getHiveEngineTokensMetricsQueryOptions, getHivePowerAssetGeneralInfoQueryOptions, getHivePowerAssetTransactionsQueryOptions, getHivePowerDelegatesInfiniteQueryOptions, getHivePowerDelegatingsQueryOptions, getLarynxAssetGeneralInfoQueryOptions, getLarynxPowerAssetGeneralInfoQueryOptions, getPointsAssetGeneralInfoQueryOptions, getPointsAssetTransactionsQueryOptions, getPointsQueryOptions, getSpkAssetGeneralInfoQueryOptions, getSpkMarketsQueryOptions, getTokenOperationsQueryOptions, getTokenPriceQueryOptions, getWallet, isEmptyDate, lockLarynx, mnemonicToSeedBip39, parseAsset, powerDownHive, powerUpHive, powerUpLarynx, rewardSpk, signDigest, signExternalTx, signExternalTxAndBroadcast, signTx, signTxAndBroadcast, stakeEngineToken, transferEngineToken, transferFromSavingsHive, transferHive, transferLarynx, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
|
3459
3580
|
//# sourceMappingURL=index.js.map
|
|
3460
3581
|
//# sourceMappingURL=index.js.map
|