Skip to content

Commit

Permalink
update client; refine comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyu-li-cb committed Aug 8, 2024
1 parent 891f94d commit ed79518
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 89 deletions.
83 changes: 1 addition & 82 deletions src/client/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,31 +113,6 @@ export interface AddressHistoricalBalanceList {
/**
*
* @export
* @interface AddressHistoricalBalanceList
*/
export interface AddressHistoricalBalanceList {
/**
*
* @type {Array<HistoricalBalance>}
* @memberof AddressHistoricalBalanceList
*/
'data': Array<HistoricalBalance>;
/**
* True if this list has another page of items after this one that can be fetched.
* @type {boolean}
* @memberof AddressHistoricalBalanceList
*/
'has_more': boolean;
/**
* The page token to be used to fetch the next page.
* @type {string}
* @memberof AddressHistoricalBalanceList
*/
'next_page': string;
}
/**
*
* @export
* @interface AddressList
*/
export interface AddressList {
Expand Down Expand Up @@ -832,11 +807,7 @@ export interface HistoricalBalance {
*/
'block_height': string;
/**
<<<<<<< HEAD
*
=======
*
>>>>>>> d0b08ae9e1c2b4c289fcc76952dd02d734648637
* @type {Asset}
* @memberof HistoricalBalance
*/
Expand Down Expand Up @@ -1322,7 +1293,7 @@ export interface StakingReward {
*/
'format': StakingRewardFormat;
/**
*
*
* @type {StakingRewardUSDValue}
* @memberof StakingReward
*/
Expand Down Expand Up @@ -3000,58 +2971,6 @@ export const ExternalAddressesApiAxiosParamCreator = function (configuration?: C



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
* List the historical balance of an asset in a specific address.
* @summary Get address balance history for asset
* @param {string} networkId The ID of the blockchain network
* @param {string} addressId The ID of the address to fetch the historical balance for.
* @param {string} assetId The symbol of the asset to fetch the historical balance for.
* @param {number} [limit] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
* @param {string} [page] A cursor for pagination across multiple pages of results. Don\&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
listAddressHistoricalBalance: async (networkId: string, addressId: string, assetId: string, limit?: number, page?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
// verify required parameter 'networkId' is not null or undefined
assertParamExists('listAddressHistoricalBalance', 'networkId', networkId)
// verify required parameter 'addressId' is not null or undefined
assertParamExists('listAddressHistoricalBalance', 'addressId', addressId)
// verify required parameter 'assetId' is not null or undefined
assertParamExists('listAddressHistoricalBalance', 'assetId', assetId)
const localVarPath = `/v1/networks/{network_id}/addresses/{address_id}/balance_history/{asset_id}`
.replace(`{${"network_id"}}`, encodeURIComponent(String(networkId)))
.replace(`{${"address_id"}}`, encodeURIComponent(String(addressId)))
.replace(`{${"asset_id"}}`, encodeURIComponent(String(assetId)));
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;

if (limit !== undefined) {
localVarQueryParameter['limit'] = limit;
}

if (page !== undefined) {
localVarQueryParameter['page'] = page;
}



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
Expand Down
4 changes: 3 additions & 1 deletion src/coinbase/historical_balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Decimal from "decimal.js";
import { HistoricalBalance as HistoricalBalanceModel } from "../client";
import { Asset } from "./asset";

/** A representation of a balance. */
/** A representation of historical balance. */
export class HistoricalBalance {
public readonly amount: Decimal;
public readonly blockHash: string;
Expand All @@ -15,6 +15,8 @@ export class HistoricalBalance {
* @ignore
* @param {Decimal} amount - The amount of the balance.
* @param {string} assetId - The asset ID.

Check failure on line 17 in src/coinbase/historical_balance.ts

View workflow job for this annotation

GitHub Actions / lint

Expected @param names to be "amount, blockHeight, blockHash, asset". Got "amount, assetId, blockHeight, blockHash"
* @param {Decimal} blockHeight - The block height at which the balance was recorded.
* @param {string} blockHash - The block hash at which the balance was recorded
* @hideconstructor
*/
private constructor(amount: Decimal, blockHeight: Decimal, blockHash: string, asset: Asset) {
Expand Down
13 changes: 7 additions & 6 deletions src/coinbase/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -321,13 +321,14 @@ export type ExternalAddressAPIClient = {

/**
* List the historical balance of an asset in a specific address.
*
* @summary Get address balance history for asset
* @param {string} networkId The ID of the blockchain network
* @param {string} addressId The ID of the address to fetch the historical balance for.
* @param {string} assetId The symbol of the asset to fetch the historical balance for.
* @param {number} [limit] A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
* @param {string} [page] A cursor for pagination across multiple pages of results. Don\&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
* @param {*} [options] Override http request option.
* @param networkId - The ID of the blockchain network
* @param addressId - The ID of the address to fetch the historical balance for.
* @param assetId - The symbol of the asset to fetch the historical balance for.
* @param limit - A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
* @param page - A cursor for pagination across multiple pages of results. Don\&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
* @param options - Override http request option.
* @throws {RequiredError}
*/
listAddressHistoricalBalance(
Expand Down

0 comments on commit ed79518

Please sign in to comment.