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

feat/ix decoder 2 #229

Merged
merged 5 commits into from
Aug 27, 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
4 changes: 3 additions & 1 deletion lib/client/indexer/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,8 @@ export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient {

const proposal = proposals[0];

const rpcProposal =
await this.rpcProposalsClient.autocratClient.getProposal(proposalAcct);
const relatedProtocol = this.protocolMap.get(
proposal.dao.program.program_acct
);
Expand Down Expand Up @@ -473,7 +475,7 @@ export class FutarchyIndexerProposalsClient implements FutarchyProposalsClient {
quoteVault: new PublicKey(proposal.quote_vault ?? 5),
descriptionUrl: proposal.description_url ?? "",
//TODO pass in actual instruction...
instruction: {} as any,
instruction: rpcProposal.instruction,
number: proposal.proposal_num,
openbookFailMarket: new PublicKey(proposal.fail_market_acct ?? 5),
openbookPassMarket: new PublicKey(proposal.pass_market_acct ?? 5),
Expand Down
3 changes: 2 additions & 1 deletion lib/client/rpc/proposals/createProposal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
takerFee,
twapMarketBuffer
} from "@/constants";
import { buildMemoInstruction, buildTransferInstruction } from "@/instructions";
import {
TransactionSender,
createVersionedTransaction
Expand Down Expand Up @@ -54,6 +53,8 @@ import { OpenbookTwapV0_2 } from "@/idl/openbook_twap_v0.2";
import { CreateProposal, FutarchyProposalsClient } from "@/client";
import { ConditionalVault as Conditional_vault_v0_2 } from "@/idl/conditional_vault_v0.2";
import { Observable } from "rxjs";
import { buildMemoInstruction } from "@/instructions/builder/memo";
import { buildTransferInstruction } from "@/instructions/builder/transfer";

export class CreateProposalClient implements CreateProposal {
private proposalsClient: FutarchyProposalsClient;
Expand Down
2 changes: 1 addition & 1 deletion lib/client/rpc/proposals/proposals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ import { CreateProposalClient } from "./createProposal";
import { autocratVersionToConditionalVaultMap } from "@/constants";

export class FutarchyRPCProposalsClient implements FutarchyProposalsClient {
private rpcProvider: AnchorProvider;
public rpcProvider: AnchorProvider;
private futarchyProtocols: FutarchyProtocol[];
public transactionSender: TransactionSender | undefined;
private finalizeProposalClient: FinalizeProposalClient;
Expand Down
16 changes: 16 additions & 0 deletions lib/idl/memo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export const IDL = {
version: '3.0.1',
name: 'spl_memo',
instructions: [
{
name: 'addMemo',
accounts: [],
args: [
{
name: 'memo',
type: 'string',
},
],
},
],
};
Loading
Loading