Skip to content

Commit 27c0d2e

Browse files
committed
Removing collection execute.
1 parent 6f918cd commit 27c0d2e

File tree

11 files changed

+23
-1199
lines changed

11 files changed

+23
-1199
lines changed

clients/js/src/generated/instructions/executeCollectionV1.ts

Lines changed: 0 additions & 179 deletions
This file was deleted.

clients/js/src/generated/instructions/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export * from './createCollectionV2';
2121
export * from './createV1';
2222
export * from './createV2';
2323
export * from './decompressV1';
24-
export * from './executeCollectionV1';
2524
export * from './executeV1';
2625
export * from './removeCollectionExternalPluginAdapterV1';
2726
export * from './removeCollectionPluginV1';

clients/js/src/instructions/execute.ts

Lines changed: 14 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import {
22
Context,
33
Instruction,
4-
PublicKey,
54
publicKey,
65
Signer,
76
TransactionBuilder,
87
} from '@metaplex-foundation/umi';
9-
import {
10-
executeCollectionV1,
11-
executeV1,
12-
findAssetSignerPda,
13-
findCollectionSignerPda,
14-
} from '../generated';
8+
import { executeV1, findAssetSignerPda } from '../generated';
159

1610
export type ExecuteInput = TransactionBuilder | Instruction;
1711

@@ -25,29 +19,14 @@ export type ExecuteArgs = Omit<
2519
signers?: Signer[];
2620
};
2721

28-
export type ExecuteCollectionArgs = Omit<
29-
Parameters<typeof executeCollectionV1>[1],
30-
'programId' | 'instructionData'
31-
> & {
32-
builder?: TransactionBuilder;
33-
instruction?: Instruction;
34-
instructions?: Instruction[];
35-
signers?: Signer[];
36-
};
37-
3822
export const execute = (
3923
context: Pick<Context, 'payer' | 'programs' | 'eddsa' | 'identity'>,
4024
args: ExecuteArgs
4125
) => executeCommon(context, args);
4226

43-
export const executeCollection = (
44-
context: Pick<Context, 'payer' | 'programs' | 'eddsa' | 'identity'>,
45-
args: ExecuteCollectionArgs
46-
) => executeCommon(context, args);
47-
4827
const executeCommon = (
4928
context: Pick<Context, 'payer' | 'programs' | 'eddsa' | 'identity'>,
50-
args: ExecuteArgs | ExecuteCollectionArgs
29+
args: ExecuteArgs
5130
) => {
5231
// Create a new builder to store the translated Execute instructions.
5332
let executeBuilder = new TransactionBuilder();
@@ -86,33 +65,18 @@ const executeCommon = (
8665

8766
// eslint-disable-next-line no-restricted-syntax
8867
for (const ix of builder.items) {
89-
let baseBuilder: TransactionBuilder;
90-
let assetSigner: PublicKey;
91-
if ('asset' in args) {
92-
[assetSigner] = findAssetSignerPda(context, {
93-
asset: publicKey(args.asset),
94-
});
95-
baseBuilder = executeV1(context, {
96-
...args,
97-
assetSigner,
98-
// Forward the programID of the instruction being executed.
99-
programId: ix.instruction.programId,
100-
// Forward the data of the instruction being executed.
101-
instructionData: ix.instruction.data,
102-
});
103-
} else {
104-
[assetSigner] = findCollectionSignerPda(context, {
105-
collection: publicKey(args.collection),
106-
});
107-
baseBuilder = executeCollectionV1(context, {
108-
...args,
109-
collectionSigner: assetSigner,
110-
// Forward the programID of the instruction being executed.
111-
programId: ix.instruction.programId,
112-
// Forward the data of the instruction being executed.
113-
instructionData: ix.instruction.data,
114-
});
115-
}
68+
const [assetSigner] = findAssetSignerPda(context, {
69+
asset: publicKey(args.asset),
70+
});
71+
const baseBuilder = executeV1(context, {
72+
...args,
73+
assetSigner,
74+
// Forward the programID of the instruction being executed.
75+
programId: ix.instruction.programId,
76+
// Forward the data of the instruction being executed.
77+
instructionData: ix.instruction.data,
78+
});
79+
11680
executeBuilder = executeBuilder.add(
11781
baseBuilder
11882
// Add the instruction keys as remaining accounts.

0 commit comments

Comments
 (0)