updateTokenImage
Updates the metadata URI (image URL) for an existing token.
Usage
page.tsx
import { useConnection, useWallet } from "@solana/wallet-adapter-react";
import { updateTokenImage } from "@okito/sdk";
const {connection} = useConnection();
const wallet = useWallet();
const mintAddress = ""; // Token mint address
const newImageUrl = ""; // New image URL
const result = await updateTokenImage(wallet, connection, mintAddress, newImageUrl, {
enableLogging: true,
maxRetries: 3,
confirmationStrategy: 'confirmed'
});
Parameters
Name | Type | Default |
---|---|---|
connection | Connection Solana connection instance. |
|
wallet | SignerWallet Wallet with authority to update metadata. |
|
mint | string Token mint address. |
|
newImageUrl | string New image URL to set as the token URI. |
|
config | OperationConfig General options such as logging, retries, timeouts, and confirmation level. |
|
Response
Returns OperationResult.
Name | Type | Default |
---|---|---|
success | boolean Whether the update succeeded. |
|
mintAddress | string | null Mint address for reference. |
|
transactionId | string | null Signature of the update transaction. |
|
error | string | null Error message if any. |
|
estimatedFee | number | null Estimated fee (if available). |
|
actualFee | number | null Actual network fee (if available). |
|
confirmationTime | number | null Time to confirm in ms. |
|
Last updated on