Skip to content

Commit

Permalink
updated types
Browse files Browse the repository at this point in the history
  • Loading branch information
Shiva953 committed Dec 31, 2023
1 parent 6277785 commit 5192e32
Showing 1 changed file with 27 additions and 5 deletions.
32 changes: 27 additions & 5 deletions ts/packages/anchor/src/idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,36 @@ export type IdlPda = {

// Based on the rust type defined in lang/sync/src/idl/types.rs and the definitions in lang/syn/src/idl/pda.rs
export type IdlSeed =
| { kind: 'Const'; value: IdlConstant }
| { kind: 'Arg'; value: IdlSeedArg }
| { kind: 'Account'; value: IdlAccount };
| IdlSeedConst
| IdlSeedArg
| IdlSeedAccount;

export interface IdlSeedArg {
export type IdlSeedConst = {
kind: "const";
type: IdlType;
value: SerdeJsonValue;
};

export type SerdeJsonValue =
| null
| boolean
| number
| string
| SerdeJsonValue[]
| { [key: string]: SerdeJsonValue };

export type IdlSeedArg = {
kind: "arg";
type: IdlType;
path: string;
}
};

export type IdlSeedAccount = {
kind: "account";
type: IdlType;
account?: string; // Adjust the type based on the actual type of account in your use case
path: string;
};

// A nested/recursive version of IdlAccount.
export type IdlAccounts = {
Expand Down

0 comments on commit 5192e32

Please sign in to comment.