Core JS SDK v1.0
Launching the Core JS SDK v1.0 welcomes new improvements to both naming and functionality for devs and end users working with the JS Mpl Core package.
The V1 Milestone!
Major Changes
Plugin Constructor Functions
Though while still present in the code base, the new wrappers allow for plugins to be defined without constructor functions.
Auto Generated Kinobi Functions
JS SDK v1.0
Plugin Data
Plugin data is elevated to the top level instead of nested under the data field in a plugin object.
Auto Generated Kinobi Functions
JS SDK v1.0
Lifecycle Wrapper now Requires Asset Objects
The create/update/transfer/burn now require the full asset/collection objects in order to derive extra accounts (such as external plugin adapter accounts) if any.
Auto Generated Kinobi Functions
JS SDK v1.0
add/removePlugin and add/removeCollectionPlugin automatically figures out and routes to the right ix based on whether external plugin
The Oracle External Plugin
Support for the Oracle External Plugin is live.
New Improved Helpers
The Core JS SDK v1.0 comes with new and improved helper methods that strip away some of the complexity when dealing with Core Assets/Collections and their data.
Fetch Helpers
The new fetch helpers allows you the option to derive the plugins or not from each helper method.
fetchAsset()
Fetches a single Asset.
fetchAssetsByOwner()
Fetches all the Assets of a given owners Address.
fetchAssetsByCollection()
Fetches all the Assets of a given Collection Address.
fetchAssetsByUpdateAuthority()
Fetches all the Assets of a given Collection Address.
Authority Helpers
The Authority helpers allow you to pass in a publicKey
to check with that the address has the authority over certain aspects of the Core ecosystem (Assets, Collections, and Plugins).
hasPluginAddressAuthority()
The hasPluginAddressAuthority()
returns a boolean
value based on whether the plugin passed in its authority set to an Address
type and the pubkey
matches.
hasPluginOwnerAuthority()
The hasPluginOwnerAuthority()
returns a boolean
value based on whether the plugin passed in its authority set to an Owner
type and the pubkey
matches.
hasPluginUpdateAuthority()
The hasPluginUpdateAuthority()
returns a boolean
value based on whether the plugin passed in its authority set to an UpdateAuthority
type and the pubkey
matches.
hasAssetUpdateAuthority()
The hasAssetUpdateAuthority()
returns a boolean
value based on whether the passed in pubkey
holds update authority over the Asset.
hasCollectionUpdateAuthority()
The hasCollectionUpdateAuthority()
returns a boolean
value based on whether the passed in pubkey
holds update authority over the Collection.
Lifecycle Helpers
The Lifecycle Helpers provide a quick and efficient way to check whether an address can perform a certain lifecycle event.
validateTransfer()
Returns a boolean
value on whether the publicKey is eligible to transfer the Asset.
validateBurn()
Returns a boolean
value on whether the publicKey can burn the Asset.
validateUpdate()
Returns a boolean
value on whether the publicKey is eligible to update Asset.
Plugin Helpers
assetPluginKeyFromType()
Convert a plugin type to a key for the asset plugins.
pluginTypeFromAssetPluginKey()
Convert a plugin key to a type.
checkPluginAuthorities()
Check the authority for the given plugin types on an asset.
State Helpers
collectionAddress()
Find the collection address for the given asset if it is part of a collection. Returns either a publicKey | undefined
deriveAssetPlugins()
Derive the asset plugins from the asset and collection. Plugins on the asset take precedence over plugins on the collection.
isFrozen()
Returns a boolean
on whether the Asset is frozen.
Last updated