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/withdraw all versions #124

Merged
merged 3 commits into from
May 24, 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: 3 additions & 2 deletions lib/client/rpc/proposals/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export class FutarchyRPCProposalsClient implements FutarchyProposalsClient {
) {
if (programVersion == "V0.3" || programVersion == "V0.2") {
const vaultForVersion = autocratVersionToConditionalVaultMap[proposal.protocol.deploymentVersion]
const vaultProgram = new Program(vaultForVersion.idl, vaultForVersion.programId)
const vaultProgram = new Program(vaultForVersion.idl, vaultForVersion.programId, this.rpcProvider)

const vaultAccount =
underlyingToken == "base"
Expand Down Expand Up @@ -296,7 +296,7 @@ export class FutarchyRPCProposalsClient implements FutarchyProposalsClient {

public async withdraw(proposal: Proposal) {
const vaultForVersion = autocratVersionToConditionalVaultMap[proposal.protocol.deploymentVersion]
const vaultProgram = new Program(vaultForVersion.idl, vaultForVersion.programId)
const vaultProgram = new Program(vaultForVersion.idl, vaultForVersion.programId, this.rpcProvider)

const baseAccounts = await this.getVaultAccounts(
proposal.baseVaultAccount,
Expand All @@ -317,6 +317,7 @@ export class FutarchyRPCProposalsClient implements FutarchyProposalsClient {
})
.transaction()
).instructions;

const redeeemQuoteIx = (
await vaultProgram.methods
.redeemConditionalTokensForUnderlyingTokens()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@metadaoproject/futarchy-sdk",
"version": "2.0.0-alpha.17",
"version": "2.0.0-alpha.18",
"main": "dist",
"scripts": {
"preinstall": "npx only-allow pnpm",
Expand Down
Loading