-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
194 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
javascript/solana.js/src/generated/attestation-program/instructions/functionResetEscrow.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import { SwitchboardProgram } from "../../../SwitchboardProgram.js"; | ||
import * as types from "../types/index.js"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
|
||
import * as borsh from "@coral-xyz/borsh"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
import { | ||
AccountMeta, | ||
PublicKey, | ||
TransactionInstruction, | ||
} from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
import { BN } from "@switchboard-xyz/common"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
|
||
export interface FunctionResetEscrowArgs { | ||
params: types.FunctionResetEscrowParamsFields; | ||
} | ||
|
||
export interface FunctionResetEscrowAccounts { | ||
function: PublicKey; | ||
authority: PublicKey; | ||
attestationQueue: PublicKey; | ||
mint: PublicKey; | ||
escrowWallet: PublicKey; | ||
defaultWallet: PublicKey; | ||
tokenWallet: PublicKey; | ||
payer: PublicKey; | ||
state: PublicKey; | ||
tokenProgram: PublicKey; | ||
associatedTokenProgram: PublicKey; | ||
systemProgram: PublicKey; | ||
} | ||
|
||
export const layout = borsh.struct([ | ||
types.FunctionResetEscrowParams.layout("params"), | ||
]); | ||
|
||
export function functionResetEscrow( | ||
program: SwitchboardProgram, | ||
args: FunctionResetEscrowArgs, | ||
accounts: FunctionResetEscrowAccounts | ||
) { | ||
const keys: Array<AccountMeta> = [ | ||
{ pubkey: accounts.function, isSigner: false, isWritable: true }, | ||
{ pubkey: accounts.authority, isSigner: true, isWritable: false }, | ||
{ pubkey: accounts.attestationQueue, isSigner: false, isWritable: false }, | ||
{ pubkey: accounts.mint, isSigner: false, isWritable: false }, | ||
{ pubkey: accounts.escrowWallet, isSigner: false, isWritable: true }, | ||
{ pubkey: accounts.defaultWallet, isSigner: false, isWritable: true }, | ||
{ pubkey: accounts.tokenWallet, isSigner: false, isWritable: true }, | ||
{ pubkey: accounts.payer, isSigner: true, isWritable: true }, | ||
{ pubkey: accounts.state, isSigner: false, isWritable: false }, | ||
{ pubkey: accounts.tokenProgram, isSigner: false, isWritable: false }, | ||
{ | ||
pubkey: accounts.associatedTokenProgram, | ||
isSigner: false, | ||
isWritable: false, | ||
}, | ||
{ pubkey: accounts.systemProgram, isSigner: false, isWritable: false }, | ||
]; | ||
const identifier = Buffer.from([18, 242, 138, 38, 112, 252, 39, 228]); | ||
const buffer = Buffer.alloc(1000); | ||
const len = layout.encode( | ||
{ | ||
params: types.FunctionResetEscrowParams.toEncodable(args.params), | ||
}, | ||
buffer | ||
); | ||
const data = Buffer.concat([identifier, buffer]).slice(0, 8 + len); | ||
const ix = new TransactionInstruction({ | ||
keys, | ||
programId: program.attestationProgramId, | ||
data, | ||
}); | ||
return ix; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
javascript/solana.js/src/generated/attestation-program/types/FunctionResetEscrowParams.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { SwitchboardProgram } from "../../../SwitchboardProgram.js"; | ||
import * as types from "../types/index.js"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
|
||
import * as borsh from "@coral-xyz/borsh"; | ||
import { PublicKey } from "@solana/web3.js"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
import { BN } from "@switchboard-xyz/common"; // eslint-disable-line @typescript-eslint/no-unused-vars | ||
|
||
export interface FunctionResetEscrowParamsFields {} | ||
|
||
export interface FunctionResetEscrowParamsJSON {} | ||
|
||
export class FunctionResetEscrowParams { | ||
constructor(fields: FunctionResetEscrowParamsFields) {} | ||
|
||
static layout(property?: string) { | ||
return borsh.struct([], property); | ||
} | ||
|
||
// eslint-disable-next-line @typescript-eslint/no-explicit-any | ||
static fromDecoded(obj: any) { | ||
return new FunctionResetEscrowParams({}); | ||
} | ||
|
||
static toEncodable(fields: FunctionResetEscrowParamsFields) { | ||
return {}; | ||
} | ||
|
||
toJSON(): FunctionResetEscrowParamsJSON { | ||
return {}; | ||
} | ||
|
||
static fromJSON( | ||
obj: FunctionResetEscrowParamsJSON | ||
): FunctionResetEscrowParams { | ||
return new FunctionResetEscrowParams({}); | ||
} | ||
|
||
toEncodable() { | ||
return FunctionResetEscrowParams.toEncodable(this); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters