Skip to content

risechain/porto-rise

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISE Wallet

Next-generation smart contract wallet for Ethereum, built specifically for the RISE chain.

RISE Wallet is a fork of Porto, featuring passkey-based authentication, session keys, and seamless integration with modern web3 applications.

MIT License APACHE License

Features

  • Passkey Authentication: No seed phrases - use biometrics or security keys
  • Session Keys: Gasless transactions for improved UX
  • ERC-7702 Permissions: Granular control over wallet capabilities
  • Wagmi Integration: Drop-in replacement for traditional wallet connectors
  • Multi-platform: Works on web, mobile (React Native), and desktop

Documentation

For comprehensive guides and API reference, visit the RISE Documentation.

Quick Start

Installation

# npm
npm i rise-wallet wagmi viem @tanstack/react-query

# pnpm
pnpm add rise-wallet wagmi viem @tanstack/react-query

# yarn
yarn add rise-wallet wagmi viem @tanstack/react-query

# bun
bun add rise-wallet wagmi viem @tanstack/react-query

Basic Setup

1. Configure the Rise Wallet Connector

import { Chains, RiseWallet } from 'rise-wallet'
import { riseWallet } from 'rise-wallet/wagmi'
import { createConfig, http } from 'wagmi'

// Export the connector for advanced usage
export const rwConnector = riseWallet(RiseWallet.defaultConfig)

// Create wagmi config
export const config = createConfig({
  chains: [Chains.riseTestnet],
  connectors: [rwConnector],
  transports: {
    [Chains.riseTestnet.id]: http('https://testnet.riselabs.xyz'),
  },
})

2. Set Up Providers

'use client'

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { WagmiProvider } from 'wagmi'
import { config } from './config'
import { useState } from 'react'

export function Providers({ children }: { children: React.ReactNode }) {
  const [queryClient] = useState(() => new QueryClient())

  return (
    <WagmiProvider config={config}>
      <QueryClientProvider client={queryClient}>
        {children}
      </QueryClientProvider>
    </WagmiProvider>
  )
}

3. Connect to Wallet

import { useConnect, useConnection, useDisconnect, useConnectors } from 'wagmi'

export function WalletButton() {
  const { address, isConnected } = useConnection()
  const connect = useConnect()
  const disconnect = useDisconnect()
  const connectors = useConnectors()

  if (isConnected) {
    return (
      <div>
        <span>{address}</span>
        <button onClick={() => disconnect.mutate()}>Disconnect</button>
      </div>
    )
  }

  const rwConnector = connectors.find(c => c.id === 'com.risechain.wallet')
  if (!rwConnector) return null

  return (
    <button onClick={() => connect.mutate({ connector: rwConnector })}>
      Connect with Passkey
    </button>
  )
}

Advanced Features

Session Keys

Create session keys for gasless transactions:

import { Hooks } from 'rise-wallet/wagmi'

const grantPermissions = Hooks.useGrantPermissions()

const createSession = async () => {
  await grantPermissions.mutateAsync({
    key: { publicKey: '...', type: 'p256' },
    expiry: Math.floor(Date.now() / 1000) + 3600, // 1 hour
    permissions: {
      calls: [{
        to: '0x...',
        signature: '0x...',
      }],
    },
  })
}

Batched Transactions

import { useSendCalls } from 'wagmi'

const sendCalls = useSendCalls()

await sendCalls.mutateAsync({
  calls: [
    { to: TOKEN_ADDRESS, data: approveCalldata },
    { to: DEX_ADDRESS, data: swapCalldata },
  ],
  atomicRequired: true,
})

Development

Apps

pnpm install # Install dependencies
pnpm dev # Run id, playground, and iframe dialog

Tests

pnpm install # Install dependencies
pnpm test # Test

Contracts

# Install Foundry
foundryup

forge build --config-path ./contracts/account/foundry.toml # Build
forge test --config-path ./contracts/account/foundry.toml # Test

forge build --config-path ./contracts/demo/foundry.toml # Build
forge test --config-path ./contracts/demo/foundry.toml # Test

Resources

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in these packages by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

About

Authentication & payments on the web

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 89.2%
  • MDX 9.3%
  • CSS 0.7%
  • Shell 0.4%
  • Solidity 0.3%
  • HTML 0.1%