Zebec
Search…
Initialize treasury objects.
These are the first steps to follow:
npm i @zebec-protocol/treasury
After installing the package. You need to initialize treasury objects. For the initialization need to pass adapter & connection. Use of solana-wallet-adapter (https://github.com/solana-labs/wallet-adapter) is highly recommended.
import { NativeTreasury, TokenTreasury } from "@zebec-protocol/treasury";
import { clusterApiUrl, Connection } from "@solana/web3.js";
export const multisigInit = () => {
const connection = "https://api.mainnet-beta.solana.com";
const adapter = window.solana;
const multisig = new NativeTreasury(adapter, connection);
return multisig;
};
export const multisiginitToken = () => {
const { connection } = new Connection(clusterApiUrl("mainnet-beta"));
const adapter = window.solana;
const multisigtoken = new TokenTreasury(adapter, connection);
return multisigtoken;
};
Copy link