0.2.1 • Published 4 months ago

@bonfida/sns-emitter v0.2.1

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

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);
}
0.2.1

4 months ago

0.1.11

4 months ago

0.1.12

4 months ago

0.1.10

4 months ago

0.2.0

4 months ago

0.1.9

4 months ago

0.1.8

7 months ago

0.1.7

12 months ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago