-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update token metadata and rename mpl-essentials to mpl-toolbox
- Loading branch information
1 parent
50efd76
commit 5c8900c
Showing
45 changed files
with
239 additions
and
48 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/** | ||
* This code was AUTOGENERATED using the kinobi library. | ||
* Please DO NOT EDIT THIS FILE, instead use visitors | ||
* to add features, then rerun kinobi to update it. | ||
* | ||
* @see https://github.com/metaplex-foundation/kinobi | ||
*/ | ||
|
||
import { | ||
AccountMeta, | ||
Context, | ||
PublicKey, | ||
Serializer, | ||
Signer, | ||
TransactionBuilder, | ||
mapSerializer, | ||
transactionBuilder, | ||
} from '@metaplex-foundation/umi'; | ||
import { addObjectProperty, isWritable } from '../shared'; | ||
|
||
// Accounts. | ||
export type CollectInstructionAccounts = { | ||
/** Authority to collect fees */ | ||
authority?: Signer; | ||
/** PDA to retrieve fees from */ | ||
pdaAccount: PublicKey; | ||
}; | ||
|
||
// Data. | ||
export type CollectInstructionData = { discriminator: number }; | ||
|
||
export type CollectInstructionDataArgs = {}; | ||
|
||
export function getCollectInstructionDataSerializer( | ||
context: Pick<Context, 'serializer'> | ||
): Serializer<CollectInstructionDataArgs, CollectInstructionData> { | ||
const s = context.serializer; | ||
return mapSerializer<CollectInstructionDataArgs, any, CollectInstructionData>( | ||
s.struct<CollectInstructionData>([['discriminator', s.u8()]], { | ||
description: 'CollectInstructionData', | ||
}), | ||
(value) => ({ ...value, discriminator: 54 }) | ||
) as Serializer<CollectInstructionDataArgs, CollectInstructionData>; | ||
} | ||
|
||
// Instruction. | ||
export function collect( | ||
context: Pick<Context, 'serializer' | 'programs' | 'identity'>, | ||
input: CollectInstructionAccounts | ||
): TransactionBuilder { | ||
const signers: Signer[] = []; | ||
const keys: AccountMeta[] = []; | ||
|
||
// Program ID. | ||
const programId = { | ||
...context.programs.getPublicKey( | ||
'mplTokenMetadata', | ||
'metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s' | ||
), | ||
isWritable: false, | ||
}; | ||
|
||
// Resolved inputs. | ||
const resolvingAccounts = {}; | ||
addObjectProperty( | ||
resolvingAccounts, | ||
'authority', | ||
input.authority ?? context.identity | ||
); | ||
const resolvedAccounts = { ...input, ...resolvingAccounts }; | ||
|
||
// Authority. | ||
signers.push(resolvedAccounts.authority); | ||
keys.push({ | ||
pubkey: resolvedAccounts.authority.publicKey, | ||
isSigner: true, | ||
isWritable: isWritable(resolvedAccounts.authority, false), | ||
}); | ||
|
||
// Pda Account. | ||
keys.push({ | ||
pubkey: resolvedAccounts.pdaAccount, | ||
isSigner: false, | ||
isWritable: isWritable(resolvedAccounts.pdaAccount, false), | ||
}); | ||
|
||
// Data. | ||
const data = getCollectInstructionDataSerializer(context).serialize({}); | ||
|
||
// Bytes Created On Chain. | ||
const bytesCreatedOnChain = 0; | ||
|
||
return transactionBuilder([ | ||
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }, | ||
]); | ||
} |
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
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
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
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
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
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
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
Oops, something went wrong.