Etherspot
These are our V1 docs and will be deprecated soon. Please visit https://etherspot.fyi/introduction to use our new version of the SDK.
  • Welcome to Etherspot
    • Chains, Bridges & DEXes
    • Social Logins
    • Web3 Logins
  • Transaction Kit
    • Introduction
    • Code Sandboxes
    • Quick Start
    • React Hooks
      • useEtherspotAssets()
      • useEtherspotNfts()
      • useEtherspotHistory()
        • getAccountTransactions()
        • getAccountTransaction()
      • useEtherspotTransactions()
        • estimate()
        • send()
      • useEtherspotAddresses()
      • useEtherspotBalances()
    • React Components
      • <EtherspotTransactionKit />
      • <EtherspotBatches />
      • <EtherspotBatch />
      • <EtherspotTransaction />
      • <EtherspotContractTransaction />
      • <EtherspotApprovalTransaction />
      • <EtherspotTokenTransferTransaction />
  • BUIDLER React Component
    • Introduction
    • Installation
    • Integrate React Component
    • Shared Sessions
    • Wallet Connectors
    • Blocks
      • Send
      • Batching Transaction
      • Multicall Transaction
      • Swaps
      • Bridges
      • Custom Contract Interactions
      • Styling
    • Build Your Own Block
      • Cross-chain KLIMA DAO Staking
  • Etherspot SDK Guides
    • Requirements
    • Install Etherspot SDK
    • Bootstrap Etherspot SDK
      • Instantiate Etherspot SDK
    • Events
    • Etherspot Block Explorer
    • Etherspot Playground
    • Social Login using Etherspot SDK
    • Sponsored Transactions
  • Use Cases & Guides
    • Crosschain Streaming
    • Token Swaps
    • Transactions
      • Historical
      • Sending
    • Multi-chain Bridges
      • ERC20 Bridge
      • DAI - xDai Bridge
      • xDai - DAI Bridge
      • Native Token Bridge
    • Custom Contract Interaction
    • Multi-chain Assets
    • Multi-chain Gas Prices
    • Peer-to-Peer Payments
  • Reference
    • Etherspot SDK API Docs
    • Etherspot SDK on Github
    • Etherspot on NPM
    • Etherspot Playground
    • Etherspot Block Explorer
    • Etherspot Architecture
    • EIP-1271
    • Etherspot/Pillar Audit
  • Brand Assets
    • Etherspot Brand Assets
  • Security
    • Security
  • Get in touch
    • ⚒️Discord
    • Twitter
    • Telegram
Powered by GitBook
On this page
  • Create an instance of the Etherspot SDK
  • Create a session
  • Get your Etherspot Ethereum address

Was this helpful?

  1. Etherspot SDK Guides

Bootstrap Etherspot SDK

The bare minimum to get you started.

PreviousInstall Etherspot SDKNextInstantiate Etherspot SDK

Last updated 2 years ago

Was this helpful?

Before you continue, please make sure you've checked the and performed the steps to .

As a bare minimum to use Etherspot, we recommend that you implement the following steps within your application.

Create an instance of the Etherspot SDK

This is where it all begins. You can check which EVM chains are supported on our . Then you can take a look at to instantiate the SDK on one or multiple chains.

For the purposes of this guide, we're going to stick with Ethereum Mainnet.

Create a session

Next up, we create a session with our newly instantiated Etherspot SDK. This is useful for when you would like to authenticate / validate external clients with the Etherspot SDK instance.

import { Sdk } from 'etherspot';

const sdk: Sdk; // current sdk instance

async function main() {
  const output = await sdk.createSession();

  console.log('session object', output);
  console.log('session graphql headers', {
    ['x-auth-token']: output.token,
  });
}

Get your Etherspot Ethereum address

The next step is to get your Ethereum address from your Etherspot SDK.

import { Sdk } from 'etherspot';

const sdk: Sdk; // current sdk instance

async function main() {
  const output = await sdk.computeContractAccount();

  console.log('contract account', output);
}

Running the above code results in the following output:

{
  "address": "0x2f95595d9Bca08bA59110adF5e823c94955d82BB",
  "type": "Contract",
  "state": "UnDeployed",
  "store": "PersonalAccountRegistry",
  "createdAt": "[Date] 2021-07-10 00:10:26",
  "updatedAt": "[Date] 2021-07-10 00:10:26",
  "synchronizedAt": "[Date] 2021-07-10 00:10:24"
}

The output above shows the Etherspot service returning the state of your Etherspot SDK instance.

Key

Meaning

address

The Ethereum address that is assigned to your SDK instance.

type

This should only be Contract - and signals that this account is controlled by a Smart Contract.

state

Is either UnDeployed or Deployed.

store

Where this data is being stored. If you're using the hosted version of Etherspot, you can disregard this.

Providing that you use the same private key for each SDK instance against different chains, you will always get back the same Ethereum address. This means that your Ethereum address is the same across all chains. This is by design for convenience.

You're now ready to start building something with the Etherspot SDK! Why not take a look at the use cases from the navigation menu?

Here are some helpful links:

Got an idea? Prototype it now on the

Learn how to work with

🚏
Requirements
Install Etherspot SDK
Chains, Bridges & DEXes page
Instantiate Etherspot SDK
Etherspot Playground
Multi-chain Transactions