SDK

Introduction

Welcome to the AIFI (AIFI Network SDK) guide! AIFI is an SDK library developed on Nostr. It facilitates connecting plugin wallets supporting Nostr, executing transactions, and managing orders seamlessly.

Features

  • Connect plugin wallets supporting Nostr

  • Execute transactions

  • Place orders in the market

Support Method List

AIFI

  • getConfig(): Retrieve configuration.

  • getNostrPool(): Get information about the Nostr pool.

AIFI .market

  • listOrder(options): List orders in the market.

  • takeOrder(orderId): Take an order in the market.

  • cancelOrder(orderId): Cancel an order in the market.

  • repairOrder(orderId, amount, price, buyOrSellTokenName, payTokenName): Repair an order in the market.

AIFI .token

  • approve(options): Approve token transfer.

  • transfer(options): Transfer tokens.

  • addAddressBook(options): Add an address to the address book.

  • deposit(options): Deposit tokens.

  • withdraw(options): Withdraw tokens.

AIFI .provider

  • supportedProviderList: Retrieve a list of supported providers.

  • connect(providerName): Connect to a provider.

  • getProvider(providerName): Get information about a provider.

AIFI .utils

  • nip04(): NIP04 utilities.

  • nip19(): NIP19 utilities.

  • generatePrivateKey(): Generate a private key.

  • getPublicKey(privateKey): Get a public key from a private key.

  • getEventHash(event): Get the hash of an event.


Setup

React

Install

Copy

Code

Copy


Node.js

Installation

Copy

Code

Copy

HTML

Copy

Example

Check out examples in the src/tests directory.

Last updated