Ramper Documentation
  • 🌟WELCOME
  • πŸ‘¨β€πŸ’»Developer Guide
    • Developer Dashboard
  • πŸ”EMBEDDED WALLET SDK
    • Quickstart
      • For Web Apps
        • Multichain Supported
          • Wallet Integration
          • Approve NFT
          • Approve Token
          • Sign Typed
        • Get Started on Viction
      • For Unity Apps
      • For Telegram Mini Apps
        • Set up Telegram bot
        • Implement Ramper Telegram SDK
      • For React Native Apps
        • Installation
        • Getting Started
        • Wallet Integration
        • Sign Typed
        • Approve
    • Terms & Conditions
    • Privacy Policy
  • πŸ’œRAMPER WALLET
    • About Ramper Wallet
    • πŸ“–User Guides
      • Authentication
      • How to send NFTs
      • How to sign in to a new account
      • Wallet settings
      • How to Send & Receive tokens
      • How to add custom tokens
      • Manage Tokens
      • General settings
      • How to send assets via email
      • How to use Vault
      • How to send assets via OneID
      • How to migrate accounts from Old version to New version
    • ❓User FAQs
      • Which networks are supported on Ramper?
      • What social accounts can I use to log in to Ramper?
      • What is the difference between a Password and a Passphrase?
      • Zero-gas transactions
      • Does Ramper hold my funds?
      • Can I import my wallet from Ramper to another Web3 wallet?
      • Can I import my wallet to Ramper?
      • Why can't I see my assets?
      • What is gas fee?
      • Can I get my assets back if I send them to the wrong addresses?
      • I forgot the password of my social accounts. How can I access my funds on Ramper?
      • What happens if my social account is compromised?
      • Can I recover my wallet if I lose my social account?
      • Can I change the email that is associated with my wallet address?
      • I can't find the answer to my question. How can I get support?
      • What is a Protected Account?
      • I forgot the PIN code to log in to Ramper Wallet. How can I access my funds?
      • Which email domains are blocked?
    • Ramper Wallet (Extension) Integration
      • EVM Dapp Integration
      • Sei Dapp Integration
    • Privacy Policy
    • Terms of Service
  • πŸ’ΈNFT CHECKOUT SDK
    • About Ramper NFT Checkout
    • Get Started on EVM
    • Get Started on NEAR
    • Setting Up Your Collection
    • Moving Your Collection to Production
    • Purchase History
    • Terms of Service
    • Privacy Policy
  • Import
Powered by GitBook
On this page
  • To detect Ramper Wallet Extension with Cosmos Base Chain
  • To connect Ramper Wallet Extension
  • To disconnect the Ramper Wallet Extension
  • To experience functions
  • Sign Amino:
  • Sign Direct:
  • Sign Arbitrary:
  • Delegate Transaction broadcasting:
  • To handle events
  1. RAMPER WALLET
  2. Ramper Wallet (Extension) Integration

Sei Dapp Integration

Welcome to Ramper Wallet Extension Developer Guide. This documentation contains guides for developers to get started developing on Ramper Wallet Extension.β€Œ

To detect Ramper Wallet Extension with Cosmos Base Chain

To detect whether your browser is running Ramper Extension, please use:

if (window.ramper2) {
  console.log('Ramper Extension is installed!');
}

To connect Ramper Wallet Extension

To connect Ramper Wallet Extension means to access the user's [blockchain - like Cosmos] account(s).

// Connect only
window.ramper2.cosmos.enable(chainId: string);
// Connect & get accounts
window.ramper2.cosmos.getKey(chainId: string);

Currently, chains support: ['atlantic-2','pacific-1']

To disconnect the Ramper Wallet Extension

To disconnect Ramper Extension, please use:

window.ramper2.cosmos.disconnect();

To experience functions

Once your account is connected, let's start experiencing more functions.β€Œ

Get Current Account

If the webpage has permission and Ramper wallet is unlocked, this function will return the address and public key in the following format:

interface Key {
  name: string;
  algo: string;
  pubKey: Uint8Array;
  address: Uint8Array;
  bech32Address: string;
  isNanoLedger: boolean;
}

window.ramper2.cosmos.getKey(chainId: string): Promise<Key>

Sign Amino:

Like signAmino method of CosmJS OfflineDirectSigner, however, Ramper’s signAmino function takes the chain-id as a required parameter. Signs Proto-encoded StdSignDoc.

interface SignOptions {
 // If set to true the wallet will not override fees specified in the signDoc.
  preferNoSetFee: boolean
}  

window.ramper2.cosmos.signAmino(chainId: string, signer: string, signDoc: StdSignDoc, signOptions?: SignOptions)

Sign Direct:

Like signDirect method of CosmJS OfflineDirectSigner, however, Ramper’s signDirect function takes the chain-id as a required parameter. Signs Proto-encoded StdSignDoc.

interface SignDoc {
  bodyBytes?: Uint8Array | null;
  authInfoBytes?: Uint8Array | null;
  chainId?: string | null;
  accountNumber?: Long | null;
} 

window.ramper2.cosmos.signDirect(chainId: string, signer: string, signDoc: SignDoc)

Sign Arbitrary:

signArbitrary(
    chainId: string,
    signerAddress: string,
    data: string | Uint8Array
): Promise<StdSignature>;

 window.ramper2.cosmos.signArbitrary(chainId: string, signer: string, data: string)

Delegate Transaction broadcasting:

enum BroadcastMode {
  Sync = 'sync',
  Async = 'async',
  Block = 'block'
}

 window.ramper2.cosmos.sendTx(chainId: string, tx: Uint8Array, mode: BroadcastMode)

To handle events

List of events

Currently, we only support some action events from the wallet extension

connection.on('event_name', callback);
​//Example
window.ramper2.cosmos.on('cosmosChanged', () => window.location.reload());
window.ramper2.cosmos.on('accountsChanged', () => window.location.reload());

Events

Trigger

accountsChanged

Receive when active account changed in Extension

cosmosChanged

Receive when active chain changed in Extension

Method

Description

Method

Description

on(event, callback)

Add event listener

off(event, callback)

Remove event listener

PreviousEVM Dapp IntegrationNextPrivacy Policy

Last updated 1 year ago

πŸ’œ