### Install Coin98 Connect SDK (Bash) Source: https://docs.coin98.com/developer-guide/coin98-connect-integration Installs the Coin98 Connect SDK package using npm. This is the first step to integrate Coin98 Connect into your DApp. ```bash npm install --save @coin98-com/connect-sdk ``` -------------------------------- ### Next.js Setup with Terra Templates Source: https://docs.coin98.com/developer-guide/terra-dapps-integration/terra-station-override Installs a new Next.js project using the wallet-provider template via the terra-templates CLI. Includes steps for project creation, dependency installation, and starting the development server. ```bash npx terra-templates get wallet-provider:next your-app-name cd your-app-name yarn install yarn run dev ``` -------------------------------- ### Install Supported Wallet Packages Source: https://docs.coin98.com/developer-guide/coin98-adapter Installs adapter packages for specific wallets, such as Coin98 Wallet and MetaMask. This step is necessary to enable connections with these particular wallet providers within your Dapp. ```bash npm install \ @coin98-com/wallet-adapter-coin98 \ @coin98-com/wallet-adapter-metamask ``` -------------------------------- ### Create React App Setup with Terra Templates Source: https://docs.coin98.com/developer-guide/terra-dapps-integration/terra-station-override Installs a new React project using the wallet-provider template via the terra-templates CLI. Includes steps for project creation, dependency installation, and starting the development server. ```bash npx terra-templates get wallet-provider:create-react-app your-app-name cd your-app-name yarn install yarn start ``` -------------------------------- ### Install Coin98 Adapter Core Packages Source: https://docs.coin98.com/developer-guide/coin98-adapter Installs the essential React packages for the Coin98 Adapter. These packages provide the core functionality for connecting your Dapp to the Coin98 Wallet and other supported wallets. ```bash npm install \ @coin98-com/wallet-adapter-react \ @coin98-com/wallet-adapter-react-ui ``` -------------------------------- ### Get NEAR Account State via Coin98 (TypeScript) Source: https://docs.coin98.com/developer-guide/coin98-connect-integration Example for retrieving NEAR account state using Coin98 Connect. It calls the `near_accountState` method. ```typescript const getNearAccountState = async () => { try { const result = await window.coin98.near.request({ method: 'near_accountState', }) const ressultAccState = get(result, 'result') || result return ressultAccState } catch (err) { console.log({ err }) } } ``` -------------------------------- ### TypeScript Setup for Coin98 Types Source: https://docs.coin98.com/developer-guide/osmosis-dapps-integration/keplr-override/basic-api Explains how to set up TypeScript for Coin98 integration by installing the `@keplr-wallet/types` package and augmenting the global `Window` interface to include Keplr-related types. ```typescript import { Window as KeplrWindow } from "@keplr-wallet/types"; declare global { // eslint-disable-next-line @typescript-eslint/no-empty-interface interface Window extends KeplrWindow {} } ``` -------------------------------- ### Coin98 Wallet UI Interaction Source: https://docs.coin98.com/developer-guide/coin98-adapter/hooks/usewallet Method to trigger the wallet's install request modal. ```APIDOC requestInstall(value: boolean) => void; - Description: Show the install wallet request modal. - Parameters: - value: A boolean indicating whether to show the modal. ``` -------------------------------- ### ETH Sign Example Source: https://docs.coin98.com/developer-guide/coin98-adapter/example Demonstrates signing a message using the `ethSign` function, which is a standard method for signing arbitrary data with an Ethereum account. ```javascript (async () => { const result = await ethSign(message); })(); ``` -------------------------------- ### Get Encryption Public Key Example Source: https://docs.coin98.com/developer-guide/viction-dapps-integration Provides an example of retrieving the public encryption key for a given Ethereum account. This key is necessary for encrypting messages intended for that account. ```javascript let encryptionPublicKey; window.ethereum.request({ method: 'eth_getEncryptionPublicKey', params: [accounts[0]] // you must have access to the specified account }) .then((result) => { encryptionPublicKey = result; console.log('Encryption public key:', encryptionPublicKey); }) .catch((error) => { if (error.code === 4001) { // EIP-1193 userRejectedRequest error console.log("We can't encrypt anything without the key."); } else { console.error(error); } }); ``` -------------------------------- ### Sign Message Example Source: https://docs.coin98.com/developer-guide/coin98-adapter/example Illustrates how to sign a simple string message using the `signMessage` function. This is commonly used for authentication or proving ownership of an account. ```javascript (async () => { const result = await signMessage('Coin98 Adapter'); })(); ```