UNPKG

@wormhole-foundation/sdk-solana-cctp

Version:

SDK for Solana, used in conjunction with @wormhole-foundation/sdk

17 lines 1.03 kB
import { PublicKey } from '@solana/web3.js'; import { Program } from '@coral-xyz/anchor'; import { utils } from '@wormhole-foundation/sdk-solana'; import { idl } from './../index.js'; export function createTokenMessengerProgramInterface(programId, provider) { return new Program(idl.TokenMessengerIdl, new PublicKey(programId), provider === undefined ? { connection: null } : provider); } export function createReadOnlyTokenMessengerProgramInterface(programId, connection) { return createTokenMessengerProgramInterface(programId, utils.createReadOnlyProvider(connection)); } export function createMessageTransmitterProgramInterface(programId, provider) { return new Program(idl.MessageTransmitterIdl, new PublicKey(programId), provider === undefined ? { connection: null } : provider); } export function createReadOnlyMessageTransmitterProgramInterface(programId, connection) { return createMessageTransmitterProgramInterface(programId, utils.createReadOnlyProvider(connection)); } //# sourceMappingURL=program.js.map