@avalabs/glacier-sdk 2.8.0-alpha.121 → 2.8.0-alpha.123
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 +2244 -2021
- package/dist/index.js +355 -198
- package/esm/generated/Glacier.d.ts +24 -2
- package/esm/generated/Glacier.js +25 -3
- package/esm/generated/core/OpenAPI.js +1 -1
- package/esm/generated/models/CompletedDelegatorDetails.d.ts +15 -0
- package/esm/generated/models/Contract.d.ts +37 -0
- package/esm/generated/models/ContractDeploymentDetails.d.ts +13 -0
- package/esm/generated/models/DelegationStatusType.d.ts +5 -0
- package/esm/generated/models/DelegationStatusType.js +6 -0
- package/esm/generated/models/ListContractsResponse.d.ts +11 -0
- package/esm/generated/models/ListDelegatorDetailsResponse.d.ts +11 -0
- package/esm/generated/models/PrimaryNetwork.d.ts +6 -0
- package/esm/generated/models/PrimaryNetwork.js +7 -0
- package/esm/generated/models/PrimaryNetworkChainInfo.d.ts +5 -2
- package/esm/generated/models/PrimaryNetworkChainName.d.ts +7 -0
- package/esm/generated/models/PrimaryNetworkChainName.js +8 -0
- package/esm/generated/models/StakingDistribution.d.ts +1 -0
- package/esm/generated/models/ValidatorsDetails.d.ts +1 -0
- package/esm/generated/services/DefaultService.d.ts +52 -0
- package/esm/generated/services/DefaultService.js +34 -0
- package/esm/generated/services/EvmBalancesService.d.ts +177 -0
- package/esm/generated/services/EvmBalancesService.js +116 -0
- package/esm/generated/services/EvmBlocksService.d.ts +47 -0
- package/esm/generated/services/EvmBlocksService.js +37 -0
- package/esm/generated/services/EvmChainsService.d.ts +36 -0
- package/esm/generated/services/EvmChainsService.js +29 -0
- package/esm/generated/services/{EvmService.d.ts → EvmTransactionsService.d.ts} +9 -314
- package/esm/generated/services/{EvmService.js → EvmTransactionsService.js} +7 -219
- package/esm/generated/services/NfTsService.d.ts +108 -0
- package/esm/generated/services/NfTsService.js +77 -0
- package/esm/generated/services/PrimaryNetworkBalancesService.d.ts +40 -0
- package/esm/generated/services/PrimaryNetworkBalancesService.js +26 -0
- package/esm/generated/services/PrimaryNetworkBlocksService.d.ts +85 -0
- package/esm/generated/services/PrimaryNetworkBlocksService.js +62 -0
- package/esm/generated/services/PrimaryNetworkRewardsService.d.ts +69 -0
- package/esm/generated/services/PrimaryNetworkRewardsService.js +49 -0
- package/esm/generated/services/PrimaryNetworkService.d.ts +0 -436
- package/esm/generated/services/PrimaryNetworkService.js +0 -298
- package/esm/generated/services/PrimaryNetworkTransactionsService.d.ts +171 -0
- package/esm/generated/services/PrimaryNetworkTransactionsService.js +107 -0
- package/esm/generated/services/PrimaryNetworkUtxOsService.d.ts +54 -0
- package/esm/generated/services/PrimaryNetworkUtxOsService.js +34 -0
- package/esm/generated/services/PrimaryNetworkVerticesService.d.ts +90 -0
- package/esm/generated/services/PrimaryNetworkVerticesService.js +64 -0
- package/esm/index.d.ts +20 -1
- package/esm/index.js +15 -1
- package/package.json +2 -2
|
@@ -1,16 +1,38 @@
|
|
|
1
1
|
import { BaseHttpRequest } from './core/BaseHttpRequest.js';
|
|
2
2
|
import { OpenAPIConfig } from './core/OpenAPI.js';
|
|
3
|
-
import {
|
|
3
|
+
import { DefaultService } from './services/DefaultService.js';
|
|
4
|
+
import { EvmBalancesService } from './services/EvmBalancesService.js';
|
|
5
|
+
import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
6
|
+
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
7
|
+
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
4
8
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
9
|
+
import { NfTsService } from './services/NfTsService.js';
|
|
5
10
|
import { OperationsService } from './services/OperationsService.js';
|
|
6
11
|
import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
|
|
12
|
+
import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
|
|
13
|
+
import { PrimaryNetworkBlocksService } from './services/PrimaryNetworkBlocksService.js';
|
|
14
|
+
import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsService.js';
|
|
15
|
+
import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
|
|
16
|
+
import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
|
|
17
|
+
import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
|
|
7
18
|
|
|
8
19
|
type HttpRequestConstructor = new (config: OpenAPIConfig) => BaseHttpRequest;
|
|
9
20
|
declare class Glacier {
|
|
10
|
-
readonly
|
|
21
|
+
readonly default: DefaultService;
|
|
22
|
+
readonly evmBalances: EvmBalancesService;
|
|
23
|
+
readonly evmBlocks: EvmBlocksService;
|
|
24
|
+
readonly evmChains: EvmChainsService;
|
|
25
|
+
readonly evmTransactions: EvmTransactionsService;
|
|
11
26
|
readonly healthCheck: HealthCheckService;
|
|
27
|
+
readonly nfTs: NfTsService;
|
|
12
28
|
readonly operations: OperationsService;
|
|
13
29
|
readonly primaryNetwork: PrimaryNetworkService;
|
|
30
|
+
readonly primaryNetworkBalances: PrimaryNetworkBalancesService;
|
|
31
|
+
readonly primaryNetworkBlocks: PrimaryNetworkBlocksService;
|
|
32
|
+
readonly primaryNetworkRewards: PrimaryNetworkRewardsService;
|
|
33
|
+
readonly primaryNetworkTransactions: PrimaryNetworkTransactionsService;
|
|
34
|
+
readonly primaryNetworkUtxOs: PrimaryNetworkUtxOsService;
|
|
35
|
+
readonly primaryNetworkVertices: PrimaryNetworkVerticesService;
|
|
14
36
|
readonly request: BaseHttpRequest;
|
|
15
37
|
constructor(config?: Partial<OpenAPIConfig>, HttpRequest?: HttpRequestConstructor);
|
|
16
38
|
}
|
package/esm/generated/Glacier.js
CHANGED
|
@@ -1,14 +1,25 @@
|
|
|
1
1
|
import { FetchHttpRequest } from './core/FetchHttpRequest.js';
|
|
2
|
-
import {
|
|
2
|
+
import { DefaultService } from './services/DefaultService.js';
|
|
3
|
+
import { EvmBalancesService } from './services/EvmBalancesService.js';
|
|
4
|
+
import { EvmBlocksService } from './services/EvmBlocksService.js';
|
|
5
|
+
import { EvmChainsService } from './services/EvmChainsService.js';
|
|
6
|
+
import { EvmTransactionsService } from './services/EvmTransactionsService.js';
|
|
3
7
|
import { HealthCheckService } from './services/HealthCheckService.js';
|
|
8
|
+
import { NfTsService } from './services/NfTsService.js';
|
|
4
9
|
import { OperationsService } from './services/OperationsService.js';
|
|
5
10
|
import { PrimaryNetworkService } from './services/PrimaryNetworkService.js';
|
|
11
|
+
import { PrimaryNetworkBalancesService } from './services/PrimaryNetworkBalancesService.js';
|
|
12
|
+
import { PrimaryNetworkBlocksService } from './services/PrimaryNetworkBlocksService.js';
|
|
13
|
+
import { PrimaryNetworkRewardsService } from './services/PrimaryNetworkRewardsService.js';
|
|
14
|
+
import { PrimaryNetworkTransactionsService } from './services/PrimaryNetworkTransactionsService.js';
|
|
15
|
+
import { PrimaryNetworkUtxOsService } from './services/PrimaryNetworkUtxOsService.js';
|
|
16
|
+
import { PrimaryNetworkVerticesService } from './services/PrimaryNetworkVerticesService.js';
|
|
6
17
|
|
|
7
18
|
class Glacier {
|
|
8
19
|
constructor(config, HttpRequest = FetchHttpRequest) {
|
|
9
20
|
var _a, _b, _c, _d;
|
|
10
21
|
this.request = new HttpRequest({
|
|
11
|
-
BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "",
|
|
22
|
+
BASE: (_a = config == null ? void 0 : config.BASE) != null ? _a : "https://glacier-api.avax.network",
|
|
12
23
|
VERSION: (_b = config == null ? void 0 : config.VERSION) != null ? _b : "Beta",
|
|
13
24
|
WITH_CREDENTIALS: (_c = config == null ? void 0 : config.WITH_CREDENTIALS) != null ? _c : false,
|
|
14
25
|
CREDENTIALS: (_d = config == null ? void 0 : config.CREDENTIALS) != null ? _d : "include",
|
|
@@ -18,10 +29,21 @@ class Glacier {
|
|
|
18
29
|
HEADERS: config == null ? void 0 : config.HEADERS,
|
|
19
30
|
ENCODE_PATH: config == null ? void 0 : config.ENCODE_PATH
|
|
20
31
|
});
|
|
21
|
-
this.
|
|
32
|
+
this.default = new DefaultService(this.request);
|
|
33
|
+
this.evmBalances = new EvmBalancesService(this.request);
|
|
34
|
+
this.evmBlocks = new EvmBlocksService(this.request);
|
|
35
|
+
this.evmChains = new EvmChainsService(this.request);
|
|
36
|
+
this.evmTransactions = new EvmTransactionsService(this.request);
|
|
22
37
|
this.healthCheck = new HealthCheckService(this.request);
|
|
38
|
+
this.nfTs = new NfTsService(this.request);
|
|
23
39
|
this.operations = new OperationsService(this.request);
|
|
24
40
|
this.primaryNetwork = new PrimaryNetworkService(this.request);
|
|
41
|
+
this.primaryNetworkBalances = new PrimaryNetworkBalancesService(this.request);
|
|
42
|
+
this.primaryNetworkBlocks = new PrimaryNetworkBlocksService(this.request);
|
|
43
|
+
this.primaryNetworkRewards = new PrimaryNetworkRewardsService(this.request);
|
|
44
|
+
this.primaryNetworkTransactions = new PrimaryNetworkTransactionsService(this.request);
|
|
45
|
+
this.primaryNetworkUtxOs = new PrimaryNetworkUtxOsService(this.request);
|
|
46
|
+
this.primaryNetworkVertices = new PrimaryNetworkVerticesService(this.request);
|
|
25
47
|
}
|
|
26
48
|
}
|
|
27
49
|
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DelegationStatusType } from './DelegationStatusType.js';
|
|
2
|
+
|
|
3
|
+
type CompletedDelegatorDetails = {
|
|
4
|
+
txHash: string;
|
|
5
|
+
rewardAddresses: Array<string>;
|
|
6
|
+
amountDelegated: string;
|
|
7
|
+
delegationFee: string;
|
|
8
|
+
startTimestamp: number;
|
|
9
|
+
endTimestamp: number;
|
|
10
|
+
delegationStatus: DelegationStatusType;
|
|
11
|
+
grossReward: string;
|
|
12
|
+
netReward: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export { CompletedDelegatorDetails };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ContractDeploymentDetails } from './ContractDeploymentDetails.js';
|
|
2
|
+
import { ErcType } from './ErcType.js';
|
|
3
|
+
import { ResourceLink } from './ResourceLink.js';
|
|
4
|
+
|
|
5
|
+
type Contract = {
|
|
6
|
+
/**
|
|
7
|
+
* The contract name.
|
|
8
|
+
*/
|
|
9
|
+
name?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The contract symbol.
|
|
12
|
+
*/
|
|
13
|
+
symbol?: string;
|
|
14
|
+
/**
|
|
15
|
+
* The number of decimals the token uses. For example `6`, means to divide the token amount by `1000000` to get its user representation.
|
|
16
|
+
*/
|
|
17
|
+
decimals?: number;
|
|
18
|
+
/**
|
|
19
|
+
* The logo uri for the address.
|
|
20
|
+
*/
|
|
21
|
+
logoUri?: string;
|
|
22
|
+
/**
|
|
23
|
+
* A wallet or contract address in mixed-case checksum encoding.
|
|
24
|
+
*/
|
|
25
|
+
address: string;
|
|
26
|
+
deploymentDetails: ContractDeploymentDetails;
|
|
27
|
+
description?: string;
|
|
28
|
+
ercType?: ErcType;
|
|
29
|
+
officialSite?: string;
|
|
30
|
+
tags?: Array<string>;
|
|
31
|
+
email?: string;
|
|
32
|
+
bannerUri?: string;
|
|
33
|
+
color?: string;
|
|
34
|
+
resourceLinks?: Array<ResourceLink>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { Contract };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
type ContractDeploymentDetails = {
|
|
2
|
+
txHash: string;
|
|
3
|
+
/**
|
|
4
|
+
* The address that initiated the transaction which deployed this contract.
|
|
5
|
+
*/
|
|
6
|
+
deployerAddress: string;
|
|
7
|
+
/**
|
|
8
|
+
* The contract address which deployed this contract via smart contract. This field is only populated when the contract was deployed as part of smart contract execution.
|
|
9
|
+
*/
|
|
10
|
+
deployerContractAddress?: string;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { ContractDeploymentDetails };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Contract } from './Contract.js';
|
|
2
|
+
|
|
3
|
+
type ListContractsResponse = {
|
|
4
|
+
/**
|
|
5
|
+
* A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
|
|
6
|
+
*/
|
|
7
|
+
nextPageToken?: string;
|
|
8
|
+
contracts: Array<Contract>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ListContractsResponse };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CompletedDelegatorDetails } from './CompletedDelegatorDetails.js';
|
|
2
|
+
|
|
3
|
+
type ListDelegatorDetailsResponse = {
|
|
4
|
+
/**
|
|
5
|
+
* A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted or empty, there are no subsequent pages.
|
|
6
|
+
*/
|
|
7
|
+
nextPageToken?: string;
|
|
8
|
+
delegators: Array<CompletedDelegatorDetails>;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export { ListDelegatorDetailsResponse };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { PrimaryNetwork } from './PrimaryNetwork.js';
|
|
2
|
+
import { PrimaryNetworkChainName } from './PrimaryNetworkChainName.js';
|
|
3
|
+
|
|
1
4
|
type PrimaryNetworkChainInfo = {
|
|
2
|
-
chainName:
|
|
3
|
-
network:
|
|
5
|
+
chainName: PrimaryNetworkChainName;
|
|
6
|
+
network: PrimaryNetwork;
|
|
4
7
|
};
|
|
5
8
|
|
|
6
9
|
export { PrimaryNetworkChainInfo };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
var PrimaryNetworkChainName = /* @__PURE__ */ ((PrimaryNetworkChainName2) => {
|
|
2
|
+
PrimaryNetworkChainName2["P_CHAIN"] = "p-chain";
|
|
3
|
+
PrimaryNetworkChainName2["X_CHAIN"] = "x-chain";
|
|
4
|
+
PrimaryNetworkChainName2["C_CHAIN"] = "c-chain";
|
|
5
|
+
return PrimaryNetworkChainName2;
|
|
6
|
+
})(PrimaryNetworkChainName || {});
|
|
7
|
+
|
|
8
|
+
export { PrimaryNetworkChainName };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ListDelegatorDetailsResponse } from '../models/ListDelegatorDetailsResponse.js';
|
|
2
|
+
import { Network } from '../models/Network.js';
|
|
3
|
+
import { SortOrder } from '../models/SortOrder.js';
|
|
4
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
5
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
6
|
+
|
|
7
|
+
declare class DefaultService {
|
|
8
|
+
readonly httpRequest: BaseHttpRequest;
|
|
9
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
10
|
+
/**
|
|
11
|
+
* List delegators
|
|
12
|
+
* Lists details for delegators.
|
|
13
|
+
* @returns ListDelegatorDetailsResponse
|
|
14
|
+
* @throws ApiError
|
|
15
|
+
*/
|
|
16
|
+
listDelegators({ network, nodeId, delegationStatus, pageSize, pageToken, sortOrder, rewardAddresses, nodeIds, }: {
|
|
17
|
+
/**
|
|
18
|
+
* Either mainnet or a testnet.
|
|
19
|
+
*/
|
|
20
|
+
network: Network;
|
|
21
|
+
/**
|
|
22
|
+
* A primary network (P or X chain) nodeId.
|
|
23
|
+
*/
|
|
24
|
+
nodeId: string;
|
|
25
|
+
/**
|
|
26
|
+
* Delegation status of the node.
|
|
27
|
+
*/
|
|
28
|
+
delegationStatus: 'completed' | 'active' | 'pending';
|
|
29
|
+
/**
|
|
30
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
31
|
+
*/
|
|
32
|
+
pageSize?: number;
|
|
33
|
+
/**
|
|
34
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
35
|
+
*/
|
|
36
|
+
pageToken?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The order by which to sort results. Use "asc" for ascending order, "desc" for descending order. Sorted by timestamp or the `sortBy` query parameter, if provided.
|
|
39
|
+
*/
|
|
40
|
+
sortOrder?: SortOrder;
|
|
41
|
+
/**
|
|
42
|
+
* A comma separated list of reward addresses to filter by.
|
|
43
|
+
*/
|
|
44
|
+
rewardAddresses?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A comma separated list of node ids to filter by.
|
|
47
|
+
*/
|
|
48
|
+
nodeIds?: string;
|
|
49
|
+
}): CancelablePromise<ListDelegatorDetailsResponse>;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export { DefaultService };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
class DefaultService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
listDelegators({
|
|
6
|
+
network,
|
|
7
|
+
nodeId,
|
|
8
|
+
delegationStatus,
|
|
9
|
+
pageSize = 10,
|
|
10
|
+
pageToken,
|
|
11
|
+
sortOrder,
|
|
12
|
+
rewardAddresses,
|
|
13
|
+
nodeIds
|
|
14
|
+
}) {
|
|
15
|
+
return this.httpRequest.request({
|
|
16
|
+
method: "GET",
|
|
17
|
+
url: "/v1/networks/{network}/delegators",
|
|
18
|
+
path: {
|
|
19
|
+
"network": network,
|
|
20
|
+
"nodeId": nodeId,
|
|
21
|
+
"delegationStatus": delegationStatus
|
|
22
|
+
},
|
|
23
|
+
query: {
|
|
24
|
+
"pageSize": pageSize,
|
|
25
|
+
"pageToken": pageToken,
|
|
26
|
+
"sortOrder": sortOrder,
|
|
27
|
+
"rewardAddresses": rewardAddresses,
|
|
28
|
+
"nodeIds": nodeIds
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { DefaultService };
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { CurrencyCode } from '../models/CurrencyCode.js';
|
|
2
|
+
import { GetNativeBalanceResponse } from '../models/GetNativeBalanceResponse.js';
|
|
3
|
+
import { ListCollectibleBalancesResponse } from '../models/ListCollectibleBalancesResponse.js';
|
|
4
|
+
import { ListErc1155BalancesResponse } from '../models/ListErc1155BalancesResponse.js';
|
|
5
|
+
import { ListErc20BalancesResponse } from '../models/ListErc20BalancesResponse.js';
|
|
6
|
+
import { ListErc721BalancesResponse } from '../models/ListErc721BalancesResponse.js';
|
|
7
|
+
import { CancelablePromise } from '../core/CancelablePromise.js';
|
|
8
|
+
import { BaseHttpRequest } from '../core/BaseHttpRequest.js';
|
|
9
|
+
|
|
10
|
+
declare class EvmBalancesService {
|
|
11
|
+
readonly httpRequest: BaseHttpRequest;
|
|
12
|
+
constructor(httpRequest: BaseHttpRequest);
|
|
13
|
+
/**
|
|
14
|
+
* Get native token balance
|
|
15
|
+
* Gets native token balance of a wallet address.
|
|
16
|
+
*
|
|
17
|
+
* Balance at a given block can be retrieved with the `blockNumber` parameter.
|
|
18
|
+
* @returns GetNativeBalanceResponse
|
|
19
|
+
* @throws ApiError
|
|
20
|
+
*/
|
|
21
|
+
getNativeBalance({ chainId, address, blockNumber, currency, }: {
|
|
22
|
+
/**
|
|
23
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
24
|
+
*/
|
|
25
|
+
chainId: string;
|
|
26
|
+
/**
|
|
27
|
+
* A wallet address.
|
|
28
|
+
*/
|
|
29
|
+
address: string;
|
|
30
|
+
/**
|
|
31
|
+
* The block number, if not defined the block number will be the latest block.
|
|
32
|
+
*/
|
|
33
|
+
blockNumber?: string;
|
|
34
|
+
/**
|
|
35
|
+
* The currency that return values should use. Defaults to USD.
|
|
36
|
+
*/
|
|
37
|
+
currency?: CurrencyCode;
|
|
38
|
+
}): CancelablePromise<GetNativeBalanceResponse>;
|
|
39
|
+
/**
|
|
40
|
+
* List ERC-20 balances
|
|
41
|
+
* Lists ERC-20 token balances of a wallet address.
|
|
42
|
+
*
|
|
43
|
+
* Balance at a given block can be retrieved with the `blockNumber` parameter.
|
|
44
|
+
*
|
|
45
|
+
* Balance for specific contracts can be retrieved with the `contractAddresses` parameter.
|
|
46
|
+
* @returns ListErc20BalancesResponse
|
|
47
|
+
* @throws ApiError
|
|
48
|
+
*/
|
|
49
|
+
listErc20Balances({ chainId, address, blockNumber, pageSize, pageToken, contractAddresses, currency, }: {
|
|
50
|
+
/**
|
|
51
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
52
|
+
*/
|
|
53
|
+
chainId: string;
|
|
54
|
+
/**
|
|
55
|
+
* A wallet address.
|
|
56
|
+
*/
|
|
57
|
+
address: string;
|
|
58
|
+
/**
|
|
59
|
+
* The block number, if not defined the block number will be the latest block.
|
|
60
|
+
*/
|
|
61
|
+
blockNumber?: string;
|
|
62
|
+
/**
|
|
63
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
64
|
+
*/
|
|
65
|
+
pageSize?: number;
|
|
66
|
+
/**
|
|
67
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
68
|
+
*/
|
|
69
|
+
pageToken?: string;
|
|
70
|
+
/**
|
|
71
|
+
* A comma separated list of contract addresses to filter by.
|
|
72
|
+
*/
|
|
73
|
+
contractAddresses?: string;
|
|
74
|
+
/**
|
|
75
|
+
* The currency that return values should use. Defaults to USD.
|
|
76
|
+
*/
|
|
77
|
+
currency?: CurrencyCode;
|
|
78
|
+
}): CancelablePromise<ListErc20BalancesResponse>;
|
|
79
|
+
/**
|
|
80
|
+
* List ERC-721 balances
|
|
81
|
+
* Lists ERC-721 token balances of a wallet address.
|
|
82
|
+
*
|
|
83
|
+
* Balance for a specific contract can be retrieved with the `contractAddress` parameter.
|
|
84
|
+
* @returns ListErc721BalancesResponse
|
|
85
|
+
* @throws ApiError
|
|
86
|
+
*/
|
|
87
|
+
listErc721Balances({ chainId, address, pageSize, pageToken, contractAddress, }: {
|
|
88
|
+
/**
|
|
89
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
90
|
+
*/
|
|
91
|
+
chainId: string;
|
|
92
|
+
/**
|
|
93
|
+
* A wallet address.
|
|
94
|
+
*/
|
|
95
|
+
address: string;
|
|
96
|
+
/**
|
|
97
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
98
|
+
*/
|
|
99
|
+
pageSize?: number;
|
|
100
|
+
/**
|
|
101
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
102
|
+
*/
|
|
103
|
+
pageToken?: string;
|
|
104
|
+
/**
|
|
105
|
+
* A contract addresses to filter by.
|
|
106
|
+
*/
|
|
107
|
+
contractAddress?: string;
|
|
108
|
+
}): CancelablePromise<ListErc721BalancesResponse>;
|
|
109
|
+
/**
|
|
110
|
+
* List ERC-1155 balances
|
|
111
|
+
* Lists ERC-1155 token balances of a wallet address.
|
|
112
|
+
*
|
|
113
|
+
* Balance at a given block can be retrieved with the `blockNumber` parameter.
|
|
114
|
+
*
|
|
115
|
+
* Balance for a specific contract can be retrieved with the `contractAddress` parameter.
|
|
116
|
+
* @returns ListErc1155BalancesResponse
|
|
117
|
+
* @throws ApiError
|
|
118
|
+
*/
|
|
119
|
+
listErc1155Balances({ chainId, address, blockNumber, pageSize, pageToken, contractAddress, }: {
|
|
120
|
+
/**
|
|
121
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
122
|
+
*/
|
|
123
|
+
chainId: string;
|
|
124
|
+
/**
|
|
125
|
+
* A wallet address.
|
|
126
|
+
*/
|
|
127
|
+
address: string;
|
|
128
|
+
/**
|
|
129
|
+
* The block number, if not defined the block number will be the latest block.
|
|
130
|
+
*/
|
|
131
|
+
blockNumber?: string;
|
|
132
|
+
/**
|
|
133
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
134
|
+
*/
|
|
135
|
+
pageSize?: number;
|
|
136
|
+
/**
|
|
137
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
138
|
+
*/
|
|
139
|
+
pageToken?: string;
|
|
140
|
+
/**
|
|
141
|
+
* A contract addresses to filter by.
|
|
142
|
+
*/
|
|
143
|
+
contractAddress?: string;
|
|
144
|
+
}): CancelablePromise<ListErc1155BalancesResponse>;
|
|
145
|
+
/**
|
|
146
|
+
* List collectible (ERC-721/ERC-1155) balances
|
|
147
|
+
* Lists ERC-721 and ERC-1155 token balances of a wallet address.
|
|
148
|
+
*
|
|
149
|
+
* Balance for a specific contract can be retrieved with the `contractAddress` parameter.
|
|
150
|
+
* @returns ListCollectibleBalancesResponse
|
|
151
|
+
* @throws ApiError
|
|
152
|
+
*/
|
|
153
|
+
listCollectibleBalances({ chainId, address, pageSize, pageToken, contractAddress, }: {
|
|
154
|
+
/**
|
|
155
|
+
* A supported evm chain id. Use the `/chains` endpoint to get a list of supported chain ids.
|
|
156
|
+
*/
|
|
157
|
+
chainId: string;
|
|
158
|
+
/**
|
|
159
|
+
* A wallet address.
|
|
160
|
+
*/
|
|
161
|
+
address: string;
|
|
162
|
+
/**
|
|
163
|
+
* The maximum number of items to return. The minimum page size is 1. The maximum pageSize is 100.
|
|
164
|
+
*/
|
|
165
|
+
pageSize?: number;
|
|
166
|
+
/**
|
|
167
|
+
* A page token, received from a previous list call. Provide this to retrieve the subsequent page.
|
|
168
|
+
*/
|
|
169
|
+
pageToken?: string;
|
|
170
|
+
/**
|
|
171
|
+
* A contract addresses to filter by.
|
|
172
|
+
*/
|
|
173
|
+
contractAddress?: string;
|
|
174
|
+
}): CancelablePromise<ListCollectibleBalancesResponse>;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export { EvmBalancesService };
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
class EvmBalancesService {
|
|
2
|
+
constructor(httpRequest) {
|
|
3
|
+
this.httpRequest = httpRequest;
|
|
4
|
+
}
|
|
5
|
+
getNativeBalance({
|
|
6
|
+
chainId,
|
|
7
|
+
address,
|
|
8
|
+
blockNumber,
|
|
9
|
+
currency
|
|
10
|
+
}) {
|
|
11
|
+
return this.httpRequest.request({
|
|
12
|
+
method: "GET",
|
|
13
|
+
url: "/v1/chains/{chainId}/addresses/{address}/balances:getNative",
|
|
14
|
+
path: {
|
|
15
|
+
"chainId": chainId,
|
|
16
|
+
"address": address
|
|
17
|
+
},
|
|
18
|
+
query: {
|
|
19
|
+
"blockNumber": blockNumber,
|
|
20
|
+
"currency": currency
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
listErc20Balances({
|
|
25
|
+
chainId,
|
|
26
|
+
address,
|
|
27
|
+
blockNumber,
|
|
28
|
+
pageSize = 10,
|
|
29
|
+
pageToken,
|
|
30
|
+
contractAddresses,
|
|
31
|
+
currency
|
|
32
|
+
}) {
|
|
33
|
+
return this.httpRequest.request({
|
|
34
|
+
method: "GET",
|
|
35
|
+
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc20",
|
|
36
|
+
path: {
|
|
37
|
+
"chainId": chainId,
|
|
38
|
+
"address": address
|
|
39
|
+
},
|
|
40
|
+
query: {
|
|
41
|
+
"blockNumber": blockNumber,
|
|
42
|
+
"pageSize": pageSize,
|
|
43
|
+
"pageToken": pageToken,
|
|
44
|
+
"contractAddresses": contractAddresses,
|
|
45
|
+
"currency": currency
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
listErc721Balances({
|
|
50
|
+
chainId,
|
|
51
|
+
address,
|
|
52
|
+
pageSize = 10,
|
|
53
|
+
pageToken,
|
|
54
|
+
contractAddress
|
|
55
|
+
}) {
|
|
56
|
+
return this.httpRequest.request({
|
|
57
|
+
method: "GET",
|
|
58
|
+
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc721",
|
|
59
|
+
path: {
|
|
60
|
+
"chainId": chainId,
|
|
61
|
+
"address": address
|
|
62
|
+
},
|
|
63
|
+
query: {
|
|
64
|
+
"pageSize": pageSize,
|
|
65
|
+
"pageToken": pageToken,
|
|
66
|
+
"contractAddress": contractAddress
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
listErc1155Balances({
|
|
71
|
+
chainId,
|
|
72
|
+
address,
|
|
73
|
+
blockNumber,
|
|
74
|
+
pageSize = 10,
|
|
75
|
+
pageToken,
|
|
76
|
+
contractAddress
|
|
77
|
+
}) {
|
|
78
|
+
return this.httpRequest.request({
|
|
79
|
+
method: "GET",
|
|
80
|
+
url: "/v1/chains/{chainId}/addresses/{address}/balances:listErc1155",
|
|
81
|
+
path: {
|
|
82
|
+
"chainId": chainId,
|
|
83
|
+
"address": address
|
|
84
|
+
},
|
|
85
|
+
query: {
|
|
86
|
+
"blockNumber": blockNumber,
|
|
87
|
+
"pageSize": pageSize,
|
|
88
|
+
"pageToken": pageToken,
|
|
89
|
+
"contractAddress": contractAddress
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
listCollectibleBalances({
|
|
94
|
+
chainId,
|
|
95
|
+
address,
|
|
96
|
+
pageSize = 10,
|
|
97
|
+
pageToken,
|
|
98
|
+
contractAddress
|
|
99
|
+
}) {
|
|
100
|
+
return this.httpRequest.request({
|
|
101
|
+
method: "GET",
|
|
102
|
+
url: "/v1/chains/{chainId}/addresses/{address}/balances:listCollectibles",
|
|
103
|
+
path: {
|
|
104
|
+
"chainId": chainId,
|
|
105
|
+
"address": address
|
|
106
|
+
},
|
|
107
|
+
query: {
|
|
108
|
+
"pageSize": pageSize,
|
|
109
|
+
"pageToken": pageToken,
|
|
110
|
+
"contractAddress": contractAddress
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export { EvmBalancesService };
|