Constructors
constructor
- new AssetMintingLib(programId: PublicKey, connection: Connection, wallet: Wallet): AssetMintingLib
Parameters
programId: PublicKey
connection: Connection
wallet: Wallet
Properties
connection
connection: Connection
program
Methods
addAssetEventListener
- addAssetEventListener(callback: ((event: AssetEvent) => void)): number
Parameters
Returns number
addCollectionEventListener
- addCollectionEventListener(callback: ((event: CollectionEvent) => void)): number
Parameters
Returns number
addFeePayerAndRecentBlockHashInTransaction
- addFeePayerAndRecentBlockHashInTransaction(tx: Transaction, feePayer: PublicKey): Promise<Transaction>
Parameters
tx: Transaction
feePayer: PublicKey
Returns Promise<Transaction>
addMintEventListener
- addMintEventListener(callback: ((event: MintEvent) => void)): number
Parameters
Returns number
addSignatureInTransaction
- addSignatureInTransaction(tx: Transaction, signerAddress: PublicKey, signature: Buffer): Transaction
Parameters
tx: Transaction
signerAddress: PublicKey
signature: Buffer
Returns Transaction
addSubCollectionEventListener
Parameters
Returns number
createAndAddCreatorSignMetadataInstruction
- createAndAddCreatorSignMetadataInstruction(tx: Transaction, uuid: string, creatorPublicKey: PublicKey, mplProgram?: PublicKey): Promise<Transaction>
Parameters
tx: Transaction
uuid: string
creatorPublicKey: PublicKey
mplProgram: PublicKey = METADATA_PROGRAM_ID
Returns Promise<Transaction>
createAssetTokenTransaction
- createAssetTokenTransaction(assetUuid: string, collectionUuid: string, payer: PublicKey, signingAuthority: PublicKey, user: PublicKey, assetMintAuthority: PublicKey, tokenName: string, tokenSymbol: string, tokenUrl: string, tokenIsMutable: boolean, tokenSellerPoint: number, creators: CreatorType[], configName?: string, collectionUpdateAuthority?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey, associatedTokenProgram?: PublicKey, tokenProgram?: PublicKey, mplProgram?: PublicKey): Promise<Transaction>
Parameters
assetUuid: string
collectionUuid: string
payer: PublicKey
signingAuthority: PublicKey
user: PublicKey
assetMintAuthority: PublicKey
tokenName: string
tokenSymbol: string
tokenUrl: string
tokenIsMutable: boolean
tokenSellerPoint: number
configName: string = NAME
collectionUpdateAuthority: PublicKey = signingAuthority
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
mplProgram: PublicKey = METADATA_PROGRAM_ID
Returns Promise<Transaction>
createCollectionTokenTransaction
- createCollectionTokenTransaction(collectionUuid: string, payer: PublicKey, signingAuthority: PublicKey, collectionMintAuthority: PublicKey, collectionOwner: PublicKey, tokenName: string, tokenSymbol: string, tokenUrl: string, tokenIsMutable: boolean, tokenSellerPoint: number, creators: CreatorType[], configName?: string, systemProgram?: PublicKey, rent?: PublicKey, associatedTokenProgram?: PublicKey, tokenProgram?: PublicKey, mplProgram?: PublicKey): Promise<Transaction>
Parameters
collectionUuid: string
payer: PublicKey
signingAuthority: PublicKey
collectionMintAuthority: PublicKey
collectionOwner: PublicKey
tokenName: string
tokenSymbol: string
tokenUrl: string
tokenIsMutable: boolean
tokenSellerPoint: number
configName: string = NAME
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
mplProgram: PublicKey = METADATA_PROGRAM_ID
Returns Promise<Transaction>
createInitializeConfigTransaction
- createInitializeConfigTransaction(payer: PublicKey, signingAuthority: PublicKey, configName?: string, systemProgram?: PublicKey, rent?: PublicKey): Promise<Transaction>
Parameters
payer: PublicKey
signingAuthority: PublicKey
configName: string = NAME
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
Returns Promise<Transaction>
createMintTokenTransaction
- createMintTokenTransaction(assetUuid: string, payer: PublicKey, signingAuthority: PublicKey, mintAuthority: PublicKey, configName?: string, systemProgram?: PublicKey, rent?: PublicKey, associatedTokenProgram?: PublicKey, tokenProgram?: PublicKey): Promise<Transaction>
Parameters
assetUuid: string
payer: PublicKey
signingAuthority: PublicKey
mintAuthority: PublicKey
configName: string = NAME
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
Returns Promise<Transaction>
createSubCollectionTokenTransaction
- createSubCollectionTokenTransaction(collectionUuid: string, subCollectionUuid: string, payer: PublicKey, signingAuthority: PublicKey, subCollectionMintAuthority: PublicKey, subCollectionOwner: PublicKey, tokenName: string, tokenSymbol: string, tokenUrl: string, tokenIsMutable: boolean, tokenSellerPoint: number, creators: CreatorType[], configName?: string, collectionUpdateAuthority?: PublicKey, systemProgram?: PublicKey, rent?: PublicKey, associatedTokenProgram?: PublicKey, tokenProgram?: PublicKey, mplProgram?: PublicKey): Promise<Transaction>
Parameters
collectionUuid: string
subCollectionUuid: string
payer: PublicKey
signingAuthority: PublicKey
subCollectionMintAuthority: PublicKey
subCollectionOwner: PublicKey
tokenName: string
tokenSymbol: string
tokenUrl: string
tokenIsMutable: boolean
tokenSellerPoint: number
configName: string = NAME
collectionUpdateAuthority: PublicKey = signingAuthority
systemProgram: PublicKey = SystemProgram.programId
rent: PublicKey = SYSVAR_RENT_PUBKEY
associatedTokenProgram: PublicKey = ASSOCIATED_TOKEN_PROGRAM_ID
tokenProgram: PublicKey = TOKEN_PROGRAM_ID
mplProgram: PublicKey = METADATA_PROGRAM_ID
Returns Promise<Transaction>
creatorSignMetadataInstruction
- creatorSignMetadataInstruction(uuid: string, creatorPublicKey: PublicKey, mplProgram?: PublicKey): Promise<TransactionInstruction>
Parameters
uuid: string
creatorPublicKey: PublicKey
mplProgram: PublicKey = METADATA_PROGRAM_ID
Returns Promise<TransactionInstruction>
getConfigAccountData
- getConfigAccountData(configAccountPda: PublicKey): Promise<any>
Parameters
configAccountPda: PublicKey
Returns Promise<any>
getConfigAccountPdaAndBump
- getConfigAccountPdaAndBump(name?: String): Promise<[PublicKey, number]>
Parameters
Returns Promise<[PublicKey, number]>
getCurrentBlockTime
- getCurrentBlockTime(): Promise<BN>
Returns Promise<BN>
getMasterEditionAccountPda
- getMasterEditionAccountPda(mintAccountPda: PublicKey, mplProgramId?: PublicKey): Promise<[PublicKey, number]>
Parameters
mintAccountPda: PublicKey
mplProgramId: PublicKey = METADATA_PROGRAM_ID
Returns Promise<[PublicKey, number]>
getMetadataAccountPda
- getMetadataAccountPda(mintAccountPda: PublicKey, mplProgramId?: PublicKey): Promise<[PublicKey, number]>
Parameters
mintAccountPda: PublicKey
mplProgramId: PublicKey = METADATA_PROGRAM_ID
Returns Promise<[PublicKey, number]>
getMintAccountPdaAndBump
- getMintAccountPdaAndBump(uuid: String): Promise<[PublicKey, number]>
Parameters
Returns Promise<[PublicKey, number]>
isPdaAddressInitialize
- isPdaAddressInitialize(pdaAddress: PublicKey): Promise<boolean>
Parameters
Returns Promise<boolean>
removeEventListener
- removeEventListener(eventId: number): Promise<void>
Parameters
Returns Promise<void>
signTransaction
- signTransaction(tx: Transaction, secretKey: string): Transaction
Parameters
tx: Transaction
secretKey: string
Returns Transaction
Add asset event listener.