@avalabs/avalanche-module 0.0.17 → 0.0.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/.turbo/turbo-build.log +10 -12
- package/.turbo/turbo-lint.log +1 -1
- package/.turbo/turbo-test.log +4 -4
- package/CHANGELOG.md +14 -0
- package/dist/index.cjs +13 -6
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/package.json +8 -3
- package/src/handlers/get-balances/convert-p-chain-balance.ts +91 -0
- package/src/handlers/get-balances/covnert-x-chain-balance.ts +74 -0
- package/src/handlers/get-balances/get-balances.ts +100 -0
- package/src/handlers/get-balances/typeguards.ts +9 -0
- package/src/handlers/get-balances/utils.ts +27 -0
- package/src/index.ts +1 -0
- package/src/module.ts +9 -5
- package/src/services/glacier-service/glacier-service.ts +19 -0
- /package/src/handlers/{get-network-fee.test.ts → get-network-fee/get-network-fee.test.ts} +0 -0
- /package/src/handlers/{get-network-fee.ts → get-network-fee/get-network-fee.ts} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
BlockchainId,
|
|
3
3
|
Glacier,
|
|
4
|
+
type ListCChainAtomicBalancesResponse,
|
|
4
5
|
type ListCChainAtomicTransactionsResponse,
|
|
6
|
+
type ListPChainBalancesResponse,
|
|
5
7
|
type ListPChainTransactionsResponse,
|
|
8
|
+
type ListXChainBalancesResponse,
|
|
6
9
|
type ListXChainTransactionsResponse,
|
|
7
10
|
Network,
|
|
8
11
|
PrimaryNetworkTxType,
|
|
@@ -53,4 +56,20 @@ export class AvalancheGlacierService {
|
|
|
53
56
|
throw error;
|
|
54
57
|
}
|
|
55
58
|
}
|
|
59
|
+
|
|
60
|
+
async getChainBalance(params: {
|
|
61
|
+
blockchainId: BlockchainId;
|
|
62
|
+
network: Network;
|
|
63
|
+
blockTimestamp?: number;
|
|
64
|
+
addresses?: string;
|
|
65
|
+
}): Promise<ListPChainBalancesResponse | ListXChainBalancesResponse | ListCChainAtomicBalancesResponse> {
|
|
66
|
+
try {
|
|
67
|
+
return this.glacierSdk.primaryNetworkBalances.getBalancesByAddresses(params);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
if (error instanceof GlacierUnhealthyError) {
|
|
70
|
+
this.setGlacierToUnhealthy();
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
56
75
|
}
|
|
File without changes
|
|
File without changes
|