File tree Expand file tree Collapse file tree
ts/packages/anchor/src/program/namespace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ The minor version will be incremented upon a breaking change and the patch versi
3737- ts: Make ` opts ` parameter of ` AnchorProvider ` constructor optional ([ #2843 ] ( https://github.com/coral-xyz/anchor/pull/2843 ) ).
3838- cli: Add ` --no-idl ` flag to the ` build ` command ([ #2847 ] ( https://github.com/coral-xyz/anchor/pull/2847 ) ).
3939- cli: Add priority fees to idl commands ([ #2845 ] ( https://github.com/coral-xyz/anchor/pull/2845 ) ).
40+ - ts: Add ` prepend ` option to MethodBuilder ` preInstructions ` method ([ #2863 ] ( https://github.com/coral-xyz/anchor/pull/2863 ) ).
4041
4142### Fixes
4243
Original file line number Diff line number Diff line change @@ -247,8 +247,12 @@ export class MethodsBuilder<
247247 return this ;
248248 }
249249
250- public preInstructions ( ixs : Array < TransactionInstruction > ) {
251- this . _preInstructions = this . _preInstructions . concat ( ixs ) ;
250+ public preInstructions ( ixs : Array < TransactionInstruction > , prepend = false ) {
251+ if ( prepend ) {
252+ this . _preInstructions = ixs . concat ( this . _preInstructions ) ;
253+ } else {
254+ this . _preInstructions = this . _preInstructions . concat ( ixs ) ;
255+ }
252256 return this ;
253257 }
254258
You can’t perform that action at this time.
0 commit comments