SoLibrary
  • Solana
  • The Meme Coin Problem and Solution
  • Developing on Solana
  • From Rust To Deployment
  • Solana Blockchain Explorer
  • Building a Solana dAPP
  • Deploying a Solana dApp
  • Deploying a Solana Memecoin using CLI
  • Solana Smart Contracts
  • Send Solana via javascript functions
  • Candy Machine
  • Pump fun APIs
  • Metaplex
  • Metaplex Program Library
  • Solana Program Library
  • UMI Framework
  • Umi and Web3js Differences
  • Fetching Accounts
  • UMI Helpers
  • HTTP Requests
  • Umi's Interfaces
  • Interface implementations
  • Kinobi
  • UMI Plugins
  • Registering Programs
  • Public keys and Signers
  • Connecting RPCS
  • Serializer
  • Storage
  • Transactions
  • Web 3.JS Adapters
  • Metaplex Umi Plugins
  • Core JS SDK v1.0
  • Local Validator
  • SolScriptions
  • FAQ
  • Initialize
  • Write Inscription Data
  • Fetch
  • Clear
  • Close
  • Authority
  • Sharding
  • Getting Started using JavaScript
  • Getting started using the Inscriptions CLI
  • Core Candy Machine
  • Getting Started using JavaScript
  • Candy Guard
  • Assets
  • Creating a Core Candy Machine
  • Inserting Items
  • Updating The Core Candy Machine
  • Guard Groups
  • Special Guard Instructions
  • Fetching a Core Candy Machine
  • Minting
  • Withdrawing a Core Candy Machine
  • Address Gate Guard
  • Allocation
  • Allowlist Guard
  • Asset Burn Guard
  • Asset Burn Multi
  • Asset Payment Guard
  • Asset Payment Multi
  • Asset Mint Limit
  • Bot Tax Guard
  • End Date Guard
  • Edition
  • Freeze Sol Payment guard
  • Freeze Token Payment Guard
  • Gatekeeper Guard
  • Mint Limit Guard
  • NFT Burn Guard
  • NFT Gate Guard
  • NFT Mint Limit Guard
  • NFT Payment Guard
  • Program Gate Guard
  • Redeemed Amount Guard
  • Sol Fixed Fee Guard
  • Sol Payment Guard
  • Start Date Guard
  • Third Party Signer Guard
  • Token Burn Guard
  • Token Gate Guard
  • Token Payment Guard
  • Token2022 Payment Guard
  • Generating Custom Guard Client for Core Candy Machine
Powered by GitBook
On this page
  • The Context interface
  • The Umi interface

Umi's Interfaces

The core interfaces

PreviousHTTP RequestsNextInterface implementations

Last updated 10 months ago

Umi defines a set of core interfaces that makes it easy to interact with the Solana blockchain. Namely, they are:

  • : An interface representing a wallet that can sign transactions and messages.

  • : An interface to create keypairs, find PDAs and sign/verify messages using the EdDSA algorithm.

  • : An interface representing a Solana RPC client.

  • : An interface allowing us to create and serialize transactions.

  • : An interface allowing us to upload files and get a URI to access them.

  • : An interface allowing us to download files from a given URI.

  • : An interface allowing us to send HTTP requests.

  • : An interface for registering and retrieving programs.

The Context interface

The interfaces above are all defined in a Context interface that can be used to inject them in your code. The Context type is defined as follows:

interface Context {
  downloader: DownloaderInterface;
  eddsa: EddsaInterface;
  http: HttpInterface;
  identity: Signer;
  payer: Signer;
  programs: ProgramRepositoryInterface;
  rpc: RpcInterface;
  transactions: TransactionFactoryInterface;
  uploader: UploaderInterface;
};

As you can see the Signer interface is used twice in the context:

  • Once for the identity which is the signer using your app.

  • Once for the payer which is the signer paying for things like transaction fees and storage fees. Usually this will be the same signer as the identity but separating them offers more flexibility for apps – e.g. in case they wish to abstract some costs from their users to improve the user experience.

The Umi interface

The Umi interface is built on top of this Context interface and simply adds a use method which enables end-users to register plugins. It is defined as follows:

interface Umi extends Context {
  use(plugin: UmiPlugin): Umi;
}

Therefore, end-users can add plugins to their Umi instance like so:

import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
import { walletAdapterIdentity } from '@metaplex-foundation/umi-signer-wallet-adapters';
import { awsUploader } from '@metaplex-foundation/umi-uploader-aws';
import { myProgramRepository } from '../plugins';

const umi = createUmi('https://api.mainnet-beta.solana.com')
  .use(walletAdapterIdentity(...))
  .use(awsUploader(...))
  .use(myProgramRepository());
Signer
EddsaInterface
RpcInterface
TransactionFactoryInterface
UploaderInterface
DownloaderInterface
HttpInterface
ProgramRepositoryInterface