Anchor-Protocol / Anchor-Protocol/anchor.js

Incorrect return annotation on `queryLiquidationQueueBidPoolsByCollateral`

Open
#64 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
46
Forks
38
PR merge metrics
No merged PRs in 30d

Description

Currently:

```ts
interface Option {
lcd: LCDClient;
collateral_token: string;
start_after: number | undefined;
limit: number | undefined;
}
export interface BidPoolResponse {
sum_snapshot: string;
product_snapshot: string;
total_bid_amount: string;
premium_rate: string;
current_epoch: string;
current_scale: string;
}
export declare const queryLiquidationQueueBidPoolsByCollateral: ({ lcd, collateral_token, start_after, limit }: Option) => (addressProvider: AddressProvider) => Promise;
```

The return type of `queryLiquidationQueueBidPoolsByCollateral` should be:

```ts
export interface BidPoolsByCollateralResponse {
bid_pools: BidPoolResponse[]
}
```

Version:

```
"@anchor-protocol/anchor.js": "^5.0.2"
```

Documentation: https://docs.anchorprotocol.com/smart-contracts/liquidations/liquidation-queue-contract#bidpoolsbycollateralresponse

Example response in documentation:

```
{
"bid_pools": [
{
"sum_snapshot": "1.0",
"product_snapshot": "1.0",
"total_bid_amount": "1000000",
"premium_rate": "0.1",
"current_epoch": "0",
"current_scale": "0"
},
{
"sum_snapshot": "1.0",
"product_snapshot": "1.0",
"total_bid_amount": "2000000",
"premium_rate": "0.2",
"current_epoch": "0",
"current_scale": "0"
}
]
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the TypeScript declaration for queryLiquidationQueueBidPoolsByCollateral and compare its return shape with the BidPoolsByCollateralResponse shown in the issue and the linked liquidation-queue documentation. Update the annotation so it represents the documented bid_pools wrapper, then verify the generated declaration matches the example response.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.