Import Yaci Provider
First, We import YaciProvider
import { YaciProvider } from "@meshsdk/core";
const blockchainProvider = new YaciProvider('<YACI_URL>');
By default, the YaciProvider
will use the default URL, https://yaci-node.meshjs.dev/api/v1/
. If you want to use a custom URL, you can pass it as a parameter.
In this example, we initialize the YaciProvider
and fetch the UTxOs of an address.
You can topup ADA in your wallet by running the following command from devne in order to fetch the UTxOs of an address.
devnet:default>topup addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9 1000
Get UTxOs
Fetch UTxOs of an address. Note: your Yaci devnet must be running.
import { YaciProvider } from "@meshsdk/core";
const blockchainProvider = new YaciProvider('https://yaci-node.meshjs.dev/api/v1/');
const utxos = await blockchainProvider.fetchAddressUTxOs('addr_test1qpvx0sacufuypa2k4sngk7q40zc5c4npl337uusdh64kv0uafhxhu32dys6pvn6wlw8dav6cmp4pmtv7cc3yel9uu0nq93swx9');