@bonfida/sns-emitter
v0.3.0
Published
This typescript package facilitates interaction with the SNS-warp emitter Solana program. It allows users to send domain information throught the wormhole bridge to any supported chain. The message then needs to be cranked on the destination chain, which
Downloads
27
Readme
Sns-emitter TS bindings
This typescript package facilitates interaction with the SNS-warp emitter Solana program. It allows users to send domain information throught the wormhole bridge to any supported chain. The message then needs to be cranked on the destination chain, which can be done with the sns-warp JS package, or the CLI. This should be achieved directly by the cranking network though.
Usage
import { post, ChainId, Network } from "@bonfida/sns-emitter";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { signAndSendInstructions } from "@bonfida/utils";
async function example(){
let feePayer: Keypair;
const connection = new Connection("https://api.devnet.solana.com");
let [instruction] = await post(
// The target chain.
// Posted information is read from the domain's relevant associated record, in this case the BSC record
ChainId.BSC,
// The target network
Network.Devnet,
// The domain name
"test.sol",
// PublicKey of the feePayer
feePayer.publicKey,
3600,
);
let tx = await signSendInstructions(connection, [], feePayer, [instruction]);
console.log("Posted domain information message to Wormhole with transaction: ", tx);
}