diff --git a/clients/js/src/generated/instructions/createV1.ts b/clients/js/src/generated/instructions/createV1.ts index 5af988e8..1c9846e8 100644 --- a/clients/js/src/generated/instructions/createV1.ts +++ b/clients/js/src/generated/instructions/createV1.ts @@ -121,13 +121,13 @@ export type CreateV1InstructionDataArgs = { creators: OptionOrNullable>; primarySaleHappened?: boolean; isMutable?: boolean; - tokenStandard: TokenStandardArgs; + tokenStandard?: TokenStandardArgs; collection?: OptionOrNullable; uses?: OptionOrNullable; - collectionDetails?: OptionOrNullable; + collectionDetails: OptionOrNullable; ruleSet?: OptionOrNullable; - decimals?: OptionOrNullable; - printSupply?: OptionOrNullable; + decimals: OptionOrNullable; + printSupply: OptionOrNullable; }; export function getCreateV1InstructionDataSerializer(): Serializer< @@ -167,28 +167,26 @@ export function getCreateV1InstructionDataSerializer(): Serializer< symbol: value.symbol ?? '', primarySaleHappened: value.primarySaleHappened ?? false, isMutable: value.isMutable ?? true, + tokenStandard: value.tokenStandard ?? TokenStandard.NonFungible, collection: value.collection ?? none(), uses: value.uses ?? none(), - collectionDetails: value.collectionDetails ?? none(), ruleSet: value.ruleSet ?? none(), - decimals: value.decimals ?? none(), - printSupply: value.printSupply ?? none(), }) ) as Serializer; } // Extra Args. -export type CreateV1InstructionExtraArgs = { isCollection: boolean }; +export type CreateV1InstructionExtraArgs = { isCollection?: boolean }; // Args. export type CreateV1InstructionArgs = PickPartial< CreateV1InstructionDataArgs & CreateV1InstructionExtraArgs, | 'tokenStandard' + | 'creators' | 'isCollection' | 'collectionDetails' | 'decimals' | 'printSupply' - | 'creators' >; // Instruction. @@ -314,6 +312,15 @@ export function createV1( resolvedAccounts.splTokenProgram.isWritable = false; } } + if (!resolvedArgs.creators) { + resolvedArgs.creators = resolveCreators( + context, + resolvedAccounts, + resolvedArgs, + programId, + false + ); + } if (!resolvedArgs.isCollection) { resolvedArgs.isCollection = false; } @@ -344,15 +351,6 @@ export function createV1( false ); } - if (!resolvedArgs.creators) { - resolvedArgs.creators = resolveCreators( - context, - resolvedAccounts, - resolvedArgs, - programId, - false - ); - } // Accounts in order. const orderedAccounts: ResolvedAccount[] = Object.values( diff --git a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts index 39347736..98bc3c7c 100644 --- a/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/delegateAuthorityItemV1.ts @@ -230,9 +230,9 @@ export function delegateAuthorityItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.AuthorityItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts index aa63877b..42903ce9 100644 --- a/clients/js/src/generated/instructions/delegateCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionItemV1.ts @@ -230,9 +230,9 @@ export function delegateCollectionItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.CollectionItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateCollectionV1.ts b/clients/js/src/generated/instructions/delegateCollectionV1.ts index f935074f..c9201710 100644 --- a/clients/js/src/generated/instructions/delegateCollectionV1.ts +++ b/clients/js/src/generated/instructions/delegateCollectionV1.ts @@ -230,9 +230,9 @@ export function delegateCollectionV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.Collection, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateDataItemV1.ts b/clients/js/src/generated/instructions/delegateDataItemV1.ts index 4e782de8..96ab1632 100644 --- a/clients/js/src/generated/instructions/delegateDataItemV1.ts +++ b/clients/js/src/generated/instructions/delegateDataItemV1.ts @@ -230,9 +230,9 @@ export function delegateDataItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.DataItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateDataV1.ts b/clients/js/src/generated/instructions/delegateDataV1.ts index 87c3013c..2488b57d 100644 --- a/clients/js/src/generated/instructions/delegateDataV1.ts +++ b/clients/js/src/generated/instructions/delegateDataV1.ts @@ -228,9 +228,9 @@ export function delegateDataV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.Data, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts index 13bc6f1f..dbb9fa19 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigItemV1.ts @@ -232,9 +232,9 @@ export function delegateProgrammableConfigItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.ProgrammableConfigItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts index f155da59..8aaba43d 100644 --- a/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/delegateProgrammableConfigV1.ts @@ -232,9 +232,9 @@ export function delegateProgrammableConfigV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.ProgrammableConfig, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts index df272979..b79be12a 100644 --- a/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts +++ b/clients/js/src/generated/instructions/revokeAuthorityItemV1.ts @@ -214,9 +214,9 @@ export function revokeAuthorityItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.AuthorityItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts index 1b7c9ccf..3f06d230 100644 --- a/clients/js/src/generated/instructions/revokeCollectionItemV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionItemV1.ts @@ -214,9 +214,9 @@ export function revokeCollectionItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.CollectionItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeCollectionV1.ts b/clients/js/src/generated/instructions/revokeCollectionV1.ts index 7906fedc..a09d6f3b 100644 --- a/clients/js/src/generated/instructions/revokeCollectionV1.ts +++ b/clients/js/src/generated/instructions/revokeCollectionV1.ts @@ -214,9 +214,9 @@ export function revokeCollectionV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.Collection, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeDataItemV1.ts b/clients/js/src/generated/instructions/revokeDataItemV1.ts index 77353bb3..a655cd3a 100644 --- a/clients/js/src/generated/instructions/revokeDataItemV1.ts +++ b/clients/js/src/generated/instructions/revokeDataItemV1.ts @@ -213,9 +213,9 @@ export function revokeDataItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.DataItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeDataV1.ts b/clients/js/src/generated/instructions/revokeDataV1.ts index 7db13674..980272b7 100644 --- a/clients/js/src/generated/instructions/revokeDataV1.ts +++ b/clients/js/src/generated/instructions/revokeDataV1.ts @@ -206,9 +206,9 @@ export function revokeDataV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.Data, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts index 8fc3c513..7df698cb 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigItemV1.ts @@ -216,9 +216,9 @@ export function revokeProgrammableConfigItemV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.ProgrammableConfigItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts index f20e7e1d..f5a92ef2 100644 --- a/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts +++ b/clients/js/src/generated/instructions/revokeProgrammableConfigV1.ts @@ -214,9 +214,9 @@ export function revokeProgrammableConfigV1( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.ProgrammableConfig, updateAuthority: expectSome(resolvedArgs.updateAuthority), + mint: expectPublicKey(resolvedAccounts.mint.value), delegate: expectPublicKey(resolvedAccounts.delegate.value), } ); diff --git a/clients/js/src/generated/instructions/transferV1.ts b/clients/js/src/generated/instructions/transferV1.ts index 9ac0a40f..2c2496eb 100644 --- a/clients/js/src/generated/instructions/transferV1.ts +++ b/clients/js/src/generated/instructions/transferV1.ts @@ -274,8 +274,8 @@ export function transferV1( resolvedAccounts.destinationTokenRecord.value = findTokenRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), token: expectPublicKey(resolvedAccounts.destinationToken.value), + mint: expectPublicKey(resolvedAccounts.mint.value), } ); } diff --git a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts index a49a556f..2996e0d0 100644 --- a/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsAuthorityItemDelegateV2.ts @@ -223,10 +223,10 @@ export function updateAsAuthorityItemDelegateV2( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.AuthorityItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), delegate: expectPublicKey(resolvedAccounts.authority.value), + mint: expectPublicKey(resolvedAccounts.mint.value), } ); } diff --git a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts index 1e08c35c..81f075e6 100644 --- a/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsCollectionItemDelegateV2.ts @@ -210,10 +210,10 @@ export function updateAsCollectionItemDelegateV2( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.CollectionItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), delegate: expectPublicKey(resolvedAccounts.authority.value), + mint: expectPublicKey(resolvedAccounts.mint.value), } ); } diff --git a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts index 4514deeb..06b5f51a 100644 --- a/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsDataItemDelegateV2.ts @@ -207,10 +207,10 @@ export function updateAsDataItemDelegateV2( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.DataItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), delegate: expectPublicKey(resolvedAccounts.authority.value), + mint: expectPublicKey(resolvedAccounts.mint.value), } ); } diff --git a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts index 9640572a..26633eee 100644 --- a/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts +++ b/clients/js/src/generated/instructions/updateAsProgrammableConfigItemDelegateV2.ts @@ -210,10 +210,10 @@ export function updateAsProgrammableConfigItemDelegateV2( resolvedAccounts.delegateRecord.value = findMetadataDelegateRecordPda( context, { - mint: expectPublicKey(resolvedAccounts.mint.value), delegateRole: MetadataDelegateRole.ProgrammableConfigItem, updateAuthority: expectSome(resolvedArgs.updateAuthority), delegate: expectPublicKey(resolvedAccounts.authority.value), + mint: expectPublicKey(resolvedAccounts.mint.value), } ); } diff --git a/clients/rust/src/generated/accounts/edition_marker.rs b/clients/rust/src/generated/accounts/edition_marker.rs index 55cf3e69..41939cc8 100644 --- a/clients/rust/src/generated/accounts/edition_marker.rs +++ b/clients/rust/src/generated/accounts/edition_marker.rs @@ -19,6 +19,7 @@ pub struct EditionMarker { impl EditionMarker { pub const LEN: usize = 32; + /// Prefix values used to generate a PDA for this account. /// /// Values are positional and appear in the following order: diff --git a/clients/rust/src/generated/accounts/holder_delegate_record.rs b/clients/rust/src/generated/accounts/holder_delegate_record.rs index abb5afae..722fe052 100644 --- a/clients/rust/src/generated/accounts/holder_delegate_record.rs +++ b/clients/rust/src/generated/accounts/holder_delegate_record.rs @@ -35,6 +35,7 @@ pub struct HolderDelegateRecord { impl HolderDelegateRecord { pub const LEN: usize = 98; + /// Prefix values used to generate a PDA for this account. /// /// Values are positional and appear in the following order: diff --git a/clients/rust/src/generated/accounts/metadata_delegate_record.rs b/clients/rust/src/generated/accounts/metadata_delegate_record.rs index 4adf49cf..2e845a73 100644 --- a/clients/rust/src/generated/accounts/metadata_delegate_record.rs +++ b/clients/rust/src/generated/accounts/metadata_delegate_record.rs @@ -35,6 +35,7 @@ pub struct MetadataDelegateRecord { impl MetadataDelegateRecord { pub const LEN: usize = 98; + /// Prefix values used to generate a PDA for this account. /// /// Values are positional and appear in the following order: diff --git a/clients/rust/src/generated/accounts/token_record.rs b/clients/rust/src/generated/accounts/token_record.rs index b94caf15..becf69f3 100644 --- a/clients/rust/src/generated/accounts/token_record.rs +++ b/clients/rust/src/generated/accounts/token_record.rs @@ -26,6 +26,7 @@ pub struct TokenRecord { impl TokenRecord { pub const LEN: usize = 80; + /// Prefix values used to generate a PDA for this account. /// /// Values are positional and appear in the following order: diff --git a/clients/rust/src/generated/accounts/use_authority_record.rs b/clients/rust/src/generated/accounts/use_authority_record.rs index d7325cdb..15552aac 100644 --- a/clients/rust/src/generated/accounts/use_authority_record.rs +++ b/clients/rust/src/generated/accounts/use_authority_record.rs @@ -20,6 +20,7 @@ pub struct UseAuthorityRecord { impl UseAuthorityRecord { pub const LEN: usize = 10; + /// Prefix values used to generate a PDA for this account. /// /// Values are positional and appear in the following order: diff --git a/clients/rust/src/generated/instructions/create_v1.rs b/clients/rust/src/generated/instructions/create_v1.rs index d7503988..28a49532 100644 --- a/clients/rust/src/generated/instructions/create_v1.rs +++ b/clients/rust/src/generated/instructions/create_v1.rs @@ -302,6 +302,7 @@ impl CreateV1Builder { self.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'TokenStandard::NonFungible']` #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.token_standard = Some(token_standard); @@ -392,7 +393,7 @@ impl CreateV1Builder { token_standard: self .token_standard .clone() - .expect("token_standard is not set"), + .unwrap_or(TokenStandard::NonFungible), collection: self.collection.clone(), uses: self.uses.clone(), collection_details: self.collection_details.clone(), @@ -769,6 +770,7 @@ impl<'a, 'b> CreateV1CpiBuilder<'a, 'b> { self.instruction.is_mutable = Some(is_mutable); self } + /// `[optional argument, defaults to 'TokenStandard::NonFungible']` #[inline(always)] pub fn token_standard(&mut self, token_standard: TokenStandard) -> &mut Self { self.instruction.token_standard = Some(token_standard); @@ -871,7 +873,7 @@ impl<'a, 'b> CreateV1CpiBuilder<'a, 'b> { .instruction .token_standard .clone() - .expect("token_standard is not set"), + .unwrap_or(TokenStandard::NonFungible), collection: self.instruction.collection.clone(), uses: self.instruction.uses.clone(), collection_details: self.instruction.collection_details.clone(), diff --git a/configs/kinobi.cjs b/configs/kinobi.cjs index fe063640..c10a0b35 100755 --- a/configs/kinobi.cjs +++ b/configs/kinobi.cjs @@ -9,7 +9,7 @@ const idlDir = path.join(__dirname, "..", "idls"); const kinobi = k.createFromIdls([path.join(idlDir, "token_metadata.json")]); kinobi.update( - new k.UpdateProgramsVisitor({ + k.updateProgramsVisitor({ tokenMetadata: { name: "mplTokenMetadata", }, @@ -18,12 +18,16 @@ kinobi.update( // Update Accounts. const metadataSeeds = [ - k.stringConstantSeed("metadata"), - k.programSeed(), - k.publicKeySeed("mint", "The address of the mint account"), + k.constantPdaSeedNodeFromString("metadata"), + k.programIdPdaSeedNode(), + k.variablePdaSeedNode( + "mint", + k.publicKeyTypeNode(), + "The address of the mint account" + ), ]; kinobi.update( - new k.UpdateAccountsVisitor({ + k.updateAccountsVisitor({ metadata: { size: null, seeds: metadataSeeds, @@ -31,19 +35,20 @@ kinobi.update( masterEditionV1: { size: null, name: "deprecatedMasterEditionV1", - seeds: [...metadataSeeds, k.stringConstantSeed("edition")], + seeds: [...metadataSeeds, k.constantPdaSeedNodeFromString("edition")], }, masterEditionV2: { size: null, name: "masterEdition", - seeds: [...metadataSeeds, k.stringConstantSeed("edition")], + seeds: [...metadataSeeds, k.constantPdaSeedNodeFromString("edition")], }, editionMarker: { seeds: [ ...metadataSeeds, - k.stringConstantSeed("edition"), - k.stringSeed( + k.constantPdaSeedNodeFromString("edition"), + k.variablePdaSeedNode( "editionMarker", + k.stringTypeNode({ size: k.remainderSizeNode() }), "The floor of the edition number divided by 248 as a string. I.e. ⌊edition/248⌋." ), ], @@ -51,17 +56,18 @@ kinobi.update( editionMarkerV2: { seeds: [ ...metadataSeeds, - k.stringConstantSeed("edition"), - k.stringConstantSeed("marker"), + k.constantPdaSeedNodeFromString("edition"), + k.constantPdaSeedNodeFromString("marker"), ], }, tokenRecord: { size: 80, seeds: [ ...metadataSeeds, - k.stringConstantSeed("token_record"), - k.publicKeySeed( + k.constantPdaSeedNodeFromString("token_record"), + k.variablePdaSeedNode( "token", + k.publicKeyTypeNode(), "The address of the token account (ata or not)" ), ], @@ -70,24 +76,30 @@ kinobi.update( size: 98, seeds: [ ...metadataSeeds, - k.variableSeed( + k.variablePdaSeedNode( "delegateRole", - k.linkTypeNode("metadataDelegateRoleSeed", { importFrom: "hooked" }), + k.definedTypeLinkNode("metadataDelegateRoleSeed", "hooked"), "The role of the metadata delegate" ), - k.publicKeySeed( + k.variablePdaSeedNode( "updateAuthority", + k.publicKeyTypeNode(), "The address of the metadata's update authority" ), - k.publicKeySeed("delegate", "The address of the delegate authority"), + k.variablePdaSeedNode( + "delegate", + k.publicKeyTypeNode(), + "The address of the delegate authority" + ), ], }, collectionAuthorityRecord: { seeds: [ ...metadataSeeds, - k.stringConstantSeed("collection_authority"), - k.publicKeySeed( + k.constantPdaSeedNodeFromString("collection_authority"), + k.variablePdaSeedNode( "collectionAuthority", + k.publicKeyTypeNode(), "The address of the collection authority" ), ], @@ -96,23 +108,32 @@ kinobi.update( size: 98, seeds: [ ...metadataSeeds, - k.variableSeed( + k.variablePdaSeedNode( "delegateRole", - k.linkTypeNode("holderDelegateRoleSeed", { importFrom: "hooked" }), + k.definedTypeLinkNode("holderDelegateRoleSeed", "hooked"), "The role of the holder delegate" ), - k.publicKeySeed( + k.variablePdaSeedNode( "owner", + k.publicKeyTypeNode(), "The address of the owner of the token" ), - k.publicKeySeed("delegate", "The address of the delegate authority"), + k.variablePdaSeedNode( + "delegate", + k.publicKeyTypeNode(), + "The address of the delegate authority" + ), ], }, useAuthorityRecord: { seeds: [ ...metadataSeeds, - k.stringConstantSeed("user"), - k.publicKeySeed("useAuthority", "The address of the use authority"), + k.constantPdaSeedNodeFromString("user"), + k.variablePdaSeedNode( + "useAuthority", + k.publicKeyTypeNode(), + "The address of the use authority" + ), ], }, // Deprecated nodes. @@ -123,34 +144,35 @@ kinobi.update( // Set default values for instruction accounts. kinobi.update( - new k.SetInstructionAccountDefaultValuesVisitor([ + k.setInstructionAccountDefaultValuesVisitor([ { account: "updateAuthority", ignoreIfOptional: true, - ...k.identityDefault(), + defaultValue: k.identityValueNode(), }, { account: "metadata", ignoreIfOptional: true, - ...k.pdaDefault("metadata"), + defaultValue: k.pdaValueNode("metadata"), }, { account: "tokenRecord", ignoreIfOptional: true, - ...k.pdaDefault("tokenRecord"), + defaultValue: k.pdaValueNode("tokenRecord"), }, { account: /^edition|masterEdition$/, ignoreIfOptional: true, - ...k.pdaDefault("masterEdition"), + defaultValue: k.pdaValueNode("masterEdition"), }, { account: "authorizationRulesProgram", - ...k.conditionalDefault("account", "authorizationRules", { - ifTrue: k.programDefault( - "mplTokenAuthRules", - "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg" - ), + defaultValue: k.conditionalValueNode({ + condition: k.accountValueNode("authorizationRules"), + ifTrue: k.publicKeyValueNode( + "auth9SigNpDKz4sJJ1DfCTuZrZNSAgh9sFD3rboVmgg", + "mplTokenAuthRules" + ) }), }, ]) @@ -158,370 +180,360 @@ kinobi.update( // Update Instructions. const ataPdaDefault = (mint = "mint", owner = "owner") => - k.pdaDefault("associatedToken", { - importFrom: "mplToolbox", - seeds: { mint: k.accountDefault(mint), owner: k.accountDefault(owner) }, - }); + k.pdaValueNode(k.pdaLinkNode("associatedToken", "mplToolbox"), [ + k.pdaSeedValueNode("mint", k.accountValueNode(mint)), + k.pdaSeedValueNode("owner", k.accountValueNode(owner)) + ]); kinobi.update( - new k.UpdateInstructionsVisitor({ + k.updateInstructionsVisitor({ create: { - bytesCreatedOnChain: k.bytesFromNumber( - 82 + // Mint account. - 679 + // Metadata account. - 282 + // Master edition account. - 128 * 3, // 3 account headers. - false - ), + byteDeltas: [ + k.instructionByteDeltaNode( + k.numberValueNode( + 82 + // Mint account. + 679 + // Metadata account. + 282 + // Master edition account. + 128 * 3 // 3 account headers. + ), + { withHeader: false } + ), + ], accounts: { mint: { isSigner: "either" }, updateAuthority: { isSigner: "either", - defaultsTo: k.accountDefault("authority"), + defaultValue: k.accountValueNode("authority"), }, splTokenProgram: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungibleOrIsMintSigner", [ - k.dependsOnAccount("mint"), - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.programDefault( - "splToken", - "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" - ), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode( + "resolveIsNonFungibleOrIsMintSigner", + { + dependsOn: [ + k.accountValueNode("mint"), + k.argumentValueNode("tokenStandard"), + ], + } + ), + ifTrue: k.publicKeyValueNode( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "splToken" + ), + }), }, }, }, mint: { - bytesCreatedOnChain: k.bytesFromNumber( - 165 + // Token account. - 47 + // Token Record account. - 128 * 2, // 2 account headers. - false - ), + byteDeltas: [ + k.instructionByteDeltaNode( + k.numberValueNode( + 165 + // Token account. + 47 + // Token Record account. + 128 * 2 // 2 account headers. + ), + { withHeader: false } + ), + ], accounts: { masterEdition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, tokenOwner: { - defaultsTo: k.resolverDefault("resolveOptionalTokenOwner", []), + defaultValue: k.resolverValueNode("resolveOptionalTokenOwner"), }, token: { - defaultsTo: ataPdaDefault("mint", "tokenOwner"), + defaultValue: ataPdaDefault("mint", "tokenOwner"), }, tokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, }, - args: { - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + arguments: { + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, transfer: { accounts: { token: { - defaultsTo: ataPdaDefault("mint", "tokenOwner"), + defaultValue: ataPdaDefault("mint", "tokenOwner"), }, tokenOwner: { - defaultsTo: k.identityDefault(), + defaultValue: k.identityValueNode(), }, edition: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("masterEdition"), }), }, ownerTokenRecord: { name: "tokenRecord", - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, destination: { name: "destinationToken", - defaultsTo: ataPdaDefault("mint", "destinationOwner"), + defaultValue: ataPdaDefault("mint", "destinationOwner"), }, destinationTokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("destinationToken"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord", [ + k.pdaSeedValueNode( + "token", + k.accountValueNode("destinationToken") + ), + ]), }), }, }, - args: { - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + arguments: { + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, delegate: { accounts: { masterEdition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, }, - args: { + arguments: { tokenStandard: { - type: k.linkTypeNode("tokenStandard"), + type: k.definedTypeLinkNode("tokenStandard"), }, }, }, revoke: { accounts: { masterEdition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, }, - args: { + arguments: { tokenStandard: { - type: k.linkTypeNode("tokenStandard"), + type: k.definedTypeLinkNode("tokenStandard"), }, }, }, lock: { accounts: { tokenOwner: { - defaultsTo: k.resolverDefault("resolveOptionalTokenOwner", []), + defaultValue: k.resolverValueNode("resolveOptionalTokenOwner"), }, token: { - defaultsTo: ataPdaDefault("mint", "tokenOwner"), + defaultValue: ataPdaDefault("mint", "tokenOwner"), }, edition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, tokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, splTokenProgram: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifFalse: k.programDefault( - "splToken", - "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifFalse: k.publicKeyValueNode( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "splToken" ), }), }, }, - args: { - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + arguments: { + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, unlock: { accounts: { tokenOwner: { - defaultsTo: k.resolverDefault("resolveOptionalTokenOwner", []), + defaultValue: k.resolverValueNode("resolveOptionalTokenOwner"), }, token: { - defaultsTo: ataPdaDefault("mint", "tokenOwner"), + defaultValue: ataPdaDefault("mint", "tokenOwner"), }, edition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, tokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, splTokenProgram: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifFalse: k.programDefault( - "splToken", - "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifFalse: k.publicKeyValueNode( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "splToken" ), }), }, }, - args: { - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + arguments: { + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, burn: { accounts: { token: { isOptional: false, - defaultsTo: k.pdaDefault("associatedToken", { - importFrom: "mplToolbox", - seeds: { - mint: k.accountDefault("mint"), - owner: k.argDefault("tokenOwner"), - }, - }), + defaultValue: k.pdaValueNode( + k.pdaLinkNode("associatedToken", "mplToolbox"), + [ + k.pdaSeedValueNode("mint", k.accountValueNode("mint")), + k.pdaSeedValueNode("owner", k.argumentValueNode("tokenOwner")), + ] + ), }, edition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, masterEdition: { - defaultsTo: k.conditionalDefault("account", "masterEditionMint", { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("masterEditionMint") }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.accountValueNode("masterEditionMint"), + ifTrue: k.pdaValueNode("masterEdition", [ + k.pdaSeedValueNode( + "mint", + k.accountValueNode("masterEditionMint") + ), + ]), }), }, tokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, }, - args: { + arguments: { tokenOwner: { type: k.publicKeyTypeNode(), - defaultsTo: k.identityDefault(), + defaultValue: k.identityValueNode(), }, - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, print: { accounts: { editionMint: { isSigner: "either" }, - editionTokenAccountOwner: { defaultsTo: k.identityDefault() }, + editionTokenAccountOwner: { defaultValue: k.identityValueNode() }, editionMetadata: { - defaultsTo: k.pdaDefault("metadata", { - seeds: { mint: k.accountDefault("editionMint") }, - }), + defaultValue: k.pdaValueNode("metadata", [ + k.pdaSeedValueNode("mint", k.accountValueNode("editionMint")), + ]), }, edition: { - defaultsTo: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("editionMint") }, - }), + defaultValue: k.pdaValueNode("masterEdition", [ + k.pdaSeedValueNode("mint", k.accountValueNode("editionMint")), + ]), }, editionTokenAccount: { - defaultsTo: ataPdaDefault("editionMint", "editionTokenAccountOwner"), + defaultValue: ataPdaDefault("editionMint", "editionTokenAccountOwner"), }, masterTokenAccount: { - defaultsTo: k.pdaDefault("associatedToken", { - importFrom: "mplToolbox", - seeds: { - mint: k.argDefault("masterEditionMint"), - owner: k.accountDefault("masterTokenAccountOwner"), - }, - }), + defaultValue: k.pdaValueNode( + k.pdaLinkNode("associatedToken", "mplToolbox"), + [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + k.pdaSeedValueNode( + "owner", + k.accountValueNode("masterTokenAccountOwner") + ), + ] + ), }, masterMetadata: { - defaultsTo: k.pdaDefault("metadata", { - seeds: { mint: k.argDefault("masterEditionMint") }, - }), + defaultValue: k.pdaValueNode("metadata", [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + ]), }, masterEdition: { - defaultsTo: k.pdaDefault("masterEdition", { - seeds: { mint: k.argDefault("masterEditionMint") }, - }), + defaultValue: k.pdaValueNode("masterEdition", [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + ]), }, editionTokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("editionMint"), - token: k.accountDefault("editionTokenAccount"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord", [ + k.pdaSeedValueNode( + "mint", + k.accountValueNode("editionMint") + ), + k.pdaSeedValueNode( + "token", + k.accountValueNode("editionTokenAccount") + ), + ]) }), }, }, - args: { + arguments: { masterEditionMint: { type: k.publicKeyTypeNode() }, - tokenStandard: { type: k.linkTypeNode("tokenStandard") }, + tokenStandard: { type: k.definedTypeLinkNode("tokenStandard") }, }, }, updateMetadataAccountV2: { - args: { updateAuthority: { name: "newUpdateAuthority" } }, + arguments: { updateAuthority: { name: "newUpdateAuthority" } }, }, // Deprecated instructions. createMetadataAccount: { delete: true }, @@ -539,10 +551,10 @@ kinobi.update( // Set account discriminators. const key = (name) => ({ field: "key", - value: k.vEnum("Key", name), + value: k.enumValueNode("Key", name), }); kinobi.update( - new k.SetAccountDiscriminatorFromFieldVisitor({ + k.setAccountDiscriminatorFromFieldVisitor({ Edition: key("EditionV1"), Metadata: key("MetadataV1"), MasterEdition: key("MasterEditionV2"), @@ -559,47 +571,53 @@ kinobi.update( // Wrap leaves. kinobi.update( - new k.SetNumberWrappersVisitor({ + k.setNumberWrappersVisitor({ "AssetData.sellerFeeBasisPoints": { kind: "Amount", - identifier: "%", decimals: 2, + unit: "%", }, }) ); // Set struct default values. kinobi.update( - new k.SetStructDefaultValuesVisitor({ + k.setStructDefaultValuesVisitor({ assetData: { - symbol: k.vScalar(""), - isMutable: k.vScalar(true), - primarySaleHappened: k.vScalar(false), - collection: k.vNone(), - uses: k.vNone(), - collectionDetails: k.vNone(), - ruleSet: k.vNone(), + symbol: k.stringValueNode(""), + isMutable: k.booleanValueNode(true), + primarySaleHappened: k.booleanValueNode(false), + collection: k.noneValueNode(), + uses: k.noneValueNode(), + collectionDetails: k.noneValueNode(), + ruleSet: k.noneValueNode(), + }, + "updateArgs.AsUpdateAuthorityV2": { tokenStandard: k.noneValueNode() }, + "updateArgs.AsAuthorityItemDelegateV2": { + tokenStandard: k.noneValueNode(), }, - "updateArgs.AsUpdateAuthorityV2": { tokenStandard: k.vNone() }, - "updateArgs.AsAuthorityItemDelegateV2": { tokenStandard: k.vNone() }, }) ); // Set more struct default values dynamically. kinobi.update( - new k.TransformNodesVisitor([ + k.bottomUpTransformerVisitor([ { - selector: { kind: "structFieldTypeNode", name: "amount" }, - transformer: (node) => { - k.assertStructFieldTypeNode(node); - return k.structFieldTypeNode({ + select: "[structFieldTypeNode|instructionArgumentNode]amount", + transform: (node) => { + k.assertIsNode(node, [ + "structFieldTypeNode", + "instructionArgumentNode", + ]); + return { ...node, - defaultsTo: { strategy: "optional", value: k.vScalar(1) }, - }); + defaultValueStrategy: "optional", + defaultValue: k.numberValueNode(1), + }; }, }, { - selector: (node) => { + select: (node) => { const names = [ "authorizationData", "decimals", @@ -610,21 +628,25 @@ kinobi.update( "isMutable", ]; return ( - k.isStructFieldTypeNode(node) && - k.isOptionTypeNode(node.child) && + k.isNode(node, ["structFieldTypeNode", "instructionArgumentNode"]) && + k.isNode(node.type, "optionTypeNode") && names.includes(node.name) ); }, - transformer: (node) => { - k.assertStructFieldTypeNode(node); - return k.structFieldTypeNode({ + transform: (node) => { + k.assertIsNode(node, [ + "structFieldTypeNode", + "instructionArgumentNode", + ]); + return { ...node, - defaultsTo: { strategy: "optional", value: k.vNone() }, - }); + defaultValueStrategy: "optional", + defaultValue: k.noneValueNode() + }; }, }, { - selector: (node) => { + select: (node) => { const toggles = [ "collectionToggle", "collectionDetailsToggle", @@ -632,19 +654,18 @@ kinobi.update( "ruleSetToggle", ]; return ( - k.isStructFieldTypeNode(node) && - k.isLinkTypeNode(node.child) && - toggles.includes(node.child.name) + k.isNode(node, "structFieldTypeNode") && + k.isNode(node.type, "definedTypeLinkNode") && + toggles.includes(node.type.name) ); }, - transformer: (node) => { - k.assertStructFieldTypeNode(node); + transform: (node) => { + k.assertIsNode(node, "structFieldTypeNode"); + k.assertIsNode(node.type, "definedTypeLinkNode"); return k.structFieldTypeNode({ ...node, - defaultsTo: { - strategy: "optional", - value: k.vEnum(node.child.name, "None", "empty"), - }, + defaultValueStrategy: "optional", + defaultValue: k.enumValueNode(node.type, "None"), }); }, }, @@ -652,10 +673,10 @@ kinobi.update( ); // Unwrap types and structs. -kinobi.update(new k.UnwrapDefinedTypesVisitor(["AssetData"])); -kinobi.update(new k.UnwrapTypeDefinedLinksVisitor(["metadata.data"])); +kinobi.update(k.unwrapDefinedTypesVisitor(["AssetData"])); +kinobi.update(k.unwrapTypeDefinedLinksVisitor(["metadata.data"])); kinobi.update( - new k.FlattenStructVisitor({ + k.flattenStructVisitor({ Metadata: ["data"], "CreateArgs.V1": ["assetData"], }) @@ -663,12 +684,11 @@ kinobi.update( // Create versioned instructions. kinobi.update( - new k.CreateSubInstructionsFromEnumArgsVisitor({ + k.createSubInstructionsFromEnumArgsVisitor({ burn: "burnArgs", create: "createArgs", delegate: "delegateArgs", lock: "lockArgs", - migrate: "migrateArgs", mint: "mintArgs", print: "printArgs", revoke: "revokeArgs", @@ -682,11 +702,13 @@ kinobi.update( ); kinobi.update( - new k.TransformNodesVisitor([ + k.bottomUpTransformerVisitor([ { - selector: { kind: "instructionNode", name: "printV2" }, - transformer: (node) => { - k.assertInstructionNode(node); + select: "[instructionNode]printV2", + transform: (node) => { + k.assertIsNode(node, [ + "instructionNode" + ]); return k.instructionNode({ ...node, accounts: [ @@ -714,234 +736,261 @@ const tokenDelegateDefaults = { accounts: { token: { isOptional: false, - defaultsTo: k.pdaDefault("associatedToken", { - importFrom: "mplToolbox", - seeds: { - mint: k.accountDefault("mint"), - owner: k.argDefault("tokenOwner"), - }, - }), + defaultValue: k.pdaValueNode( + k.pdaLinkNode("associatedToken", "mplToolbox"), + [ + k.pdaSeedValueNode("mint", k.accountValueNode("mint")), + k.pdaSeedValueNode("owner", k.argumentValueNode("tokenOwner")), + ] + ), }, tokenRecord: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("tokenRecord", { - seeds: { - mint: k.accountDefault("mint"), - token: k.accountDefault("token"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("tokenRecord"), }), }, - delegateRecord: { defaultsTo: k.pdaDefault("tokenRecord") }, + delegateRecord: { defaultValue: k.pdaValueNode("tokenRecord") }, splTokenProgram: { - defaultsTo: k.programDefault( - "splToken", - "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" + defaultValue: k.publicKeyValueNode( + "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", + "splToken" ), }, }, - args: { + arguments: { tokenOwner: { type: k.publicKeyTypeNode(), - defaultsTo: k.identityDefault(), + defaultValue: k.identityValueNode(), }, }, }; const metadataDelegateDefaults = (role) => ({ accounts: { delegateRecord: { - defaultsTo: k.pdaDefault("metadataDelegateRecord", { - seeds: { - mint: k.accountDefault("mint"), - delegateRole: k.valueDefault(k.vEnum("MetadataDelegateRole", role)), - updateAuthority: k.argDefault("updateAuthority"), - delegate: k.accountDefault("delegate"), - }, - }), + defaultValue: k.pdaValueNode("metadataDelegateRecord", [ + k.pdaSeedValueNode( + "delegateRole", + k.enumValueNode("MetadataDelegateRole", role) + ), + k.pdaSeedValueNode( + "updateAuthority", + k.argumentValueNode("updateAuthority") + ), + ]), }, }, - args: { + arguments: { updateAuthority: { type: k.publicKeyTypeNode(), - defaultsTo: k.accountDefault("authority"), + defaultValue: k.accountValueNode("authority"), }, }, }); const updateAsMetadataDelegateDefaults = (role) => ({ accounts: { delegateRecord: { - defaultsTo: k.pdaDefault("metadataDelegateRecord", { - seeds: { - mint: k.accountDefault("mint"), - delegateRole: k.valueDefault(k.vEnum("MetadataDelegateRole", role)), - updateAuthority: k.argDefault("updateAuthority"), - delegate: k.accountDefault("authority"), - }, - }), + defaultValue: k.pdaValueNode("metadataDelegateRecord", [ + k.pdaSeedValueNode( + "delegateRole", + k.enumValueNode("MetadataDelegateRole", role) + ), + k.pdaSeedValueNode( + "updateAuthority", + k.argumentValueNode("updateAuthority") + ), + k.pdaSeedValueNode("delegate", k.accountValueNode("authority")), + ]), }, token: role === "ProgrammableConfigItem" - ? { isOptional: false, defaultsTo: null } + ? { isOptional: false, defaultValue: null } : undefined, }, - args: { + arguments: { updateAuthority: { type: k.publicKeyTypeNode(), - defaultsTo: k.identityDefault(), + defaultValue: k.identityValueNode(), }, }, }); const updateAsMetadataCollectionDelegateDefaults = (role) => ({ accounts: { delegateRecord: { - defaultsTo: k.pdaDefault("metadataDelegateRecord", { - seeds: { - mint: k.argDefault("delegateMint"), - delegateRole: k.valueDefault(k.vEnum("MetadataDelegateRole", role)), - updateAuthority: k.argDefault("delegateUpdateAuthority"), - delegate: k.accountDefault("authority"), - }, - }), + defaultValue: k.pdaValueNode("metadataDelegateRecord", [ + k.pdaSeedValueNode("mint", k.argumentValueNode("delegateMint")), + k.pdaSeedValueNode( + "delegateRole", + k.enumValueNode("MetadataDelegateRole", role) + ), + k.pdaSeedValueNode( + "updateAuthority", + k.argumentValueNode("delegateUpdateAuthority") + ), + k.pdaSeedValueNode("delegate", k.accountValueNode("authority")), + ]), }, token: role === "ProgrammableConfig" - ? { isOptional: false, defaultsTo: null } + ? { isOptional: false, defaultValue: null } : undefined, }, - args: { + arguments: { delegateMint: { type: k.publicKeyTypeNode(), - defaultsTo: k.accountDefault("mint"), + defaultValue: k.accountValueNode("mint"), }, delegateUpdateAuthority: { type: k.publicKeyTypeNode(), - defaultsTo: k.identityDefault(), + defaultValue: k.identityValueNode(), }, }, }); const verifyCollectionDefaults = { accounts: { - collectionMint: { isOptional: false, defaultsTo: null }, + collectionMint: { isOptional: false, defaultValue: null }, collectionMetadata: { - defaultsTo: k.pdaDefault("metadata", { - seeds: { mint: k.accountDefault("collectionMint") }, - }), + defaultValue: k.pdaValueNode("metadata", [ + k.pdaSeedValueNode("mint", k.accountValueNode("collectionMint")), + ]), }, collectionMasterEdition: { - defaultsTo: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("collectionMint") }, - }), + defaultValue: k.pdaValueNode("masterEdition", [ + k.pdaSeedValueNode("mint", k.accountValueNode("collectionMint")), + ]), }, }, }; kinobi.update( - new k.UpdateInstructionsVisitor({ + k.updateInstructionsVisitor({ createV1: { - bytesCreatedOnChain: k.bytesFromResolver("resolveCreateV1Bytes"), + byteDeltas: [ + k.instructionByteDeltaNode(k.resolverValueNode("resolveCreateV1Bytes")), + ], accounts: { masterEdition: { - defaultsTo: k.conditionalResolverDefault( - k.resolverDefault("resolveIsNonFungible", [ - k.dependsOnArg("tokenStandard"), - ]), - { - ifTrue: k.pdaDefault("masterEdition", { - seeds: { mint: k.accountDefault("mint") }, - }), - } - ), + defaultValue: k.conditionalValueNode({ + condition: k.resolverValueNode("resolveIsNonFungible", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), + ifTrue: k.pdaValueNode("masterEdition"), + }), }, }, - args: { + arguments: { isCollection: { - type: k.boolTypeNode(), - defaultsTo: k.valueDefault(k.vScalar(false)), + type: k.booleanTypeNode(), + defaultValue: k.booleanValueNode(false), }, tokenStandard: { - defaultsTo: k.valueDefault(k.vEnum("TokenStandard", "NonFungible")), + defaultValue: k.enumValueNode("TokenStandard", "NonFungible"), }, collectionDetails: { - defaultsTo: k.resolverDefault("resolveCollectionDetails", [ - k.dependsOnArg("isCollection"), - ]), + defaultValue: k.resolverValueNode("resolveCollectionDetails", { + dependsOn: [k.argumentValueNode("isCollection")], + }), }, decimals: { - defaultsTo: k.resolverDefault("resolveDecimals", [ - k.dependsOnArg("tokenStandard"), - ]), + defaultValue: k.resolverValueNode("resolveDecimals", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), }, printSupply: { - defaultsTo: k.resolverDefault("resolvePrintSupply", [ - k.dependsOnArg("tokenStandard"), - ]), + defaultValue: k.resolverValueNode("resolvePrintSupply", { + dependsOn: [k.argumentValueNode("tokenStandard")], + }), }, creators: { - defaultsTo: k.resolverDefault("resolveCreators", [ - k.dependsOnAccount("authority"), - ]), + defaultValue: k.resolverValueNode("resolveCreators", { + dependsOn: [k.accountValueNode("authority")], + }), }, }, }, printV1: { accounts: { editionMarkerPda: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("editionMarkerV2", { - seeds: { mint: k.argDefault("masterEditionMint") }, - }), - ifFalse: k.pdaDefault("editionMarkerFromEditionNumber", { - importFrom: "hooked", - seeds: { - mint: k.argDefault("masterEditionMint"), - editionNumber: k.argDefault("editionNumber"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("editionMarkerV2", [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + ]), + ifFalse: k.pdaValueNode( + k.pdaLinkNode("editionMarkerFromEditionNumber", "hooked"), + [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + k.pdaSeedValueNode( + "editionNumber", + k.argumentValueNode("editionNumber") + ), + ] + ), }), }, editionMintAuthority: { - defaultsTo: k.accountDefault("masterTokenAccountOwner"), + defaultValue: k.accountValueNode("masterTokenAccountOwner"), }, masterTokenAccountOwner: { - defaultsTo: k.identityDefault(), isSigner: true + defaultValue: k.identityValueNode(), + isSigner: true }, }, - args: { edition: { name: "editionNumber" }, }, + arguments: { edition: { name: "editionNumber" }, }, }, printV2: { accounts: { editionMarkerPda: { - defaultsTo: k.conditionalDefault("arg", "tokenStandard", { - value: k.vEnum("TokenStandard", "ProgrammableNonFungible"), - ifTrue: k.pdaDefault("editionMarkerV2", { - seeds: { mint: k.argDefault("masterEditionMint") }, - }), - ifFalse: k.pdaDefault("editionMarkerFromEditionNumber", { - importFrom: "hooked", - seeds: { - mint: k.argDefault("masterEditionMint"), - editionNumber: k.argDefault("editionNumber"), - }, - }), + defaultValue: k.conditionalValueNode({ + condition: k.argumentValueNode("tokenStandard"), + value: k.enumValueNode("TokenStandard", "ProgrammableNonFungible"), + ifTrue: k.pdaValueNode("editionMarkerV2", [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + ]), + ifFalse: k.pdaValueNode( + k.pdaLinkNode("editionMarkerFromEditionNumber", "hooked"), + [ + k.pdaSeedValueNode( + "mint", + k.argumentValueNode("masterEditionMint") + ), + k.pdaSeedValueNode( + "editionNumber", + k.argumentValueNode("editionNumber") + ), + ] + ), }), }, editionMintAuthority: { - defaultsTo: k.conditionalDefault("account", "holderDelegateRecord", { - ifTrue: k.conditionalDefault("account", "delegate", { - ifTrue: k.accountDefault("delegate"), - ifFalse: k.accountDefault("payer"), - }), - ifFalse: k.identityDefault(), + defaultValue: k.conditionalValueNode({ + condition: k.accountValueNode("holderDelegateRecord"), + ifTrue: k.conditionalValueNode({ + condition: k.accountValueNode("delegate"), + ifTrue: k.accountValueNode("delegate"), + ifFalse: k.accountValueNode("payer"), + }), + ifFalse: k.identityValueNode(), }), }, masterTokenAccountOwner: { - defaultsTo: k.conditionalDefault("account", "holderDelegateRecord", { - ifFalse: k.identityDefault(), + defaultValue: k.conditionalValueNode({ + condition: k.accountValueNode("holderDelegateRecord"), + ifFalse: k.identityValueNode(), }), }, }, - args: { edition: { name: "editionNumber" }, }, + arguments: { edition: { name: "editionNumber" }, }, }, // Update. updateAsAuthorityItemDelegateV2: @@ -968,7 +1017,7 @@ kinobi.update( ...tokenDelegateDefaults, accounts: { ...tokenDelegateDefaults.accounts, - tokenRecord: { defaultsTo: k.programIdDefault() }, + tokenRecord: { defaultValue: k.programIdValueNode() }, }, }, delegateLockedTransferV1: tokenDelegateDefaults, @@ -991,7 +1040,7 @@ kinobi.update( ...tokenDelegateDefaults, accounts: { ...tokenDelegateDefaults.accounts, - tokenRecord: { defaultsTo: k.programIdDefault() }, + tokenRecord: { defaultValue: k.programIdValueNode() }, }, }, revokeLockedTransferV1: tokenDelegateDefaults, @@ -1012,13 +1061,14 @@ kinobi.update( // Render JavaScript. const jsDir = path.join(clientDir, "js", "src", "generated"); const prettier = require(path.join(clientDir, "js", ".prettierrc.json")); -kinobi.accept(new k.RenderJavaScriptVisitor(jsDir, { prettier })); +const { pdaLinkNode } = require("@metaplex-foundation/kinobi"); +kinobi.accept(k.renderJavaScriptVisitor(jsDir, { prettier })); // Render Rust. const crateDir = path.join(clientDir, "rust"); const rustDir = path.join(clientDir, "rust", "src", "generated"); kinobi.accept( - new k.RenderRustVisitor(rustDir, { + k.renderRustVisitor(rustDir, { formatCode: true, crateFolder: crateDir, renderParentInstructions: true, diff --git a/package.json b/package.json index 0745c7ee..001a102e 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ }, "devDependencies": { "@metaplex-foundation/amman": "^0.12.1", - "@metaplex-foundation/kinobi": "^0.16.15", + "@metaplex-foundation/kinobi": "^0.17.0", "@metaplex-foundation/shank-js": "^0.1.0", "typescript": "^4.9.4" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 17babb03..ef6a44f5 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,12 +1,16 @@ lockfileVersion: '6.0' +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + devDependencies: '@metaplex-foundation/amman': specifier: ^0.12.1 version: 0.12.1(typescript@4.9.5) '@metaplex-foundation/kinobi': - specifier: ^0.16.15 - version: 0.16.15 + specifier: ^0.17.0 + version: 0.17.0(fastestsmallesttextencoderdecoder@1.0.22) '@metaplex-foundation/shank-js': specifier: ^0.1.0 version: 0.1.0 @@ -85,15 +89,18 @@ packages: resolution: {integrity: sha512-S9RulC2fFCFOQraz61bij+5YCHhSO9llJegK8c8Y6731fSi6snUSQJdCUqYS8AIgR0TKbQvdvgSyIIdbDFZbBA==} dev: true - /@metaplex-foundation/kinobi@0.16.15: - resolution: {integrity: sha512-D4uNSoue6+SCBVy4byqMt8O6yFitPTBP0AJC+37cMrtZjo22tGUAGfKklgcuTY3MoBbSh/xhndXXrckU32uExA==} + /@metaplex-foundation/kinobi@0.17.0(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-tElCrV861b3sVjc0JnkfyyBOZPrqKpHYy+8aL1yUOBXYXRK92n5mZiTuZL8Klgr2bIzlzsDcd3dYWRUnzCyROg==} dependencies: - '@noble/hashes': 1.2.0 + '@noble/hashes': 1.3.3 + '@solana/codecs-strings': 2.0.0-experimental.a157265(fastestsmallesttextencoderdecoder@1.0.22) chalk: 4.1.2 + json-stable-stringify: 1.1.1 nunjucks: 3.2.4 prettier: 2.8.8 transitivePeerDependencies: - chokidar + - fastestsmallesttextencoderdecoder dev: true /@metaplex-foundation/rustbin@0.3.1: @@ -121,8 +128,9 @@ packages: resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} dev: true - /@noble/hashes@1.2.0: - resolution: {integrity: sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==} + /@noble/hashes@1.3.3: + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} + engines: {node: '>= 16'} dev: true /@noble/secp256k1@1.7.1: @@ -169,6 +177,26 @@ packages: buffer: 6.0.3 dev: true + /@solana/codecs-core@2.0.0-experimental.a157265: + resolution: {integrity: sha512-78SjZiLWWjAn5sVL92T5W+4LXYG01Vu28tVbtiCWi4QEX21794bW6lMcXbPmbivFPbD8Dje+EHAYADfxYj6RTA==} + dev: true + + /@solana/codecs-numbers@2.0.0-experimental.a157265: + resolution: {integrity: sha512-Bkp7Y1KyhMsu8tHKxwHDXCnYxEawT0P4kEsIO1Fzs54pxOS1jtwJHo7e4FE8Kv8ZSajUQAnbmQqj5GaIU08h9A==} + dependencies: + '@solana/codecs-core': 2.0.0-experimental.a157265 + dev: true + + /@solana/codecs-strings@2.0.0-experimental.a157265(fastestsmallesttextencoderdecoder@1.0.22): + resolution: {integrity: sha512-1AypxqrFipI053/EOHZnDDcfKBduLjJdrpkbcqrgWJyciv/7+fMQjkgjbG+C8Vcqx5G8weUesXCcvAhqbdRwMw==} + peerDependencies: + fastestsmallesttextencoderdecoder: ^1.0.22 + dependencies: + '@solana/codecs-core': 2.0.0-experimental.a157265 + '@solana/codecs-numbers': 2.0.0-experimental.a157265 + fastestsmallesttextencoderdecoder: 1.0.22 + dev: true + /@solana/spl-token-registry@0.2.4574: resolution: {integrity: sha512-JzlfZmke8Rxug20VT/VpI2XsXlsqMlcORIUivF+Yucj7tFi7A0dXG7h+2UnD0WaZJw8BrUz2ABNkUnv89vbv1A==} engines: {node: '>=10'} @@ -197,7 +225,7 @@ packages: dependencies: '@babel/runtime': 7.20.13 '@noble/ed25519': 1.7.3 - '@noble/hashes': 1.2.0 + '@noble/hashes': 1.3.3 '@noble/secp256k1': 1.7.1 '@solana/buffer-layout': 4.0.1 agentkeepalive: 4.2.1 @@ -398,14 +426,25 @@ packages: ieee754: 1.2.1 dev: true - /bufferutil@4.0.7: - resolution: {integrity: sha512-kukuqc39WOHtdxtw4UScxF/WVnMFVSQVKhtx3AjZJzhd0RGZZldcrfSEbVsWWe6KNH253574cq5F+wpv0G9pJw==} + /bufferutil@4.0.8: + resolution: {integrity: sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==} engines: {node: '>=6.14.2'} requiresBuild: true dependencies: node-gyp-build: 4.6.0 dev: true + /call-bind@1.0.7: + resolution: {integrity: sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + set-function-length: 1.2.1 + dev: true + /chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} @@ -504,6 +543,15 @@ packages: resolution: {integrity: sha512-aWS3UIVH+NPGCD1kki+DCU9Dua032iSsO43LqQpcs4R3+dVv7tX0qBGjiVHJHjplsoUM2XRO/KB92glqc68awg==} dev: true + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: true + /delay@5.0.0: resolution: {integrity: sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==} engines: {node: '>=10'} @@ -571,6 +619,18 @@ packages: - utf-8-validate dev: true + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: true + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: true + /es6-promise@4.2.8: resolution: {integrity: sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==} dev: true @@ -626,6 +686,10 @@ packages: resolution: {integrity: sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==} dev: true + /fastestsmallesttextencoderdecoder@1.0.22: + resolution: {integrity: sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==} + dev: true + /file-uri-to-path@1.0.0: resolution: {integrity: sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==} dev: true @@ -655,21 +719,65 @@ packages: resolution: {integrity: sha512-twe20eF1OxVxp/ML/kq2p1uc6KvFK/+vs8WjEbeKmV2He22MKm7YF2ANIt+EOqhJ5L3K/SuuPhk0hWQDjOM23g==} dev: true + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} + dev: true + /get-caller-file@2.0.5: resolution: {integrity: sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==} engines: {node: 6.* || 8.* || >= 10.*} dev: true + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} + dependencies: + es-errors: 1.3.0 + function-bind: 1.1.2 + has-proto: 1.0.1 + has-symbols: 1.0.3 + hasown: 2.0.1 + dev: true + /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} engines: {node: '>=10'} dev: true + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 + dev: true + /has-flag@4.0.0: resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} engines: {node: '>=8'} dev: true + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} + dependencies: + es-define-property: 1.0.0 + dev: true + + /has-proto@1.0.1: + resolution: {integrity: sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==} + engines: {node: '>= 0.4'} + dev: true + + /has-symbols@1.0.3: + resolution: {integrity: sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==} + engines: {node: '>= 0.4'} + dev: true + + /hasown@2.0.1: + resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: true + /human-signals@2.1.0: resolution: {integrity: sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==} engines: {node: '>=10.17.0'} @@ -695,6 +803,10 @@ packages: engines: {node: '>=8'} dev: true + /isarray@2.0.5: + resolution: {integrity: sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw==} + dev: true + /isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} dev: true @@ -744,10 +856,24 @@ packages: resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} dev: true + /json-stable-stringify@1.1.1: + resolution: {integrity: sha512-SU/971Kt5qVQfJpyDveVhQ/vya+5hvrjClFOcr8c0Fq5aODJjMwutrOfCU+eCnVD5gpx1Q3fEqkyom77zH1iIg==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.7 + isarray: 2.0.5 + jsonify: 0.0.1 + object-keys: 1.1.1 + dev: true + /json-stringify-safe@5.0.1: resolution: {integrity: sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==} dev: true + /jsonify@0.0.1: + resolution: {integrity: sha512-2/Ki0GcmuqSrgFyelQq9M05y7PS0mEwuIzrf3f1fPqkVDVRvZrPZtVSMHxdgo8Aq0sxAOb/cr2aqqA3LeWHVPg==} + dev: true + /jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} engines: {'0': node >= 0.2.0} @@ -836,6 +962,7 @@ packages: /node-gyp-build@4.6.0: resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} hasBin: true + requiresBuild: true dev: true /npm-run-path@4.0.1: @@ -869,6 +996,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /object-keys@1.1.1: + resolution: {integrity: sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==} + engines: {node: '>= 0.4'} + dev: true + /onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -924,9 +1056,9 @@ packages: '@babel/runtime': 7.20.13 eventemitter3: 4.0.7 uuid: 8.3.2 - ws: 8.12.1(bufferutil@4.0.7)(utf-8-validate@5.0.10) + ws: 8.12.1(bufferutil@4.0.8)(utf-8-validate@5.0.10) optionalDependencies: - bufferutil: 4.0.7 + bufferutil: 4.0.8 utf-8-validate: 5.0.10 dev: true @@ -954,6 +1086,18 @@ packages: lru-cache: 6.0.0 dev: true + /set-function-length@1.2.1: + resolution: {integrity: sha512-j4t6ccc+VsKwYHso+kElc5neZpjtq9EnRICFZtWyBsLojhmeF/ZBd/elqm22WJh/BziDe/SBiOeAt0m2mfLD0g==} + engines: {node: '>= 0.4'} + dependencies: + define-data-property: 1.1.4 + es-errors: 1.3.0 + function-bind: 1.1.2 + get-intrinsic: 1.2.4 + gopd: 1.0.1 + has-property-descriptors: 1.0.2 + dev: true + /shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -1230,7 +1374,7 @@ packages: optional: true dev: true - /ws@8.12.1(bufferutil@4.0.7)(utf-8-validate@5.0.10): + /ws@8.12.1(bufferutil@4.0.8)(utf-8-validate@5.0.10): resolution: {integrity: sha512-1qo+M9Ba+xNhPB+YTWUlK6M17brTut5EXbcBaMRN5pH5dFrXz7lzz1ChFSUq3bOUl8yEvSenhHmYUNJxFzdJew==} engines: {node: '>=10.0.0'} peerDependencies: @@ -1242,7 +1386,7 @@ packages: utf-8-validate: optional: true dependencies: - bufferutil: 4.0.7 + bufferutil: 4.0.8 utf-8-validate: 5.0.10 dev: true