Skip to content

FetcchX/fetcch-kit

Repository files navigation

fetcch-kit

Introduction

  • Crypto deposits are a serious vulnerability since they entail numerous actions such as selecting an asset, copying the address, manually pasting the address, inputting the deposit amount, and finally depositing. Fetcch kit substitutes this slow paced multi-step deposit with quick secure deposits enabled by links, qr codes and requests directly to ids. Fetcch provides a deposit widget that may be used to receive deposits in a secure manner by centralised exchanges, institutional clients, otc, and so on.

Installation

  • Install via npm:

    npm i @fetcch/kit
  • Install via pnpm:

    pnpm i @fetcch/kit
  • Install via yarn:

    yarn add @fetcch/kit

Usage

  • Acquire Secret Key (contact @sk1122_ on twitter)
  • Creating transaction request
    • Arrange transaction request

      {
          "receiver": "string",
          "payer": "string", //optional
          "actions": [
              {
                  "type": "PAYMENT",
                  "data": {
                      "token": "string",
                      "chain": number,
                      "receiver": "string",
                      "amount": {
                          "amount": "string" // in lowest denominator,
                          "currency": "CRYPTO"
                      }
                  }
              }
          ],
          "message": "string",
          "label": "string"
      }
    • Generate message by making post call to https://staging-api.fetcch.xyz/v1/transaction-request/generate-message

    • Create transaction request by making post call to https://staging-api.fetcch.xyz/v1/transaction-request

    • Detailed guide - https://docs.fetcch.xyz/how-to-integrate/guides/transaction-requests/how-to-create-transaction-request

  • Integrating deposit widget
    • Import FetcchButton component from the package

      import FetcchButton from "@fetcch/kit"
    • Render FetcchButton component and configure it with following params

      • requestId : Id of transaction request created
      • action : Type of operation to be performed
      • name : Label or identifier for the specific use case
      • secretKey : API keys for authenticating request
      return(
             <FetcchButton requestId="" action="" name="" secretKey="" />
            )

Example

"use client"
import FetcchButton from "@fetcch/kit"

export const FButton = (params: { id: string }) => {
    return (
        <FetcchButton requestId={params.id} action="Deposit" name="Fetcch OTC" secretKey={process.env.NEXT_PUBLIC_FETCCH_API_KEY as string} />
    )
}

Untitled

Contributing

API Documentation

Troubleshooting

Demo

Changelog

License

  • Licensed under the MIT License, Copyright © 2023-present Fetcch.

  • See LICENSE for more information.

About

guardrails for depositing crypto

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published