goodrdotfun-sdk
Version:
SDK for interacting with goodr.fun and Sonic on Solana
40 lines (39 loc) • 1.75 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMemeDonationDestinationFromName = exports.getMemeDonationDestinationFromId = exports.MEME_DONATION_DESTINATIONS = exports.MemeDonationDestinationName = void 0;
const web3_js_1 = require("@solana/web3.js");
var MemeDonationDestinationName;
(function (MemeDonationDestinationName) {
MemeDonationDestinationName["FarmMeme"] = "Farm Meme";
MemeDonationDestinationName["OGMeme"] = "OG Meme";
})(MemeDonationDestinationName || (exports.MemeDonationDestinationName = MemeDonationDestinationName = {}));
exports.MEME_DONATION_DESTINATIONS = {
17: {
id: 17,
name: MemeDonationDestinationName.FarmMeme,
donationAmount: 308000000,
address: new web3_js_1.PublicKey('66R8vBGPgzBLw2PRb8cYyN3UqjbZDCvHNApsmWaciCid'),
},
18: {
id: 18,
name: MemeDonationDestinationName.OGMeme,
donationAmount: 0,
address: new web3_js_1.PublicKey('66R8vBGPgzBLw2PRb8cYyN3UqjbZDCvHNApsmWaciCid'),
},
};
const getMemeDonationDestinationFromId = (id) => {
const destination = exports.MEME_DONATION_DESTINATIONS[id];
if (!destination) {
throw new Error(`Meme donation destination not found: ${id}`);
}
return destination;
};
exports.getMemeDonationDestinationFromId = getMemeDonationDestinationFromId;
const getMemeDonationDestinationFromName = (name) => {
const destination = Object.values(exports.MEME_DONATION_DESTINATIONS).find(destination => destination.name === name);
if (!destination) {
throw new Error(`Meme donation destination not found: ${name}`);
}
return destination;
};
exports.getMemeDonationDestinationFromName = getMemeDonationDestinationFromName;