Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/invalid param names #122

Merged
merged 7 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-gifts-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@mangrovedao/mgv": patch
---

Fix invalid param names on kandel
29 changes: 18 additions & 11 deletions src/builder/kandel/populate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export const populateABI = parseAbi([
])

export type PopulateFromOffsetParams = {
from?: bigint | undefined
to?: bigint | undefined
fromIndex?: bigint | undefined
toIndex?: bigint | undefined
baseQuoteTickIndex0: bigint
baseQuoteTickOffset: bigint
firstAskIndex: bigint
Expand All @@ -23,8 +23,8 @@ export type PopulateFromOffsetParams = {
quoteAmount?: bigint | undefined
}
export type PopulateChunkFromOffsetParams = {
from?: bigint | undefined
to: bigint
fromIndex?: bigint | undefined
toIndex: bigint
baseQuoteTickIndex0: bigint
firstAskIndex: bigint
bidGives: bigint
Expand All @@ -40,8 +40,8 @@ export function populateFromOffsetParams(params: PopulateFromOffsetParams) {
gasreq,
pricePoints,
stepSize,
from = 0n,
to = pricePoints,
fromIndex = 0n,
toIndex = pricePoints,
baseAmount = 0n,
quoteAmount = 0n,
gasprice = 0n,
Expand All @@ -50,8 +50,8 @@ export function populateFromOffsetParams(params: PopulateFromOffsetParams) {
abi: populateABI,
functionName: 'populateFromOffset',
args: [
from,
to,
fromIndex,
toIndex,
baseQuoteTickIndex0,
baseQuoteTickOffset,
firstAskIndex,
Expand Down Expand Up @@ -84,13 +84,20 @@ export function populateChunkFromOffsetParams(
firstAskIndex,
bidGives,
askGives,
from = 0n,
to,
fromIndex = 0n,
toIndex,
} = params
return {
abi: populateABI,
functionName: 'populateChunkFromOffset',
args: [from, to, baseQuoteTickIndex0, firstAskIndex, bidGives, askGives],
args: [
fromIndex,
toIndex,
baseQuoteTickIndex0,
firstAskIndex,
bidGives,
askGives,
],
} satisfies Omit<
ContractFunctionParameters<
typeof populateABI,
Expand Down