UNPKG

@unique.vc/udm.js

Version:

UDM - Unique Delegation Manager is a simple yet efficient solution allowing to bridge self-custody and user experience, have best from both worlds and potentially extend the reach of the industry.

16 lines (15 loc) 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.programFactory = exports.authorizeSeed = exports.SOLANA_PROGRAM_ID = void 0; const web3_js_1 = require("@solana/web3.js"); const provider_1 = require("@project-serum/anchor/dist/cjs/provider"); const buffer_1 = require("buffer"); const anchor_1 = require("@project-serum/anchor"); const udm_idl_1 = require("../idl/udm-idl"); const utils_1 = require("./utils"); exports.SOLANA_PROGRAM_ID = new web3_js_1.PublicKey('UPLdquGEBVnVK5TmccSue5gyPkxSRT4poezHShoEzg8'); exports.authorizeSeed = buffer_1.Buffer.from('authorize'); const programFactory = (connection, wallet, confirmOptions) => { return new anchor_1.Program(udm_idl_1.IDL, exports.SOLANA_PROGRAM_ID, new provider_1.AnchorProvider(connection, wallet !== null && wallet !== void 0 ? wallet : (0, utils_1.emptyWallet)(web3_js_1.Keypair.generate().publicKey), confirmOptions !== null && confirmOptions !== void 0 ? confirmOptions : {})); }; exports.programFactory = programFactory;