Tools for developing Nosft clients
npm install nosft-core # or yarn add nosft-core
NodeJs & Browser
const nosftCore = require('nosft-core');
or
const { nosft } = require('nosft-core');
or
import { nosft } = require('nosft-core');
Defaults to mainnet config
const { nosft } = require('nosft-core');
(async () => {
const inscriptions = await nosft.getAddressInscriptions({
address: process.env.BTC_ADDRESS,
offset: 0,
limit: 2,
});
console.log(JSON.stringify(inscriptions, undefined, 4));
})();
If you want to specify your custom configs, you can do so by:
const nosftCore = require('nosft-core');
(async () => {
const { nosft } = nosftCore.configure({ nosftBaseUrl: 'http://localhost:3000/api', network: 'testnet' });
const inscriptions = await nosft.getAddressInscriptions({
address: process.env.BTC_ADDRESS,
offset: 0,
limit: 2,
});
console.log(JSON.stringify(inscriptions, undefined, 4));
})();
const { nosft } = require('nosft-core');
const inscriptions = await nosft.getAddressInscriptions({
address: process.env.BTC_ADDRESS,
offset: 0,
limit: 2,
});
import 'websocket-polyfill'; // only for nodejs/server-side
import { NostrRelay } from 'nosft-core';
(async () => {
const relay = new NostrRelay();
relay.subscribeOrders({
limit: 10,
onOrder: (order) => {
console.log('new order');
console.log(order.id);
},
onEose: () => {
console.log('eose');
},
});
})();
- Install
just
just -l
Public domain.