@ecency/wallets 1.4.14 → 1.4.15
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 +12 -2
- package/dist/browser/index.js +48 -5
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +48 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +48 -5
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -818,7 +818,6 @@ declare function vestsToHp(vests: number, hivePerMVests: number): number;
|
|
|
818
818
|
declare function rewardSpk(data: SpkApiWallet, sstats: any): number;
|
|
819
819
|
|
|
820
820
|
interface SpkTransferPayload<T extends HiveBasedAssetSignType> {
|
|
821
|
-
id: string;
|
|
822
821
|
from: string;
|
|
823
822
|
to: string;
|
|
824
823
|
amount: string;
|
|
@@ -849,6 +848,17 @@ declare function powerUpLarynx<T extends HiveBasedAssetSignType>(payload: T exte
|
|
|
849
848
|
key: PrivateKey;
|
|
850
849
|
} : SpkPowerPayload<T>): Promise<unknown>;
|
|
851
850
|
|
|
851
|
+
interface LarynxTransferPayload<T extends HiveBasedAssetSignType> {
|
|
852
|
+
from: string;
|
|
853
|
+
to: string;
|
|
854
|
+
amount: string;
|
|
855
|
+
memo?: string;
|
|
856
|
+
type: T;
|
|
857
|
+
}
|
|
858
|
+
declare function transferLarynx<T extends HiveBasedAssetSignType>(payload: T extends "key" ? LarynxTransferPayload<T> & {
|
|
859
|
+
key: PrivateKey;
|
|
860
|
+
} : LarynxTransferPayload<T>): Promise<unknown>;
|
|
861
|
+
|
|
852
862
|
declare function getLarynxAssetGeneralInfoQueryOptions(username: string): _tanstack_react_query.OmitKeyof<_tanstack_react_query.UseQueryOptions<{
|
|
853
863
|
name: string;
|
|
854
864
|
title: string;
|
|
@@ -1660,4 +1670,4 @@ declare function buildExternalTx(currency: EcencyWalletCurrency, tx: ExternalTxP
|
|
|
1660
1670
|
|
|
1661
1671
|
declare function getBoundFetch(): typeof fetch;
|
|
1662
1672
|
|
|
1663
|
-
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, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
|
1673
|
+
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 };
|
package/dist/browser/index.js
CHANGED
|
@@ -1322,11 +1322,11 @@ var AssetOperation = /* @__PURE__ */ ((AssetOperation2) => {
|
|
|
1322
1322
|
async function transferSpk(payload) {
|
|
1323
1323
|
const json = JSON.stringify({
|
|
1324
1324
|
to: payload.to,
|
|
1325
|
-
amount:
|
|
1325
|
+
amount: parseAsset(payload.amount).amount * 1e3,
|
|
1326
1326
|
...typeof payload.memo === "string" ? { memo: payload.memo } : {}
|
|
1327
1327
|
});
|
|
1328
1328
|
const op = {
|
|
1329
|
-
id:
|
|
1329
|
+
id: "spkcc_spk_send",
|
|
1330
1330
|
json,
|
|
1331
1331
|
required_auths: [payload.from],
|
|
1332
1332
|
required_posting_auths: []
|
|
@@ -1337,7 +1337,7 @@ async function transferSpk(payload) {
|
|
|
1337
1337
|
} else if (payload.type === "keychain") {
|
|
1338
1338
|
return Keychain.customJson(
|
|
1339
1339
|
payload.from,
|
|
1340
|
-
|
|
1340
|
+
"spkcc_spk_send",
|
|
1341
1341
|
"Active",
|
|
1342
1342
|
json,
|
|
1343
1343
|
payload.to
|
|
@@ -1350,7 +1350,7 @@ async function transferSpk(payload) {
|
|
|
1350
1350
|
authority: "active",
|
|
1351
1351
|
required_auths: `["${payload.from}"]`,
|
|
1352
1352
|
required_posting_auths: "[]",
|
|
1353
|
-
id:
|
|
1353
|
+
id: "spkcc_spk_send",
|
|
1354
1354
|
json: JSON.stringify({
|
|
1355
1355
|
to: payload.to,
|
|
1356
1356
|
amount: +amount * 1e3,
|
|
@@ -1429,6 +1429,48 @@ async function powerUpLarynx(payload) {
|
|
|
1429
1429
|
);
|
|
1430
1430
|
}
|
|
1431
1431
|
}
|
|
1432
|
+
async function transferLarynx(payload) {
|
|
1433
|
+
const json = JSON.stringify({
|
|
1434
|
+
to: payload.to,
|
|
1435
|
+
amount: parseAsset(payload.amount).amount * 1e3,
|
|
1436
|
+
...typeof payload.memo === "string" ? { memo: payload.memo } : {}
|
|
1437
|
+
});
|
|
1438
|
+
const op = {
|
|
1439
|
+
id: "spkcc_send",
|
|
1440
|
+
json,
|
|
1441
|
+
required_auths: [payload.from],
|
|
1442
|
+
required_posting_auths: []
|
|
1443
|
+
};
|
|
1444
|
+
if (payload.type === "key" && "key" in payload) {
|
|
1445
|
+
const { key } = payload;
|
|
1446
|
+
return CONFIG.hiveClient.broadcast.json(op, key);
|
|
1447
|
+
} else if (payload.type === "keychain") {
|
|
1448
|
+
return Keychain.customJson(
|
|
1449
|
+
payload.from,
|
|
1450
|
+
"spkcc_send",
|
|
1451
|
+
"Active",
|
|
1452
|
+
json,
|
|
1453
|
+
payload.to
|
|
1454
|
+
);
|
|
1455
|
+
} else {
|
|
1456
|
+
const { amount } = parseAsset(payload.amount);
|
|
1457
|
+
return hs.sign(
|
|
1458
|
+
"custom_json",
|
|
1459
|
+
{
|
|
1460
|
+
authority: "active",
|
|
1461
|
+
required_auths: `["${payload.from}"]`,
|
|
1462
|
+
required_posting_auths: "[]",
|
|
1463
|
+
id: "spkcc_send",
|
|
1464
|
+
json: JSON.stringify({
|
|
1465
|
+
to: payload.to,
|
|
1466
|
+
amount: +amount * 1e3,
|
|
1467
|
+
...typeof payload.memo === "string" ? { memo: payload.memo } : {}
|
|
1468
|
+
})
|
|
1469
|
+
},
|
|
1470
|
+
`https://ecency.com/@${payload.from}/wallet`
|
|
1471
|
+
);
|
|
1472
|
+
}
|
|
1473
|
+
}
|
|
1432
1474
|
function getSpkMarketsQueryOptions() {
|
|
1433
1475
|
return queryOptions({
|
|
1434
1476
|
queryKey: ["assets", "spk", "markets"],
|
|
@@ -3357,6 +3399,7 @@ var operationToFunctionMap = {
|
|
|
3357
3399
|
["transfer" /* Transfer */]: transferSpk
|
|
3358
3400
|
},
|
|
3359
3401
|
LARYNX: {
|
|
3402
|
+
["transfer" /* Transfer */]: transferLarynx,
|
|
3360
3403
|
["lock" /* LockLiquidity */]: lockLarynx,
|
|
3361
3404
|
["power-up" /* PowerUp */]: powerUpLarynx
|
|
3362
3405
|
}
|
|
@@ -3411,6 +3454,6 @@ function useWalletOperation(username, asset, operation) {
|
|
|
3411
3454
|
// src/index.ts
|
|
3412
3455
|
rememberScryptBsvVersion();
|
|
3413
3456
|
|
|
3414
|
-
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, transferPoint, transferSpk, transferToSavingsHive, undelegateEngineToken, unstakeEngineToken, useClaimPoints, useClaimRewards, useGetExternalWalletBalanceQuery, useHiveKeysQuery, useImportWallet, useSaveWalletInformationToMetadata, useSeedPhrase, useWalletCreate, useWalletOperation, useWalletsCacheQuery, vestsToHp, withdrawVestingRouteHive };
|
|
3457
|
+
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 };
|
|
3415
3458
|
//# sourceMappingURL=index.js.map
|
|
3416
3459
|
//# sourceMappingURL=index.js.map
|