Management API Reference

Ecosystem wallet

Craft and customize your wallet

The Fort ecosystem wallets come with a default set of screens for authentication, session key confirmation, sign typed message, configuration, and transaction confirmation. These screens are designed to be customizable to fit your brand and user experience. Openfort provides helpers to the most popular frameworks to make it easier to integrate the ecosystem wallets.

The default Client SDK expects the following routes to exist in your wallet UI:

RouteDescription
/sign/personal-signpersonal_sign
/sign/eth-sign-typed-data-v-4eth_signTypedData_v4
/sign/eth-send-transactioneth_signTransaction
/sign/eth-register-sessionwallet_grantPermissions
/sign/loadingLoading screen
ecosystem-architecture

React SDK#

When adding the React components to your App, there are two places where the components can be customized. All but one of the theme customizations options are passed through to the Fort Tailwind plugin in your tailwind.config.js file.

In your wallet UI project, after intalling the @openfort/ecosystem-js package to get started with the React SDK. It will be then available from @openfort/ecosystem-js/react.

You can check all the available components in the React SDK reference.

Colors#

UI-customization

The available colors are:

Background colors

  • bg000 - Lightest background color
  • bg100 - Light background color
  • bg200 - Medium background color

Border colors

  • border - The color of borders

Button colors

  • btnPrimary - The color of the primary button
  • btnPrimaryText - The text color for the primary button
  • btnPrimaryHover - The hover color for the primary button
  • btnSecondary - The color of the secondary button
  • btnSecondaryText - The text color for the secondary button
  • btnSecondaryHover - The hover color for the secondary button

Text colors

  • title - The color for title text
  • text - The main text color
  • textSubtle - The color for subtle or secondary text

Status colors

  • info - The color for informational elements
  • success - The color for success messages or indicators
  • warning - The color for warning messages or indicators
  • error - The color for error messages or indicators
  • critical - The color for critical messages or indicators

These color variables can be used to customize various elements of the UI as shown in the image. For example, the main content area uses bg200, while the outer container uses bg100. Text elements use title, text, and textSubtle accordingly.

The button styles (btnPrimary, btnSecondary, etc.) are applied to the "Approve" and "Deny" buttons at the bottom of the UI.

Core SDK#

The Core SDK is the package that you will use to receive and send communication with the Client SDK. This package includes all the necessary functionality in order to onboard your users to blockchain with non-custodial wallets.

main.ts

_21
import { Core, MethodType } from "@openfort/ecosystem-js/core";
_21
_21
// Create a new instance of the Core SDK
_21
const core = new Core({
_21
embeddedWalletConfig: {
_21
baseConfiguration: {
_21
publishableKey: "YOUR_OPENFORT_PUBLISHABLE_KEY",
_21
},
_21
shieldConfiguration: {
_21
shieldPublishableKey: 'YOUR_SHIELD_PUBLISHABLE_KEY'
_21
}
_21
}
_21
});
_21
_21
// instantiate the event listener
_21
const evhl = core.eventsHandler;
_21
_21
evhl.subscribe(MethodType.ACCOUNTS_REQUEST, (data) => {
_21
console.log("Event received", data);
_21
})
_21
evhl.listen();

This are the available Method Types that will be sent from the Client SDK and that you can subscribe to:

MethodType
TRANSACTION_REQUEST'eth_signTransaction'
TYPED_MESSAGE_REQUEST'eth_signTypedData_v4'
MESSAGE_REQUEST'personal_sign'
SESSION_KEY_REQUEST'wallet_grantPermissions'
ACCOUNTS_REQUEST'eth_requestAccounts'

You can check all the available components in the Core SDK reference. You can react to receiving this events by subscribing to them and executing the necessary logic in your app, like rendering a confirmation screen or sending the transaction to the blockchain.