@ecency/wallets 1.5.16 → 1.5.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 +22 -22
- package/dist/browser/index.js +55 -33
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +55 -33
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.mjs +55 -33
- package/dist/node/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -810,7 +810,7 @@ interface TransferPayload<T extends HiveBasedAssetSignType> {
|
|
|
810
810
|
}
|
|
811
811
|
declare function transferHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? TransferPayload<T> & {
|
|
812
812
|
key: PrivateKey;
|
|
813
|
-
} : TransferPayload<T>, auth?: AuthContext): Promise<
|
|
813
|
+
} : TransferPayload<T>, auth?: AuthContext): Promise<any>;
|
|
814
814
|
|
|
815
815
|
interface Payload$5<T extends HiveBasedAssetSignType> {
|
|
816
816
|
from: string;
|
|
@@ -821,7 +821,7 @@ interface Payload$5<T extends HiveBasedAssetSignType> {
|
|
|
821
821
|
}
|
|
822
822
|
declare function transferToSavingsHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload$5<T> & {
|
|
823
823
|
key: PrivateKey;
|
|
824
|
-
} : Payload$5<T>, auth?: AuthContext): Promise<
|
|
824
|
+
} : Payload$5<T>, auth?: AuthContext): Promise<any>;
|
|
825
825
|
|
|
826
826
|
interface PayloadBase$1 {
|
|
827
827
|
from: string;
|
|
@@ -835,7 +835,7 @@ interface PayloadWithKey$1<T extends HiveBasedAssetSignType> extends PayloadBase
|
|
|
835
835
|
}
|
|
836
836
|
declare function transferFromSavingsHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? PayloadWithKey$1<T> & {
|
|
837
837
|
key: PrivateKey;
|
|
838
|
-
} : PayloadWithKey$1<T>, auth?: AuthContext): Promise<
|
|
838
|
+
} : PayloadWithKey$1<T>, auth?: AuthContext): Promise<any>;
|
|
839
839
|
|
|
840
840
|
interface Payload$4<T extends HiveBasedAssetSignType> {
|
|
841
841
|
from: string;
|
|
@@ -846,7 +846,7 @@ interface Payload$4<T extends HiveBasedAssetSignType> {
|
|
|
846
846
|
}
|
|
847
847
|
declare function powerUpHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload$4<T> & {
|
|
848
848
|
key: PrivateKey;
|
|
849
|
-
} : Payload$4<T>, auth?: AuthContext): Promise<
|
|
849
|
+
} : Payload$4<T>, auth?: AuthContext): Promise<any>;
|
|
850
850
|
|
|
851
851
|
interface Payload$3<T extends HiveBasedAssetSignType> {
|
|
852
852
|
from: string;
|
|
@@ -857,7 +857,7 @@ interface Payload$3<T extends HiveBasedAssetSignType> {
|
|
|
857
857
|
}
|
|
858
858
|
declare function delegateHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload$3<T> & {
|
|
859
859
|
key: PrivateKey;
|
|
860
|
-
} : Payload$3<T>, auth?: AuthContext): Promise<
|
|
860
|
+
} : Payload$3<T>, auth?: AuthContext): Promise<any>;
|
|
861
861
|
|
|
862
862
|
interface Payload$2<T extends HiveBasedAssetSignType> {
|
|
863
863
|
from: string;
|
|
@@ -866,7 +866,7 @@ interface Payload$2<T extends HiveBasedAssetSignType> {
|
|
|
866
866
|
}
|
|
867
867
|
declare function powerDownHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload$2<T> & {
|
|
868
868
|
key: PrivateKey;
|
|
869
|
-
} : Payload$2<T>, auth?: AuthContext): Promise<
|
|
869
|
+
} : Payload$2<T>, auth?: AuthContext): Promise<any>;
|
|
870
870
|
|
|
871
871
|
interface Payload$1<T extends HiveBasedAssetSignType> {
|
|
872
872
|
from_account: string;
|
|
@@ -877,7 +877,7 @@ interface Payload$1<T extends HiveBasedAssetSignType> {
|
|
|
877
877
|
}
|
|
878
878
|
declare function withdrawVestingRouteHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload$1<T> & {
|
|
879
879
|
key: PrivateKey;
|
|
880
|
-
} : Payload$1<T>, auth?: AuthContext): Promise<
|
|
880
|
+
} : Payload$1<T>, auth?: AuthContext): Promise<any>;
|
|
881
881
|
|
|
882
882
|
declare function useClaimRewards(username: string, auth: AuthContext | undefined, onSuccess: () => void): ReturnType<typeof useBroadcastMutation<void>>;
|
|
883
883
|
|
|
@@ -893,7 +893,7 @@ interface PayloadWithKey<T extends HiveBasedAssetSignType> extends PayloadBase {
|
|
|
893
893
|
}
|
|
894
894
|
declare function claimInterestHive<T extends HiveBasedAssetSignType>(payload: T extends "key" ? PayloadWithKey<T> & {
|
|
895
895
|
key: PrivateKey;
|
|
896
|
-
} : PayloadWithKey<T>, auth?: AuthContext): Promise<
|
|
896
|
+
} : PayloadWithKey<T>, auth?: AuthContext): Promise<any>;
|
|
897
897
|
|
|
898
898
|
interface Payload<T extends HiveBasedAssetSignType> {
|
|
899
899
|
from: string;
|
|
@@ -902,7 +902,7 @@ interface Payload<T extends HiveBasedAssetSignType> {
|
|
|
902
902
|
}
|
|
903
903
|
declare function convertHbd<T extends HiveBasedAssetSignType>(payload: T extends "key" ? Payload<T> & {
|
|
904
904
|
key: PrivateKey;
|
|
905
|
-
} : Payload<T>, auth?: AuthContext): Promise<
|
|
905
|
+
} : Payload<T>, auth?: AuthContext): Promise<any>;
|
|
906
906
|
|
|
907
907
|
declare const HIVE_ACCOUNT_OPERATION_GROUPS: Record<HiveOperationGroup, number[]>;
|
|
908
908
|
|
|
@@ -951,7 +951,7 @@ interface SpkTransferPayload<T extends HiveBasedAssetSignType> {
|
|
|
951
951
|
}
|
|
952
952
|
declare function transferSpk<T extends HiveBasedAssetSignType>(payload: T extends "key" ? SpkTransferPayload<T> & {
|
|
953
953
|
key: PrivateKey;
|
|
954
|
-
} : SpkTransferPayload<T>, auth?: AuthContext): Promise<
|
|
954
|
+
} : SpkTransferPayload<T>, auth?: AuthContext): Promise<any>;
|
|
955
955
|
|
|
956
956
|
interface SpkLockPayload<T extends HiveBasedAssetSignType> {
|
|
957
957
|
mode: "lock" | "unlock";
|
|
@@ -961,7 +961,7 @@ interface SpkLockPayload<T extends HiveBasedAssetSignType> {
|
|
|
961
961
|
}
|
|
962
962
|
declare const lockLarynx: <T extends HiveBasedAssetSignType>(payload: T extends "key" ? SpkLockPayload<T> & {
|
|
963
963
|
key: PrivateKey;
|
|
964
|
-
} : SpkLockPayload<T>, auth?: AuthContext) => Promise<
|
|
964
|
+
} : SpkLockPayload<T>, auth?: AuthContext) => Promise<any>;
|
|
965
965
|
|
|
966
966
|
interface SpkPowerPayload<T extends HiveBasedAssetSignType> {
|
|
967
967
|
mode: "up" | "down";
|
|
@@ -971,7 +971,7 @@ interface SpkPowerPayload<T extends HiveBasedAssetSignType> {
|
|
|
971
971
|
}
|
|
972
972
|
declare function powerUpLarynx<T extends HiveBasedAssetSignType>(payload: T extends "key" ? SpkPowerPayload<T> & {
|
|
973
973
|
key: PrivateKey;
|
|
974
|
-
} : SpkPowerPayload<T>, auth?: AuthContext): Promise<
|
|
974
|
+
} : SpkPowerPayload<T>, auth?: AuthContext): Promise<any>;
|
|
975
975
|
|
|
976
976
|
interface LarynxTransferPayload<T extends HiveBasedAssetSignType> {
|
|
977
977
|
from: string;
|
|
@@ -982,7 +982,7 @@ interface LarynxTransferPayload<T extends HiveBasedAssetSignType> {
|
|
|
982
982
|
}
|
|
983
983
|
declare function transferLarynx<T extends HiveBasedAssetSignType>(payload: T extends "key" ? LarynxTransferPayload<T> & {
|
|
984
984
|
key: PrivateKey;
|
|
985
|
-
} : LarynxTransferPayload<T>, auth?: AuthContext): Promise<
|
|
985
|
+
} : LarynxTransferPayload<T>, auth?: AuthContext): Promise<any>;
|
|
986
986
|
|
|
987
987
|
declare function getLarynxAssetGeneralInfoQueryOptions(username: string): _tanstack_react_query.OmitKeyof<_tanstack_react_query.UseQueryOptions<{
|
|
988
988
|
name: string;
|
|
@@ -1510,7 +1510,7 @@ interface DelegateEnginePayload<T extends HiveBasedAssetSignType> {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
declare function delegateEngineToken<T extends HiveBasedAssetSignType>(payload: T extends "key" ? DelegateEnginePayload<T> & {
|
|
1512
1512
|
key: PrivateKey;
|
|
1513
|
-
} : DelegateEnginePayload<T>, auth?: AuthContext): Promise<
|
|
1513
|
+
} : DelegateEnginePayload<T>, auth?: AuthContext): Promise<any>;
|
|
1514
1514
|
|
|
1515
1515
|
interface UndelegateEnginePayload<T extends HiveBasedAssetSignType> {
|
|
1516
1516
|
from: string;
|
|
@@ -1521,7 +1521,7 @@ interface UndelegateEnginePayload<T extends HiveBasedAssetSignType> {
|
|
|
1521
1521
|
}
|
|
1522
1522
|
declare function undelegateEngineToken<T extends HiveBasedAssetSignType>(payload: T extends "key" ? UndelegateEnginePayload<T> & {
|
|
1523
1523
|
key: PrivateKey;
|
|
1524
|
-
} : UndelegateEnginePayload<T>, auth?: AuthContext): Promise<
|
|
1524
|
+
} : UndelegateEnginePayload<T>, auth?: AuthContext): Promise<any>;
|
|
1525
1525
|
|
|
1526
1526
|
interface StakeEnginePayload<T extends HiveBasedAssetSignType> {
|
|
1527
1527
|
from: string;
|
|
@@ -1532,7 +1532,7 @@ interface StakeEnginePayload<T extends HiveBasedAssetSignType> {
|
|
|
1532
1532
|
}
|
|
1533
1533
|
declare function stakeEngineToken<T extends HiveBasedAssetSignType>(payload: T extends "key" ? StakeEnginePayload<T> & {
|
|
1534
1534
|
key: PrivateKey;
|
|
1535
|
-
} : StakeEnginePayload<T>, auth?: AuthContext): Promise<
|
|
1535
|
+
} : StakeEnginePayload<T>, auth?: AuthContext): Promise<any>;
|
|
1536
1536
|
|
|
1537
1537
|
interface UnstakeEnginePayload<T extends HiveBasedAssetSignType> {
|
|
1538
1538
|
from: string;
|
|
@@ -1543,7 +1543,7 @@ interface UnstakeEnginePayload<T extends HiveBasedAssetSignType> {
|
|
|
1543
1543
|
}
|
|
1544
1544
|
declare function unstakeEngineToken<T extends HiveBasedAssetSignType>(payload: T extends "key" ? UnstakeEnginePayload<T> & {
|
|
1545
1545
|
key: PrivateKey;
|
|
1546
|
-
} : UnstakeEnginePayload<T>, auth?: AuthContext): Promise<
|
|
1546
|
+
} : UnstakeEnginePayload<T>, auth?: AuthContext): Promise<any>;
|
|
1547
1547
|
|
|
1548
1548
|
interface TransferEnginePayload<T extends HiveBasedAssetSignType> {
|
|
1549
1549
|
from: string;
|
|
@@ -1555,7 +1555,7 @@ interface TransferEnginePayload<T extends HiveBasedAssetSignType> {
|
|
|
1555
1555
|
}
|
|
1556
1556
|
declare function transferEngineToken<T extends HiveBasedAssetSignType>(payload: T extends "key" ? TransferEnginePayload<T> & {
|
|
1557
1557
|
key: PrivateKey;
|
|
1558
|
-
} : TransferEnginePayload<T>, auth?: AuthContext): Promise<
|
|
1558
|
+
} : TransferEnginePayload<T>, auth?: AuthContext): Promise<any>;
|
|
1559
1559
|
|
|
1560
1560
|
type EngineOrderSignMethod = "key" | "keychain" | "hivesigner" | "hiveauth";
|
|
1561
1561
|
interface EngineOrderBroadcastOptions {
|
|
@@ -1563,9 +1563,9 @@ interface EngineOrderBroadcastOptions {
|
|
|
1563
1563
|
key?: PrivateKey;
|
|
1564
1564
|
auth?: AuthContext;
|
|
1565
1565
|
}
|
|
1566
|
-
declare const placeHiveEngineBuyOrder: (account: string, symbol: string, quantity: string, price: string, options?: EngineOrderBroadcastOptions) => Promise<
|
|
1567
|
-
declare const placeHiveEngineSellOrder: (account: string, symbol: string, quantity: string, price: string, options?: EngineOrderBroadcastOptions) => Promise<
|
|
1568
|
-
declare const cancelHiveEngineOrder: (account: string, type: "buy" | "sell", orderId: string, options?: EngineOrderBroadcastOptions) => Promise<
|
|
1566
|
+
declare const placeHiveEngineBuyOrder: (account: string, symbol: string, quantity: string, price: string, options?: EngineOrderBroadcastOptions) => Promise<any>;
|
|
1567
|
+
declare const placeHiveEngineSellOrder: (account: string, symbol: string, quantity: string, price: string, options?: EngineOrderBroadcastOptions) => Promise<any>;
|
|
1568
|
+
declare const cancelHiveEngineOrder: (account: string, type: "buy" | "sell", orderId: string, options?: EngineOrderBroadcastOptions) => Promise<any>;
|
|
1569
1569
|
|
|
1570
1570
|
interface ClaimRewardsPayload<T extends HiveBasedAssetSignType> {
|
|
1571
1571
|
account: string;
|
|
@@ -1574,7 +1574,7 @@ interface ClaimRewardsPayload<T extends HiveBasedAssetSignType> {
|
|
|
1574
1574
|
}
|
|
1575
1575
|
declare function claimHiveEngineRewards<T extends HiveBasedAssetSignType>(payload: T extends "key" ? ClaimRewardsPayload<T> & {
|
|
1576
1576
|
key: PrivateKey;
|
|
1577
|
-
} : ClaimRewardsPayload<T>, auth?: AuthContext): Promise<
|
|
1577
|
+
} : ClaimRewardsPayload<T>, auth?: AuthContext): Promise<any>;
|
|
1578
1578
|
|
|
1579
1579
|
declare function useClaimPoints(username: string | undefined, accessToken: string | undefined, onSuccess?: () => void, onError?: Parameters<typeof useMutation>["0"]["onError"]): _tanstack_react_query.UseMutationResult<any, unknown, unknown, unknown>;
|
|
1580
1580
|
|
package/dist/browser/index.js
CHANGED
|
@@ -1238,6 +1238,29 @@ function getHivePowerDelegatingsQueryOptions(username) {
|
|
|
1238
1238
|
)
|
|
1239
1239
|
});
|
|
1240
1240
|
}
|
|
1241
|
+
|
|
1242
|
+
// src/modules/assets/utils/keychain-fallback.ts
|
|
1243
|
+
async function broadcastWithKeychainFallback(account, operations, authority = "Active") {
|
|
1244
|
+
if (typeof window === "undefined" || !window.hive_keychain) {
|
|
1245
|
+
throw new Error("[SDK][Wallets] \u2013 Keychain extension not found");
|
|
1246
|
+
}
|
|
1247
|
+
return new Promise((resolve, reject) => {
|
|
1248
|
+
window.hive_keychain.requestBroadcast(
|
|
1249
|
+
account,
|
|
1250
|
+
operations,
|
|
1251
|
+
authority,
|
|
1252
|
+
(response) => {
|
|
1253
|
+
if (!response.success) {
|
|
1254
|
+
reject(new Error(response.message || "Keychain operation cancelled"));
|
|
1255
|
+
return;
|
|
1256
|
+
}
|
|
1257
|
+
resolve(response.result);
|
|
1258
|
+
}
|
|
1259
|
+
);
|
|
1260
|
+
});
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
// src/modules/assets/hive/mutations/transfer.ts
|
|
1241
1264
|
async function transferHive(payload, auth) {
|
|
1242
1265
|
const parsedAsset = parseAsset(payload.amount);
|
|
1243
1266
|
const token = parsedAsset.symbol;
|
|
@@ -1268,7 +1291,7 @@ async function transferHive(payload, auth) {
|
|
|
1268
1291
|
if (auth?.broadcast) {
|
|
1269
1292
|
return auth.broadcast([operation], "active");
|
|
1270
1293
|
}
|
|
1271
|
-
|
|
1294
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1272
1295
|
} else if (payload.type === "hiveauth") {
|
|
1273
1296
|
if (auth?.broadcast) {
|
|
1274
1297
|
return auth.broadcast([operation], "active");
|
|
@@ -1301,7 +1324,7 @@ async function transferToSavingsHive(payload, auth) {
|
|
|
1301
1324
|
if (auth?.broadcast) {
|
|
1302
1325
|
return auth.broadcast([operation], "active");
|
|
1303
1326
|
}
|
|
1304
|
-
|
|
1327
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1305
1328
|
} else if (payload.type === "hiveauth") {
|
|
1306
1329
|
if (auth?.broadcast) {
|
|
1307
1330
|
return auth.broadcast([operation], "active");
|
|
@@ -1333,7 +1356,7 @@ async function transferFromSavingsHive(payload, auth) {
|
|
|
1333
1356
|
if (auth?.broadcast) {
|
|
1334
1357
|
return auth.broadcast([operation], "active");
|
|
1335
1358
|
}
|
|
1336
|
-
|
|
1359
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1337
1360
|
}
|
|
1338
1361
|
if (payload.type === "hiveauth") {
|
|
1339
1362
|
if (auth?.broadcast) {
|
|
@@ -1362,7 +1385,7 @@ async function powerUpHive(payload, auth) {
|
|
|
1362
1385
|
if (auth?.broadcast) {
|
|
1363
1386
|
return auth.broadcast([operation], "active");
|
|
1364
1387
|
}
|
|
1365
|
-
|
|
1388
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1366
1389
|
} else if (payload.type === "hiveauth") {
|
|
1367
1390
|
if (auth?.broadcast) {
|
|
1368
1391
|
return auth.broadcast([operation], "active");
|
|
@@ -1390,7 +1413,7 @@ async function delegateHive(payload, auth) {
|
|
|
1390
1413
|
if (auth?.broadcast) {
|
|
1391
1414
|
return auth.broadcast([operation], "active");
|
|
1392
1415
|
}
|
|
1393
|
-
|
|
1416
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1394
1417
|
} else if (payload.type === "hiveauth") {
|
|
1395
1418
|
if (auth?.broadcast) {
|
|
1396
1419
|
return auth.broadcast([operation], "active");
|
|
@@ -1417,7 +1440,7 @@ async function powerDownHive(payload, auth) {
|
|
|
1417
1440
|
if (auth?.broadcast) {
|
|
1418
1441
|
return auth.broadcast([operation], "active");
|
|
1419
1442
|
}
|
|
1420
|
-
|
|
1443
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1421
1444
|
} else if (payload.type === "hiveauth") {
|
|
1422
1445
|
if (auth?.broadcast) {
|
|
1423
1446
|
return auth.broadcast([operation], "active");
|
|
@@ -1447,7 +1470,7 @@ async function withdrawVestingRouteHive(payload, auth) {
|
|
|
1447
1470
|
if (auth?.broadcast) {
|
|
1448
1471
|
return auth.broadcast([operation], "active");
|
|
1449
1472
|
}
|
|
1450
|
-
|
|
1473
|
+
return broadcastWithKeychainFallback(payload.from_account, [operation], "Active");
|
|
1451
1474
|
}
|
|
1452
1475
|
if (payload.type === "hiveauth") {
|
|
1453
1476
|
if (auth?.broadcast) {
|
|
@@ -1560,7 +1583,7 @@ async function claimInterestHive(payload, auth) {
|
|
|
1560
1583
|
if (auth?.broadcast) {
|
|
1561
1584
|
return auth.broadcast(operations, "active");
|
|
1562
1585
|
}
|
|
1563
|
-
|
|
1586
|
+
return broadcastWithKeychainFallback(payload.from, operations, "Active");
|
|
1564
1587
|
}
|
|
1565
1588
|
if (payload.type === "hiveauth") {
|
|
1566
1589
|
if (auth?.broadcast) {
|
|
@@ -1589,7 +1612,7 @@ async function convertHbd(payload, auth) {
|
|
|
1589
1612
|
if (auth?.broadcast) {
|
|
1590
1613
|
return auth.broadcast([operation], "active");
|
|
1591
1614
|
}
|
|
1592
|
-
|
|
1615
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1593
1616
|
} else if (payload.type === "hiveauth") {
|
|
1594
1617
|
if (auth?.broadcast) {
|
|
1595
1618
|
return auth.broadcast([operation], "active");
|
|
@@ -1651,7 +1674,7 @@ async function transferSpk(payload, auth) {
|
|
|
1651
1674
|
if (auth?.broadcast) {
|
|
1652
1675
|
return auth.broadcast([operation], "active");
|
|
1653
1676
|
}
|
|
1654
|
-
|
|
1677
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1655
1678
|
} else if (payload.type === "hiveauth") {
|
|
1656
1679
|
if (auth?.broadcast) {
|
|
1657
1680
|
return auth.broadcast([operation], "active");
|
|
@@ -1700,7 +1723,7 @@ var lockLarynx = async (payload, auth) => {
|
|
|
1700
1723
|
if (auth?.broadcast) {
|
|
1701
1724
|
return auth.broadcast([operation], "active");
|
|
1702
1725
|
}
|
|
1703
|
-
|
|
1726
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1704
1727
|
} else if (payload.type === "hiveauth") {
|
|
1705
1728
|
if (auth?.broadcast) {
|
|
1706
1729
|
return auth.broadcast([operation], "active");
|
|
@@ -1745,7 +1768,7 @@ async function powerUpLarynx(payload, auth) {
|
|
|
1745
1768
|
if (auth?.broadcast) {
|
|
1746
1769
|
return auth.broadcast([operation], "active");
|
|
1747
1770
|
}
|
|
1748
|
-
|
|
1771
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1749
1772
|
} else if (payload.type === "hiveauth") {
|
|
1750
1773
|
if (auth?.broadcast) {
|
|
1751
1774
|
return auth.broadcast([operation], "active");
|
|
@@ -1794,7 +1817,7 @@ async function transferLarynx(payload, auth) {
|
|
|
1794
1817
|
if (auth?.broadcast) {
|
|
1795
1818
|
return auth.broadcast([operation], "active");
|
|
1796
1819
|
}
|
|
1797
|
-
|
|
1820
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
1798
1821
|
} else if (payload.type === "hiveauth") {
|
|
1799
1822
|
if (auth?.broadcast) {
|
|
1800
1823
|
return auth.broadcast([operation], "active");
|
|
@@ -2305,7 +2328,7 @@ async function broadcastHiveEngineOperation(payload, operation, auth) {
|
|
|
2305
2328
|
if (auth?.broadcast) {
|
|
2306
2329
|
return auth.broadcast([operation], "active");
|
|
2307
2330
|
}
|
|
2308
|
-
|
|
2331
|
+
return broadcastWithKeychainFallback(payload.from, [operation], "Active");
|
|
2309
2332
|
}
|
|
2310
2333
|
if (payload.type === "hiveauth") {
|
|
2311
2334
|
if (auth?.broadcast) {
|
|
@@ -2592,15 +2615,17 @@ async function broadcastEngineOperation(account, payload, options2) {
|
|
|
2592
2615
|
}
|
|
2593
2616
|
return CONFIG.hiveClient.broadcast.json(operation, options2.key);
|
|
2594
2617
|
}
|
|
2595
|
-
case "keychain":
|
|
2596
|
-
case "hiveauth": {
|
|
2618
|
+
case "keychain": {
|
|
2597
2619
|
if (options2.auth?.broadcast) {
|
|
2598
2620
|
return options2.auth.broadcast([opTuple], "active");
|
|
2599
2621
|
}
|
|
2600
|
-
|
|
2601
|
-
|
|
2622
|
+
return broadcastWithKeychainFallback(account, [opTuple], "Active");
|
|
2623
|
+
}
|
|
2624
|
+
case "hiveauth": {
|
|
2625
|
+
if (options2.auth?.broadcast) {
|
|
2626
|
+
return options2.auth.broadcast([opTuple], "active");
|
|
2602
2627
|
}
|
|
2603
|
-
|
|
2628
|
+
return broadcastWithWalletHiveAuth(account, [opTuple], "active");
|
|
2604
2629
|
}
|
|
2605
2630
|
case "hivesigner":
|
|
2606
2631
|
return hs.sendOperation(
|
|
@@ -2642,24 +2667,21 @@ async function claimHiveEngineRewards(payload, auth) {
|
|
|
2642
2667
|
if (payload.type === "key" && "key" in payload) {
|
|
2643
2668
|
return CONFIG.hiveClient.broadcast.sendOperations([operation], payload.key);
|
|
2644
2669
|
}
|
|
2645
|
-
if (
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2670
|
+
if (auth?.broadcast) {
|
|
2671
|
+
return auth.broadcast([operation], "posting");
|
|
2672
|
+
}
|
|
2673
|
+
if (auth?.postingKey) {
|
|
2674
|
+
const key = PrivateKey.fromString(auth.postingKey);
|
|
2675
|
+
return CONFIG.hiveClient.broadcast.sendOperations([operation], key);
|
|
2676
|
+
}
|
|
2677
|
+
if (auth?.accessToken) {
|
|
2678
|
+
const client = new hs.Client({ accessToken: auth.accessToken });
|
|
2679
|
+
return client.broadcast([operation]);
|
|
2650
2680
|
}
|
|
2651
2681
|
if (payload.type === "hiveauth") {
|
|
2652
|
-
if (auth?.broadcast) {
|
|
2653
|
-
return auth.broadcast([operation], "posting");
|
|
2654
|
-
}
|
|
2655
2682
|
return broadcastWithWalletHiveAuth(payload.account, [operation], "posting");
|
|
2656
2683
|
}
|
|
2657
|
-
|
|
2658
|
-
operation,
|
|
2659
|
-
{ callback: `https://ecency.com/@${payload.account}/wallet/engine` },
|
|
2660
|
-
() => {
|
|
2661
|
-
}
|
|
2662
|
-
);
|
|
2684
|
+
throw new Error("[SDK][Wallets] \u2013 cannot broadcast without auth context");
|
|
2663
2685
|
}
|
|
2664
2686
|
function getPointsQueryOptions(username) {
|
|
2665
2687
|
return queryOptions({
|