@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.
@@ -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: +payload.amount * 1e3,
1325
+ amount: parseAsset(payload.amount).amount * 1e3,
1326
1326
  ...typeof payload.memo === "string" ? { memo: payload.memo } : {}
1327
1327
  });
1328
1328
  const op = {
1329
- id: payload.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
- payload.id,
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: payload.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.mjs.map
3416
3459
  //# sourceMappingURL=index.mjs.map