@hsuite/smart-engines-sdk 3.0.3 → 3.2.0
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/index.d.ts +437 -67
- package/dist/index.js +602 -68
- package/dist/index.js.map +1 -1
- package/dist/nestjs/index.d.ts +382 -66
- package/dist/nestjs/index.js +555 -68
- package/dist/nestjs/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -970,6 +970,46 @@ export declare class MirrorNodeError extends Error {
|
|
|
970
970
|
statusCode: number;
|
|
971
971
|
constructor(message: string, statusCode: number);
|
|
972
972
|
}
|
|
973
|
+
export interface ClusterEndpointsView {
|
|
974
|
+
clusterId: string;
|
|
975
|
+
gatewayUrl: string;
|
|
976
|
+
harborUrl?: string;
|
|
977
|
+
natsUrl?: string;
|
|
978
|
+
publicIp?: string;
|
|
979
|
+
region?: string;
|
|
980
|
+
}
|
|
981
|
+
export interface ClusterInfo {
|
|
982
|
+
clusterId: string;
|
|
983
|
+
endpoints: ClusterEndpointsView;
|
|
984
|
+
nodeIds: string[];
|
|
985
|
+
}
|
|
986
|
+
export interface ClusterDiscoveryConfig {
|
|
987
|
+
bootstrap: string[];
|
|
988
|
+
cacheTtlMs?: number;
|
|
989
|
+
fetchTimeoutMs?: number;
|
|
990
|
+
trustAnchor?: ValidatorDiscoveryConfig;
|
|
991
|
+
allowInsecure?: boolean;
|
|
992
|
+
}
|
|
993
|
+
declare class ClusterDiscoveryClient {
|
|
994
|
+
private readonly bootstrap;
|
|
995
|
+
private readonly cacheTtlMs;
|
|
996
|
+
private readonly fetchTimeoutMs;
|
|
997
|
+
private readonly allowInsecure;
|
|
998
|
+
private readonly trustAnchorClient;
|
|
999
|
+
private cache;
|
|
1000
|
+
constructor(config: ClusterDiscoveryConfig);
|
|
1001
|
+
getClusters(forceRefresh?: boolean): Promise<ClusterInfo[]>;
|
|
1002
|
+
getRandomCluster(forceRefresh?: boolean): Promise<ClusterInfo | null>;
|
|
1003
|
+
getRandomGatewayUrl(forceRefresh?: boolean): Promise<string | null>;
|
|
1004
|
+
getClusterById(clusterId: string, forceRefresh?: boolean): Promise<ClusterInfo | null>;
|
|
1005
|
+
clearCache(): void;
|
|
1006
|
+
private isCacheValid;
|
|
1007
|
+
private fetchFromFirstAvailableSeed;
|
|
1008
|
+
private fetchClustersFromSeed;
|
|
1009
|
+
private normalizeClusterEntry;
|
|
1010
|
+
private verifyAgainstTrustAnchor;
|
|
1011
|
+
private pickRandomIndex;
|
|
1012
|
+
}
|
|
973
1013
|
export type AuthChain = "hedera" | "xrpl" | "polkadot" | "stellar" | "solana";
|
|
974
1014
|
export interface SecurityConfig {
|
|
975
1015
|
allowInsecure?: boolean;
|
|
@@ -1070,6 +1110,14 @@ export declare class SdkHttpError extends Error {
|
|
|
1070
1110
|
}
|
|
1071
1111
|
export declare function createHttpClient(config: HttpClientConfig): HttpClient;
|
|
1072
1112
|
export declare function encodePathParam(param: string): string;
|
|
1113
|
+
export interface RuleRejectedDetails {
|
|
1114
|
+
error: "rule_rejected";
|
|
1115
|
+
reason: string;
|
|
1116
|
+
ruleAtoms: string[];
|
|
1117
|
+
}
|
|
1118
|
+
export declare function isRuleRejected(err: unknown): err is SdkHttpError & {
|
|
1119
|
+
details: RuleRejectedDetails;
|
|
1120
|
+
};
|
|
1073
1121
|
export type SubscriptionTierName = "free_testnet" | "starter" | "professional" | "enterprise";
|
|
1074
1122
|
export type SubscriptionStatus = "pending_deposit" | "deposit_confirmed" | "active" | "expired" | "cancelled";
|
|
1075
1123
|
export type DepositWalletStatus = "pending" | "locked" | "expired" | "slashed" | "released";
|
|
@@ -1361,6 +1409,7 @@ export declare class IPFSClient {
|
|
|
1361
1409
|
getStatus(): Promise<IpfsStatusResponse>;
|
|
1362
1410
|
getStorageUsage(): Promise<IpfsStorageUsageResponse>;
|
|
1363
1411
|
}
|
|
1412
|
+
export type SecurityMode = "none" | "partial" | "full";
|
|
1364
1413
|
export type PreparedTransaction = {
|
|
1365
1414
|
success?: boolean;
|
|
1366
1415
|
transactionBytes: string;
|
|
@@ -1376,135 +1425,267 @@ export type PreparedTransaction = {
|
|
|
1376
1425
|
};
|
|
1377
1426
|
export type PrepareTransferRequest = {
|
|
1378
1427
|
chain: ChainType;
|
|
1379
|
-
payerAccountId
|
|
1428
|
+
payerAccountId?: string;
|
|
1380
1429
|
from: string;
|
|
1381
1430
|
to: string;
|
|
1382
1431
|
amount: string;
|
|
1383
1432
|
tokenId?: string;
|
|
1384
1433
|
entityId?: string;
|
|
1385
1434
|
memo?: string;
|
|
1435
|
+
securityMode?: SecurityMode;
|
|
1436
|
+
appOwnerPublicKey?: string;
|
|
1437
|
+
ss58Format?: number;
|
|
1386
1438
|
};
|
|
1387
1439
|
export type PrepareNftMintRequest = {
|
|
1388
1440
|
chain: ChainType;
|
|
1389
|
-
payerAccountId
|
|
1390
|
-
tokenId
|
|
1391
|
-
metadata
|
|
1441
|
+
payerAccountId?: string;
|
|
1442
|
+
tokenId?: string;
|
|
1443
|
+
metadata?: string | string[];
|
|
1392
1444
|
entityId?: string;
|
|
1445
|
+
securityMode?: SecurityMode;
|
|
1446
|
+
appOwnerPublicKey?: string;
|
|
1447
|
+
ss58Format?: number;
|
|
1448
|
+
collection?: number;
|
|
1449
|
+
item?: number;
|
|
1450
|
+
mintTo?: string;
|
|
1451
|
+
witnessData?: unknown;
|
|
1452
|
+
recipient?: string;
|
|
1453
|
+
collectionMint?: string;
|
|
1454
|
+
name?: string;
|
|
1455
|
+
symbol?: string;
|
|
1456
|
+
uri?: string;
|
|
1457
|
+
sellerFeeBasisPoints?: number;
|
|
1458
|
+
mintAuthority?: string;
|
|
1393
1459
|
};
|
|
1394
1460
|
export type PrepareNftBurnRequest = {
|
|
1395
1461
|
chain: ChainType;
|
|
1396
|
-
payerAccountId
|
|
1397
|
-
tokenId
|
|
1398
|
-
serialNumber
|
|
1462
|
+
payerAccountId?: string;
|
|
1463
|
+
tokenId?: string;
|
|
1464
|
+
serialNumber?: number;
|
|
1399
1465
|
entityId?: string;
|
|
1466
|
+
securityMode?: SecurityMode;
|
|
1467
|
+
appOwnerPublicKey?: string;
|
|
1468
|
+
ss58Format?: number;
|
|
1469
|
+
collection?: number;
|
|
1470
|
+
item?: number;
|
|
1471
|
+
mint?: string;
|
|
1472
|
+
owner?: string;
|
|
1400
1473
|
};
|
|
1401
1474
|
export type PrepareNftTransferRequest = {
|
|
1402
1475
|
chain: ChainType;
|
|
1403
|
-
payerAccountId
|
|
1404
|
-
tokenId
|
|
1405
|
-
serialNumber
|
|
1406
|
-
fromAccountId
|
|
1407
|
-
toAccountId
|
|
1476
|
+
payerAccountId?: string;
|
|
1477
|
+
tokenId?: string;
|
|
1478
|
+
serialNumber?: number;
|
|
1479
|
+
fromAccountId?: string;
|
|
1480
|
+
toAccountId?: string;
|
|
1408
1481
|
entityId?: string;
|
|
1482
|
+
securityMode?: SecurityMode;
|
|
1483
|
+
appOwnerPublicKey?: string;
|
|
1484
|
+
ss58Format?: number;
|
|
1485
|
+
collection?: number;
|
|
1486
|
+
item?: number;
|
|
1487
|
+
dest?: string;
|
|
1488
|
+
mint?: string;
|
|
1489
|
+
fromOwner?: string;
|
|
1490
|
+
toOwner?: string;
|
|
1409
1491
|
};
|
|
1410
1492
|
export type PrepareTokenCreateRequest = {
|
|
1411
|
-
chain:
|
|
1412
|
-
payerAccountId
|
|
1413
|
-
name
|
|
1414
|
-
symbol
|
|
1415
|
-
decimals
|
|
1416
|
-
initialSupply
|
|
1417
|
-
treasuryAccountId
|
|
1418
|
-
entityId
|
|
1493
|
+
chain: ChainType;
|
|
1494
|
+
payerAccountId?: string;
|
|
1495
|
+
name?: string;
|
|
1496
|
+
symbol?: string;
|
|
1497
|
+
decimals?: number;
|
|
1498
|
+
initialSupply?: string;
|
|
1499
|
+
treasuryAccountId?: string;
|
|
1500
|
+
entityId?: string;
|
|
1419
1501
|
memo?: string;
|
|
1420
1502
|
tokenType?: "FUNGIBLE_COMMON" | "NON_FUNGIBLE_UNIQUE";
|
|
1503
|
+
securityMode?: SecurityMode;
|
|
1504
|
+
appOwnerPublicKey?: string;
|
|
1421
1505
|
supplyKey?: string;
|
|
1422
1506
|
adminKey?: string;
|
|
1423
1507
|
pauseKey?: string;
|
|
1424
1508
|
freezeKey?: string;
|
|
1425
1509
|
kycKey?: string;
|
|
1426
1510
|
wipeKey?: string;
|
|
1511
|
+
mintAuthority?: string;
|
|
1512
|
+
assetId?: number;
|
|
1513
|
+
admin?: string;
|
|
1514
|
+
minBalance?: string;
|
|
1515
|
+
assetName?: string;
|
|
1516
|
+
noneOwnerVkeyHex?: string;
|
|
1517
|
+
initialRecipient?: string;
|
|
1427
1518
|
};
|
|
1428
1519
|
export type PrepareTokenMintRequest = {
|
|
1429
1520
|
chain: ChainType;
|
|
1430
|
-
payerAccountId
|
|
1431
|
-
tokenId
|
|
1521
|
+
payerAccountId?: string;
|
|
1522
|
+
tokenId?: string;
|
|
1432
1523
|
amount: string;
|
|
1433
1524
|
recipientAccountId?: string;
|
|
1434
1525
|
entityId?: string;
|
|
1526
|
+
securityMode?: SecurityMode;
|
|
1527
|
+
appOwnerPublicKey?: string;
|
|
1528
|
+
assetId?: number;
|
|
1529
|
+
beneficiary?: string;
|
|
1530
|
+
appOwnerVkeyHex?: string;
|
|
1531
|
+
noneOwnerVkeyHex?: string;
|
|
1532
|
+
destination?: string;
|
|
1435
1533
|
};
|
|
1436
1534
|
export type PrepareTokenBurnRequest = {
|
|
1437
|
-
chain:
|
|
1438
|
-
payerAccountId
|
|
1439
|
-
tokenId
|
|
1535
|
+
chain: ChainType;
|
|
1536
|
+
payerAccountId?: string;
|
|
1537
|
+
tokenId?: string;
|
|
1440
1538
|
amount: string;
|
|
1441
|
-
entityId
|
|
1539
|
+
entityId?: string;
|
|
1540
|
+
securityMode?: SecurityMode;
|
|
1541
|
+
appOwnerPublicKey?: string;
|
|
1542
|
+
assetId?: number;
|
|
1543
|
+
who?: string;
|
|
1544
|
+
appOwnerVkeyHex?: string;
|
|
1545
|
+
noneOwnerVkeyHex?: string;
|
|
1546
|
+
source?: string;
|
|
1442
1547
|
};
|
|
1443
|
-
export type
|
|
1444
|
-
chain:
|
|
1445
|
-
payerAccountId
|
|
1548
|
+
export type PrepareTokenAssociateRequest = {
|
|
1549
|
+
chain: ChainType;
|
|
1550
|
+
payerAccountId?: string;
|
|
1446
1551
|
accountId: string;
|
|
1447
1552
|
tokenIds: string[];
|
|
1448
|
-
entityId
|
|
1553
|
+
entityId?: string;
|
|
1554
|
+
owner?: string;
|
|
1555
|
+
};
|
|
1556
|
+
export type PrepareTokenPauseRequest = {
|
|
1557
|
+
chain: ChainType;
|
|
1558
|
+
payerAccountId?: string;
|
|
1559
|
+
tokenId?: string;
|
|
1560
|
+
assetId?: number;
|
|
1561
|
+
entityId?: string;
|
|
1562
|
+
securityMode?: SecurityMode;
|
|
1563
|
+
appOwnerPublicKey?: string;
|
|
1564
|
+
ss58Format?: number;
|
|
1565
|
+
currentAuthority?: string;
|
|
1566
|
+
newMintAuthority?: string | null;
|
|
1567
|
+
memo?: string;
|
|
1568
|
+
};
|
|
1569
|
+
export type PrepareTokenUnpauseRequest = PrepareTokenPauseRequest;
|
|
1570
|
+
export type PrepareTokenRestrictRequest = {
|
|
1571
|
+
chain: ChainType;
|
|
1572
|
+
payerAccountId?: string;
|
|
1573
|
+
tokenId?: string;
|
|
1574
|
+
accountId?: string;
|
|
1575
|
+
entityId?: string;
|
|
1576
|
+
securityMode?: SecurityMode;
|
|
1577
|
+
appOwnerPublicKey?: string;
|
|
1578
|
+
ss58Format?: number;
|
|
1579
|
+
assetId?: number;
|
|
1580
|
+
who?: string;
|
|
1581
|
+
account?: string;
|
|
1582
|
+
freezeAuthority?: string;
|
|
1583
|
+
memo?: string;
|
|
1584
|
+
};
|
|
1585
|
+
export type PrepareTokenUnrestrictRequest = PrepareTokenRestrictRequest;
|
|
1586
|
+
export type TransactionInfoResponse = {
|
|
1587
|
+
model?: string;
|
|
1588
|
+
description?: string;
|
|
1589
|
+
principles?: string[];
|
|
1590
|
+
supportedChains: string[];
|
|
1591
|
+
responseFormat?: Record<string, string>;
|
|
1449
1592
|
};
|
|
1450
1593
|
export type PrepareTopicCreateRequest = {
|
|
1451
|
-
|
|
1452
|
-
payerAccountId: string;
|
|
1594
|
+
payerAccountId?: string;
|
|
1453
1595
|
memo?: string;
|
|
1454
1596
|
adminKeyRequired?: boolean;
|
|
1455
1597
|
submitKeyRequired?: boolean;
|
|
1456
1598
|
entityId: string;
|
|
1457
1599
|
};
|
|
1458
1600
|
export type PrepareTopicMessageRequest = {
|
|
1459
|
-
|
|
1460
|
-
payerAccountId: string;
|
|
1601
|
+
payerAccountId?: string;
|
|
1461
1602
|
topicId: string;
|
|
1462
1603
|
message: string | Record<string, unknown>;
|
|
1463
1604
|
entityId: string;
|
|
1464
1605
|
};
|
|
1465
|
-
export type
|
|
1466
|
-
|
|
1467
|
-
payerAccountId: string;
|
|
1468
|
-
tokenId: string;
|
|
1469
|
-
entityId: string;
|
|
1470
|
-
memo?: string;
|
|
1471
|
-
};
|
|
1472
|
-
export type PrepareTokenUnpauseRequest = PrepareTokenPauseRequest;
|
|
1473
|
-
export type PrepareTokenRestrictRequest = {
|
|
1474
|
-
chain: "hedera";
|
|
1475
|
-
payerAccountId: string;
|
|
1606
|
+
export type PrepareTokenComplianceEnableRequest = {
|
|
1607
|
+
payerAccountId?: string;
|
|
1476
1608
|
tokenId: string;
|
|
1477
1609
|
accountId: string;
|
|
1478
1610
|
entityId: string;
|
|
1611
|
+
securityMode?: SecurityMode;
|
|
1612
|
+
appOwnerPublicKey?: string;
|
|
1479
1613
|
memo?: string;
|
|
1480
1614
|
};
|
|
1481
|
-
export type
|
|
1482
|
-
export type PrepareTokenComplianceEnableRequest = PrepareTokenRestrictRequest;
|
|
1483
|
-
export type PrepareTokenComplianceDisableRequest = PrepareTokenRestrictRequest;
|
|
1615
|
+
export type PrepareTokenComplianceDisableRequest = PrepareTokenComplianceEnableRequest;
|
|
1484
1616
|
export type PrepareTokenWipeRequest = {
|
|
1485
|
-
|
|
1486
|
-
payerAccountId: string;
|
|
1617
|
+
payerAccountId?: string;
|
|
1487
1618
|
tokenId: string;
|
|
1488
1619
|
accountId: string;
|
|
1489
1620
|
amount: string;
|
|
1490
1621
|
entityId: string;
|
|
1491
1622
|
memo?: string;
|
|
1492
1623
|
};
|
|
1624
|
+
export declare class HederaTransactionsClient {
|
|
1625
|
+
private readonly http;
|
|
1626
|
+
constructor(http: HttpClient);
|
|
1627
|
+
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
1628
|
+
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
1629
|
+
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
1630
|
+
prepareTokenComplianceDisable(request: PrepareTokenComplianceDisableRequest): Promise<PreparedTransaction>;
|
|
1631
|
+
prepareTokenWipe(request: PrepareTokenWipeRequest): Promise<PreparedTransaction>;
|
|
1632
|
+
}
|
|
1493
1633
|
export type PrepareTrustLineRequest = {
|
|
1494
|
-
|
|
1495
|
-
|
|
1634
|
+
accountAddress?: string;
|
|
1635
|
+
payerAccountId?: string;
|
|
1496
1636
|
currency: string;
|
|
1497
1637
|
issuerAddress: string;
|
|
1498
1638
|
limit?: string;
|
|
1499
1639
|
entityId: string;
|
|
1500
1640
|
};
|
|
1501
|
-
export
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1641
|
+
export declare class XrplTransactionsClient {
|
|
1642
|
+
private readonly http;
|
|
1643
|
+
constructor(http: HttpClient);
|
|
1644
|
+
prepareTrustLine(request: PrepareTrustLineRequest): Promise<PreparedTransaction>;
|
|
1645
|
+
}
|
|
1646
|
+
export type PrepareTokenCloseAccountRequest = {
|
|
1647
|
+
payerAccountId?: string;
|
|
1648
|
+
account: string;
|
|
1649
|
+
destination: string;
|
|
1650
|
+
owner?: string;
|
|
1651
|
+
entityId?: string;
|
|
1652
|
+
securityMode?: SecurityMode;
|
|
1653
|
+
appOwnerPublicKey?: string;
|
|
1654
|
+
memo?: string;
|
|
1655
|
+
};
|
|
1656
|
+
export declare class SolanaTransactionsClient {
|
|
1657
|
+
private readonly http;
|
|
1658
|
+
constructor(http: HttpClient);
|
|
1659
|
+
prepareTokenCloseAccount(request: PrepareTokenCloseAccountRequest): Promise<PreparedTransaction>;
|
|
1660
|
+
}
|
|
1661
|
+
export type PrepareAssetSetTeamRequest = {
|
|
1662
|
+
payerAccountId?: string;
|
|
1663
|
+
assetId: number;
|
|
1664
|
+
issuer: string;
|
|
1665
|
+
admin: string;
|
|
1666
|
+
freezer: string;
|
|
1667
|
+
entityId?: string;
|
|
1668
|
+
securityMode?: SecurityMode;
|
|
1669
|
+
appOwnerPublicKey?: string;
|
|
1670
|
+
ss58Format?: number;
|
|
1671
|
+
};
|
|
1672
|
+
export type PrepareAssetSetMetadataRequest = {
|
|
1673
|
+
payerAccountId?: string;
|
|
1674
|
+
assetId: number;
|
|
1675
|
+
name: string;
|
|
1676
|
+
symbol: string;
|
|
1677
|
+
decimals: number;
|
|
1678
|
+
entityId?: string;
|
|
1679
|
+
securityMode?: SecurityMode;
|
|
1680
|
+
appOwnerPublicKey?: string;
|
|
1681
|
+
ss58Format?: number;
|
|
1507
1682
|
};
|
|
1683
|
+
export declare class PolkadotTransactionsClient {
|
|
1684
|
+
private readonly http;
|
|
1685
|
+
constructor(http: HttpClient);
|
|
1686
|
+
prepareAssetSetTeam(request: PrepareAssetSetTeamRequest): Promise<PreparedTransaction>;
|
|
1687
|
+
prepareAssetSetMetadata(request: PrepareAssetSetMetadataRequest): Promise<PreparedTransaction>;
|
|
1688
|
+
}
|
|
1508
1689
|
export declare class TransactionsClient {
|
|
1509
1690
|
private readonly http;
|
|
1510
1691
|
constructor(http: HttpClient);
|
|
@@ -1516,17 +1697,11 @@ export declare class TransactionsClient {
|
|
|
1516
1697
|
prepareTokenCreate(request: PrepareTokenCreateRequest): Promise<PreparedTransaction>;
|
|
1517
1698
|
prepareTokenMint(request: PrepareTokenMintRequest): Promise<PreparedTransaction>;
|
|
1518
1699
|
prepareTokenBurn(request: PrepareTokenBurnRequest): Promise<PreparedTransaction>;
|
|
1519
|
-
|
|
1700
|
+
prepareTokenAssociate(request: PrepareTokenAssociateRequest): Promise<PreparedTransaction>;
|
|
1520
1701
|
prepareTokenPause(request: PrepareTokenPauseRequest): Promise<PreparedTransaction>;
|
|
1521
1702
|
prepareTokenUnpause(request: PrepareTokenUnpauseRequest): Promise<PreparedTransaction>;
|
|
1522
1703
|
prepareTokenRestrict(request: PrepareTokenRestrictRequest): Promise<PreparedTransaction>;
|
|
1523
1704
|
prepareTokenUnrestrict(request: PrepareTokenUnrestrictRequest): Promise<PreparedTransaction>;
|
|
1524
|
-
prepareTokenComplianceEnable(request: PrepareTokenComplianceEnableRequest): Promise<PreparedTransaction>;
|
|
1525
|
-
prepareTokenComplianceDisable(request: PrepareTokenComplianceDisableRequest): Promise<PreparedTransaction>;
|
|
1526
|
-
prepareTokenWipe(request: PrepareTokenWipeRequest): Promise<PreparedTransaction>;
|
|
1527
|
-
prepareTopicCreate(request: PrepareTopicCreateRequest): Promise<PreparedTransaction>;
|
|
1528
|
-
prepareTopicMessage(request: PrepareTopicMessageRequest): Promise<PreparedTransaction>;
|
|
1529
|
-
prepareTrustLine(request: PrepareTrustLineRequest): Promise<PreparedTransaction>;
|
|
1530
1705
|
}
|
|
1531
1706
|
export type SnapshotStatus = "pending" | "generating" | "completed" | "failed";
|
|
1532
1707
|
export type SnapshotFormat = "json" | "csv";
|
|
@@ -1570,6 +1745,48 @@ export declare class SnapshotsClient {
|
|
|
1570
1745
|
listByToken(tokenId: string, pagination?: PaginationOptions): Promise<SnapshotListResponse>;
|
|
1571
1746
|
download(snapshotId: string, format?: SnapshotFormat): Promise<any>;
|
|
1572
1747
|
}
|
|
1748
|
+
export type HistoricalBalanceChain = "hedera" | "xrpl" | "polkadot";
|
|
1749
|
+
export type HistoricalBalanceQueryParams = {
|
|
1750
|
+
chain: HistoricalBalanceChain;
|
|
1751
|
+
entityId: string;
|
|
1752
|
+
account: string;
|
|
1753
|
+
atTimestamp: number;
|
|
1754
|
+
};
|
|
1755
|
+
export type HistoricalBalanceResult = {
|
|
1756
|
+
chain: HistoricalBalanceChain;
|
|
1757
|
+
entityId: string;
|
|
1758
|
+
account: string;
|
|
1759
|
+
atTimestamp: number;
|
|
1760
|
+
balance: string;
|
|
1761
|
+
source: "archive";
|
|
1762
|
+
};
|
|
1763
|
+
export type HistoricalBalanceClientConfig = {
|
|
1764
|
+
baseUrl: string;
|
|
1765
|
+
authToken?: string;
|
|
1766
|
+
apiKey?: string;
|
|
1767
|
+
timeoutMs?: number;
|
|
1768
|
+
fetchImpl?: typeof fetch;
|
|
1769
|
+
};
|
|
1770
|
+
export declare class HistoricalBalanceClientError extends Error {
|
|
1771
|
+
readonly statusCode: number;
|
|
1772
|
+
readonly details?: unknown | undefined;
|
|
1773
|
+
constructor(message: string, statusCode: number, details?: unknown | undefined);
|
|
1774
|
+
}
|
|
1775
|
+
export declare class HistoricalBalanceClient {
|
|
1776
|
+
private readonly baseUrl?;
|
|
1777
|
+
private readonly authToken?;
|
|
1778
|
+
private readonly apiKey?;
|
|
1779
|
+
private readonly timeoutMs;
|
|
1780
|
+
private readonly fetchImpl?;
|
|
1781
|
+
private readonly http?;
|
|
1782
|
+
constructor(config: HistoricalBalanceClientConfig | {
|
|
1783
|
+
http: HttpClient;
|
|
1784
|
+
});
|
|
1785
|
+
static fromHttp(http: HttpClient): HistoricalBalanceClient;
|
|
1786
|
+
getBalance(params: HistoricalBalanceQueryParams): Promise<HistoricalBalanceResult>;
|
|
1787
|
+
private validateParams;
|
|
1788
|
+
private standaloneFetch;
|
|
1789
|
+
}
|
|
1573
1790
|
export type SettlementPurpose = "subscription" | "deposit" | "fee";
|
|
1574
1791
|
export type SettlementAsset = {
|
|
1575
1792
|
symbol: string;
|
|
@@ -1611,6 +1828,121 @@ export declare class SettlementClient {
|
|
|
1611
1828
|
confirmXrpLanded(settlementId: string): Promise<SettlementStatusResponse>;
|
|
1612
1829
|
getHistory(entityId: string): Promise<SettlementHistoryEntry[]>;
|
|
1613
1830
|
}
|
|
1831
|
+
export type GovernanceVotingPowerMethod = "token_balance" | "quadratic" | "one_person_one_vote" | "nft_based" | "time_weighted" | "delegated";
|
|
1832
|
+
export type GovernanceProposalStatus = "pending" | "active" | "passed" | "failed" | "executed" | "cancelled" | "expired" | "vetoed";
|
|
1833
|
+
export type GovernanceVoteType = "for" | "against" | "abstain";
|
|
1834
|
+
export interface GovernanceProposalData {
|
|
1835
|
+
proposalId: string;
|
|
1836
|
+
proposer: string;
|
|
1837
|
+
title: string;
|
|
1838
|
+
description: string;
|
|
1839
|
+
actions: unknown[];
|
|
1840
|
+
status: GovernanceProposalStatus;
|
|
1841
|
+
createdAt: string | Date;
|
|
1842
|
+
votingStartsAt: string | Date;
|
|
1843
|
+
votingEndsAt: string | Date;
|
|
1844
|
+
executionDeadline?: string | Date;
|
|
1845
|
+
votes: {
|
|
1846
|
+
for: string;
|
|
1847
|
+
against: string;
|
|
1848
|
+
abstain: string;
|
|
1849
|
+
totalVotingPower: string;
|
|
1850
|
+
};
|
|
1851
|
+
executionResult?: {
|
|
1852
|
+
success: boolean;
|
|
1853
|
+
transactionId?: string;
|
|
1854
|
+
error?: string;
|
|
1855
|
+
};
|
|
1856
|
+
}
|
|
1857
|
+
export interface GovernanceConfig {
|
|
1858
|
+
governanceTokenId: string;
|
|
1859
|
+
decimals?: number;
|
|
1860
|
+
votingPowerMethod?: GovernanceVotingPowerMethod;
|
|
1861
|
+
quorumPercent?: number;
|
|
1862
|
+
approvalThresholdPercent?: number;
|
|
1863
|
+
proposalThreshold: string;
|
|
1864
|
+
votingPeriodMs: number;
|
|
1865
|
+
timeLockMs?: number;
|
|
1866
|
+
maxExecutionDelayMs?: number;
|
|
1867
|
+
votingEligibility?: Record<string, unknown>;
|
|
1868
|
+
proposalEligibility?: Record<string, unknown>;
|
|
1869
|
+
allowDelegation?: boolean;
|
|
1870
|
+
allowVoteChange?: boolean;
|
|
1871
|
+
vetoCouncil?: string[];
|
|
1872
|
+
maxActiveProposalsPerAccount?: number;
|
|
1873
|
+
proposalCooldownMs?: number;
|
|
1874
|
+
wisdomWeightFn?: {
|
|
1875
|
+
registryKey: string;
|
|
1876
|
+
};
|
|
1877
|
+
delegation?: {
|
|
1878
|
+
maxHops?: number;
|
|
1879
|
+
decayPerHop?: number;
|
|
1880
|
+
concentrationAlert?: number;
|
|
1881
|
+
};
|
|
1882
|
+
description?: string;
|
|
1883
|
+
}
|
|
1884
|
+
export interface GovernanceValidationContext {
|
|
1885
|
+
chain?: string;
|
|
1886
|
+
network?: "mainnet" | "testnet";
|
|
1887
|
+
callerAccountId: string;
|
|
1888
|
+
timestamp?: string | Date;
|
|
1889
|
+
action: "create_proposal" | "cast_vote" | "execute_proposal" | "cancel_proposal" | "veto" | "delegate";
|
|
1890
|
+
proposal?: GovernanceProposalData;
|
|
1891
|
+
voteType?: GovernanceVoteType;
|
|
1892
|
+
tokenBalance?: string;
|
|
1893
|
+
votingPower?: string;
|
|
1894
|
+
lastProposalAt?: string | Date;
|
|
1895
|
+
activeProposalCount?: number;
|
|
1896
|
+
delegation?: {
|
|
1897
|
+
delegateTo?: string;
|
|
1898
|
+
delegatedPower?: string;
|
|
1899
|
+
};
|
|
1900
|
+
daoId?: string;
|
|
1901
|
+
totalDaoVotingPower?: string;
|
|
1902
|
+
}
|
|
1903
|
+
export interface GovernanceValidationResult {
|
|
1904
|
+
isValid: boolean;
|
|
1905
|
+
reason?: string;
|
|
1906
|
+
metadata?: Record<string, unknown>;
|
|
1907
|
+
validatedAt?: string;
|
|
1908
|
+
}
|
|
1909
|
+
export interface GovernanceSimulateRequest {
|
|
1910
|
+
config: GovernanceConfig;
|
|
1911
|
+
context: GovernanceValidationContext;
|
|
1912
|
+
}
|
|
1913
|
+
export declare class GovernanceClient {
|
|
1914
|
+
private readonly http;
|
|
1915
|
+
constructor(http: HttpClient);
|
|
1916
|
+
simulate(params: GovernanceSimulateRequest): Promise<GovernanceValidationResult>;
|
|
1917
|
+
}
|
|
1918
|
+
export type PersonhoodAttestationMethod = "web-of-trust" | "biometric" | "pop-protocol";
|
|
1919
|
+
export interface PersonhoodProof {
|
|
1920
|
+
attestationMethod: PersonhoodAttestationMethod;
|
|
1921
|
+
payload: unknown;
|
|
1922
|
+
}
|
|
1923
|
+
export interface PersonhoodCert {
|
|
1924
|
+
address: string;
|
|
1925
|
+
issuerId: string;
|
|
1926
|
+
attestationMethod: PersonhoodAttestationMethod;
|
|
1927
|
+
issuedAt: number;
|
|
1928
|
+
expiresAt: number;
|
|
1929
|
+
signature: string;
|
|
1930
|
+
}
|
|
1931
|
+
export interface PersonhoodVerifyParams {
|
|
1932
|
+
candidate: string;
|
|
1933
|
+
proof: PersonhoodProof;
|
|
1934
|
+
}
|
|
1935
|
+
export declare const PERSONHOOD_VERIFIER_NOT_CONFIGURED: "personhood_verifier_not_configured";
|
|
1936
|
+
export declare class PersonhoodClient {
|
|
1937
|
+
private readonly http;
|
|
1938
|
+
constructor(http: HttpClient);
|
|
1939
|
+
verify(params: PersonhoodVerifyParams): Promise<PersonhoodCert | null>;
|
|
1940
|
+
}
|
|
1941
|
+
export declare function isPersonhoodVerifierNotConfigured(err: unknown): err is SdkHttpError & {
|
|
1942
|
+
details: {
|
|
1943
|
+
error: typeof PERSONHOOD_VERIFIER_NOT_CONFIGURED;
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1614
1946
|
export interface SmartEngineClientConfig {
|
|
1615
1947
|
baseUrl: string;
|
|
1616
1948
|
apiKey?: string;
|
|
@@ -1633,6 +1965,28 @@ export interface NetworkConnectionConfig {
|
|
|
1633
1965
|
mirrorNodeUrl?: string;
|
|
1634
1966
|
allowInsecure?: boolean;
|
|
1635
1967
|
}
|
|
1968
|
+
export interface ClusterConnectionConfig {
|
|
1969
|
+
bootstrap: string[];
|
|
1970
|
+
chain: AuthChain;
|
|
1971
|
+
address: string;
|
|
1972
|
+
publicKey: string;
|
|
1973
|
+
signFn: (challenge: string) => string | Promise<string>;
|
|
1974
|
+
metadata?: {
|
|
1975
|
+
appId?: string;
|
|
1976
|
+
appName?: string;
|
|
1977
|
+
};
|
|
1978
|
+
trustAnchor?: {
|
|
1979
|
+
network: "mainnet" | "testnet" | "previewnet";
|
|
1980
|
+
registryTopicId: string;
|
|
1981
|
+
mirrorNodeUrl?: string;
|
|
1982
|
+
};
|
|
1983
|
+
allowInsecure?: boolean;
|
|
1984
|
+
}
|
|
1985
|
+
export interface ClusterConnectionResult {
|
|
1986
|
+
client: SmartEngineClient;
|
|
1987
|
+
cluster: ClusterInfo;
|
|
1988
|
+
session: AuthenticateResponse;
|
|
1989
|
+
}
|
|
1636
1990
|
export interface NetworkConnectionResult {
|
|
1637
1991
|
client: SmartEngineClient;
|
|
1638
1992
|
validator: ValidatorInfo;
|
|
@@ -1648,10 +2002,18 @@ export declare class SmartEngineClient {
|
|
|
1648
2002
|
readonly tss: TSSClient;
|
|
1649
2003
|
readonly ipfs: IPFSClient;
|
|
1650
2004
|
readonly transactions: TransactionsClient;
|
|
2005
|
+
readonly hedera: HederaTransactionsClient;
|
|
2006
|
+
readonly xrpl: XrplTransactionsClient;
|
|
2007
|
+
readonly solana: SolanaTransactionsClient;
|
|
2008
|
+
readonly polkadot: PolkadotTransactionsClient;
|
|
1651
2009
|
readonly snapshots: SnapshotsClient;
|
|
2010
|
+
readonly historicalBalance: HistoricalBalanceClient;
|
|
1652
2011
|
readonly settlement: SettlementClient;
|
|
2012
|
+
readonly governance: GovernanceClient;
|
|
2013
|
+
readonly personhood: PersonhoodClient;
|
|
1653
2014
|
constructor(config: SmartEngineClientConfig);
|
|
1654
2015
|
static connectToNetwork(config: NetworkConnectionConfig): Promise<NetworkConnectionResult>;
|
|
2016
|
+
static connectToCluster(config: ClusterConnectionConfig): Promise<ClusterConnectionResult>;
|
|
1655
2017
|
getBaseUrl(): string;
|
|
1656
2018
|
isAuthenticated(): boolean;
|
|
1657
2019
|
getHttpHealth(): {
|
|
@@ -2096,7 +2458,7 @@ declare function xlmToStroops(xlm: string | number): string;
|
|
|
2096
2458
|
declare function validateBitcoinAddress(address: string): boolean;
|
|
2097
2459
|
declare function satoshisToBtc(satoshis: string | number): string;
|
|
2098
2460
|
declare function btcToSatoshis(btc: string | number): string;
|
|
2099
|
-
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging"
|
|
2461
|
+
export type BaasService = "auth" | "database" | "storage" | "functions" | "messaging";
|
|
2100
2462
|
export type BaasSupportedChain = "hedera" | "xrpl" | "polkadot" | "solana";
|
|
2101
2463
|
export type BaasEndpoints = {
|
|
2102
2464
|
auth: string;
|
|
@@ -2854,7 +3216,7 @@ declare namespace baas {
|
|
|
2854
3216
|
export { AgentBalance, AgentEvent, AgentFundRequest, AgentInfo, AgentOperation, AgentRegisterRequest, AgentRules, AgentRulesValidationResult, AgentStatus, AgentTradeRequest, AgentWithdrawRequest, AgentsClient, AuthenticateOptions, BaasAppListResponse, BaasAuthConfig, BaasAuthResult, BaasChallengeRequest, BaasChallengeResponse, BaasChannelConfig, BaasClient, BaasClientConfig, BaasDeleteResult, BaasDeployRequest, BaasDeployResponse, BaasDocument, BaasEndpoints, BaasError, BaasErrorDetails, BaasErrorResponse, BaasFileInfo, BaasFileMetadata, BaasFindResult, BaasFunctionDeployRequest, BaasFunctionDeployResult, BaasFunctionInfo, BaasFunctionLog, BaasFunctionLogOptions, BaasFunctionResources, BaasFunctionResult, BaasFunctionRuntime, BaasHistoryOptions, BaasInitRequest, BaasInitResponse, BaasInsertResult, BaasMerkleProof, BaasMessage, BaasPresenceInfo, BaasPresenceMember, BaasPublishResult, BaasQueryOptions, BaasRollbackRequest, BaasRuntimeStatus, BaasService, BaasSessionInfo, BaasStateTransition, BaasStorageUsage, BaasSupportedChain, BaasTriggerType, BaasUpdateResult, BaasUploadFrontendResponse, BaasUploadResult, BaasVerifyRequest, ChannelSubscription, DatabaseClient, DatabaseStatsResponse, DbComparisonOperator, DbDocument, DbQuery, DeployedApp, DeployedAppInfo, DeployedAppLimits, DeployedAppStatus, DeployedAppUsage, DeploymentClient, DocumentProofResponse, FunctionsClient, MessageHandler, MessagingClient, StateRootResponse, StateTransitionsResponse, StorageClient, validateAgentRules };
|
|
2855
3217
|
}
|
|
2856
3218
|
declare namespace discovery {
|
|
2857
|
-
export { MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
3219
|
+
export { ClusterDiscoveryClient, ClusterDiscoveryConfig, ClusterEndpointsView, ClusterInfo, MIRROR_NODE_URLS, MirrorNodeClient, MirrorNodeConfig, MirrorNodeError, TopicMessage, TopicMessagesResponse, ValidatorDiscoveryClient, ValidatorDiscoveryConfig, ValidatorInfo, ValidatorMetadata, ValidatorNetworkEndpoints };
|
|
2858
3220
|
}
|
|
2859
3221
|
declare namespace auth {
|
|
2860
3222
|
export { AuthChain, AuthenticateRequest, AuthenticateResponse, ChallengeResponse, SecurityConfig, SessionInfo, ValidatorAuthClient, ValidatorAuthConfig, ValidatorAuthError };
|
|
@@ -2868,6 +3230,12 @@ declare namespace subscription {
|
|
|
2868
3230
|
declare namespace settlement {
|
|
2869
3231
|
export { SettlementAsset, SettlementClient, SettlementHistoryEntry, SettlementInitiateRequest, SettlementPurpose, SettlementStatusResponse };
|
|
2870
3232
|
}
|
|
3233
|
+
declare namespace governance {
|
|
3234
|
+
export { GovernanceClient, GovernanceConfig, GovernanceProposalData, GovernanceProposalStatus, GovernanceSimulateRequest, GovernanceValidationContext, GovernanceValidationResult, GovernanceVoteType, GovernanceVotingPowerMethod };
|
|
3235
|
+
}
|
|
3236
|
+
declare namespace personhood {
|
|
3237
|
+
export { PERSONHOOD_VERIFIER_NOT_CONFIGURED, PersonhoodAttestationMethod, PersonhoodCert, PersonhoodClient, PersonhoodProof, PersonhoodVerifyParams, isPersonhoodVerifierNotConfigured };
|
|
3238
|
+
}
|
|
2871
3239
|
|
|
2872
3240
|
export {
|
|
2873
3241
|
RetryConfig as ResilienceRetryConfig,
|
|
@@ -2876,6 +3244,8 @@ export {
|
|
|
2876
3244
|
baas,
|
|
2877
3245
|
chains,
|
|
2878
3246
|
discovery,
|
|
3247
|
+
governance,
|
|
3248
|
+
personhood,
|
|
2879
3249
|
settlement,
|
|
2880
3250
|
subscription,
|
|
2881
3251
|
};
|