Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@orca-so/sdk

Package Overview
Dependencies
Maintainers
2
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orca-so/sdk - npm Package Compare versions

Comparing version 1.0.4 to 1.1.0

dist/constants/tokens.d.ts

33

dist/constants/pools.d.ts
import { OrcaPoolParams } from "../model/orca/pool/pool-types";
import { OrcaPoolConfig } from "../public/pools/config";
import { OrcaToken } from "../public/pools/types";
/**
* Constants
* TODO: Generate these from collectibles.json
* The following content is auto-generated.
*/
export declare const solToken: OrcaToken;
export declare const ethToken: OrcaToken;
export declare const rayToken: OrcaToken;
export declare const usdcToken: OrcaToken;
export declare const usdtToken: OrcaToken;
export declare const solUsdcPool: OrcaPoolParams;
export declare const solUsdtPool: OrcaPoolParams;
export declare const raySolPool: OrcaPoolParams;
export declare const ethSolPool: OrcaPoolParams;
export declare const ethUsdcPool: OrcaPoolParams;
export declare const orcaPoolConfigs: Record<OrcaPoolConfig, OrcaPoolParams>;
export declare const raySolPool: OrcaPoolParams;
export declare const ropeSolPool: OrcaPoolParams;
export declare const stepSolPool: OrcaPoolParams;
export declare const srmSolPool: OrcaPoolParams;
export declare const fttSolPool: OrcaPoolParams;
export declare const copeSolPool: OrcaPoolParams;
export declare const oxySolPool: OrcaPoolParams;
export declare const btcSolPool: OrcaPoolParams;
export declare const merSolPool: OrcaPoolParams;
export declare const fidaSolPool: OrcaPoolParams;
export declare const mapsSolPool: OrcaPoolParams;
export declare const orcaSolPool: OrcaPoolParams;
export declare const orcaUsdcPool: OrcaPoolParams;
export declare const kinSolPool: OrcaPoolParams;
export declare const samoSolPool: OrcaPoolParams;
export declare const liqUsdcPool: OrcaPoolParams;
/**
* Mapping for OrcaPool parameters
* Key: poolTokenMint : OrcaPoolParams
*/
export declare const orcaPoolConfigs: Record<string, OrcaPoolParams>;
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.orcaPoolConfigs = exports.ethUsdcPool = exports.ethSolPool = exports.raySolPool = exports.solUsdtPool = exports.solUsdcPool = exports.usdtToken = exports.usdcToken = exports.rayToken = exports.ethToken = exports.solToken = void 0;
exports.orcaPoolConfigs = exports.liqUsdcPool = exports.samoSolPool = exports.kinSolPool = exports.orcaUsdcPool = exports.orcaSolPool = exports.mapsSolPool = exports.fidaSolPool = exports.merSolPool = exports.btcSolPool = exports.oxySolPool = exports.copeSolPool = exports.fttSolPool = exports.srmSolPool = exports.stepSolPool = exports.ropeSolPool = exports.raySolPool = exports.ethUsdcPool = exports.ethSolPool = exports.solUsdtPool = exports.solUsdcPool = void 0;
const web3_js_1 = require("@solana/web3.js");
const pool_types_1 = require("../model/orca/pool/pool-types");
const config_1 = require("../public/pools/config");
const percentage_1 = require("../public/utils/models/percentage");
const Tokens = __importStar(require("./tokens"));
/**
* Constants
* TODO: Generate these from collectibles.json
* The following content is auto-generated.
*/
exports.solToken = Object.freeze({
tag: "SOL",
name: "Solana",
mint: new web3_js_1.PublicKey("So11111111111111111111111111111111111111112"),
scale: 9,
exports.solUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("EGZ7tiLeH62TPV1gL8WwbXGzEPa9zmcpVnnkPKKnrE2U"),
nonce: 252,
authority: new web3_js_1.PublicKey("JU8kmKzDHF9sXWsnoznaFDFezLsE5uomX2JkRMbmsQP"),
poolTokenMint: new web3_js_1.PublicKey("APDFRM3HMr8CAGXwKHiu2f5ePSpaiEJhaURwhsRrUUt9"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("8JnSiuvQq3BVuCU3n4DrSTw9chBSPvEMswrhtifVkr1o"),
tokenIds: [Tokens.solToken.mint.toString(), Tokens.usdcToken.mint.toString()],
tokens: {
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("ANP74VNsHwSrq9uUSjiSNyNWvf6ZPrKTmE4gHoNd13Lg") }),
[Tokens.usdcToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.usdcToken), { addr: new web3_js_1.PublicKey("75HgnSvXbWKZBpZHveX68ZzAhDqMzNDS29X6BGLtxMo1") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.ethToken = Object.freeze({
tag: "ETH",
name: "Ethereum",
mint: new web3_js_1.PublicKey("2FPyTwcZLUg1MDrwsyoP4D6s1tM7hAkHYRjkNb5w6Pxk"),
scale: 6,
exports.solUsdtPool = Object.freeze({
address: new web3_js_1.PublicKey("Dqk7mHQBx2ZWExmyrR2S8X6UG75CrbbpK2FSBZsNYsw6"),
nonce: 255,
authority: new web3_js_1.PublicKey("2sxKY7hxVFrY5oNE2DgaPAJFamMzsmFLM2DgVcjK5yTy"),
poolTokenMint: new web3_js_1.PublicKey("FZthQCuYHhcfiDma7QrX7buDHwrZEd7vL8SjS6LQa3Tx"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("BBKgw75FivTYXj85D2AWyVdaTdTWuSuHVXRm1Xu7fipb"),
tokenIds: [Tokens.solToken.mint.toString(), Tokens.usdtToken.mint.toString()],
tokens: {
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("DTb8NKsfhEJGY1TrA7RXN6MBiTrjnkdMAfjPEjtmTT3M") }),
[Tokens.usdtToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.usdtToken), { addr: new web3_js_1.PublicKey("E8erPjPEorykpPjFV9yUYMYigEWKQUxuGfL2rJKLJ3KU") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.rayToken = Object.freeze({
tag: "RAY",
name: "Raydium",
mint: new web3_js_1.PublicKey("4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R"),
scale: 6,
exports.ethSolPool = Object.freeze({
address: new web3_js_1.PublicKey("EuK3xDa4rWuHeMQCBsHf1ETZNiEQb5C476oE9u9kp8Ji"),
nonce: 255,
authority: new web3_js_1.PublicKey("DffrDbzPiswDJaiicBBo9CjqztKgFLrqXGwNJH4XQefZ"),
poolTokenMint: new web3_js_1.PublicKey("71FymgN2ZUf7VvVTLE8jYEnjP3jSK1Frp2XT1nHs8Hob"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("unxKgWEc71ZiHwMqZs3VLqjcjmZhfTZEg94ZLGvjdMP"),
tokenIds: [Tokens.ethToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.ethToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.ethToken), { addr: new web3_js_1.PublicKey("7F2cLdio3i6CCJaypj9VfNDPW2DwT3vkDmZJDEfmxu6A") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("5pUTGvN2AA2BEzBDU4CNDh3LHER15WS6J8oJf5XeZFD8") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.usdcToken = Object.freeze({
tag: "USDC",
name: "USD Coin",
mint: new web3_js_1.PublicKey("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"),
scale: 6,
exports.ethUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("FgZut2qVQEyPBibaTJbbX2PxaMZvT1vjDebiVaDp5BWP"),
nonce: 253,
authority: new web3_js_1.PublicKey("4dfCZR32xXhoTgMRhnViNaTFwiKP9A34TDjHCR3xM5rg"),
poolTokenMint: new web3_js_1.PublicKey("3e1W6Aqcbuk2DfHUwRiRcyzpyYRRjg6yhZZcyEARydUX"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("DLWewB12jzGn4wXJmFCddWDeof1Ma4cZYNRv9CP5hTvX"),
tokenIds: [Tokens.ethToken.mint.toString(), Tokens.usdcToken.mint.toString()],
tokens: {
[Tokens.ethToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.ethToken), { addr: new web3_js_1.PublicKey("H9h5yTBfCHcb4eRP87fXczzXgNaMzKihr7bf1sjw7iuZ") }),
[Tokens.usdcToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.usdcToken), { addr: new web3_js_1.PublicKey("JA98RXv2VdxQD8pRQq4dzJ1Bp4nH8nokCGmxvPWKJ3hx") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.usdtToken = Object.freeze({
tag: "USDT",
name: "Tether USD",
mint: new web3_js_1.PublicKey("Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB"),
scale: 6,
exports.raySolPool = Object.freeze({
address: new web3_js_1.PublicKey("3THMPkPmcHJ54JtHRyazhs7UN7HbV5KiNJVLJs6hSPSC"),
nonce: 255,
authority: new web3_js_1.PublicKey("EUc3MtHPLL956pTDfM5q25jp5Fk9zW7omEzh1uyDY7s6"),
poolTokenMint: new web3_js_1.PublicKey("5kimD5W6yJpHRHCyPtnEyDsQRdiiJKivu5AqN3si82Jc"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("65XNtnUsP1TMzKMGhMoD3GUFMNbmnZQwDaxDLE3jncUC"),
tokenIds: [Tokens.rayToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.rayToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.rayToken), { addr: new web3_js_1.PublicKey("GZaUNWf4ov6VZaD5MqZtc5pHB3mWTqczNUB4sstt8CSR") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("GNSZ1rr57QQ6qLcmZnhMcoBymenVezhNpzcFSfJP37h9") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.solUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("6fTRDD7sYxCN7oyoSQaN1AWC3P2m8A6gVZzGrpej9DvL"),
nonce: 253,
authority: new web3_js_1.PublicKey("B52XRdfTsh8iUGbGEBJLHyDMjhaTW8cAFCmpASGJtnNK"),
poolTokenMint: new web3_js_1.PublicKey("ECFcUGwHHMaZynAQpqRHkYeTBnS5GnPWZywM8aggcs3A"),
poolTokenDecimals: 9,
feeAccount: new web3_js_1.PublicKey("4pdzKqAGd1WbXn1L4UpY4r58irTfjFYMYNudBrqbQaYJ"),
tokenIds: [exports.solToken.mint.toString(), exports.usdcToken.mint.toString()],
exports.ropeSolPool = Object.freeze({
address: new web3_js_1.PublicKey("DCENobjFZK59nLeMCVRkQtnkAWrJkWAVpmVnwVNc8gqH"),
nonce: 251,
authority: new web3_js_1.PublicKey("C2DDX95TK3uC9MQXhHp3LWRv9kWtFTp36Ub9VPCKKiCV"),
poolTokenMint: new web3_js_1.PublicKey("ADrvfPBsRcJfGsN6Bs385zYddH52nuM5FA8UaAkX9o2V"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("88rKjeeDQYJxGVCG39znDvbxzjPc5H37XqHRQCSNJvED"),
tokenIds: [Tokens.ropeToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[exports.solToken.mint.toString()]: Object.assign(Object.assign({}, exports.solToken), { addr: new web3_js_1.PublicKey("FdiTt7XQ94fGkgorywN1GuXqQzmURHCDgYtUutWRcy4q") }),
[exports.usdcToken.mint.toString()]: Object.assign(Object.assign({}, exports.usdcToken), { addr: new web3_js_1.PublicKey("7VcwKUtdKnvcgNhZt5BQHsbPrXLxhdVomsgrr7k2N5P5") }),
[Tokens.ropeToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.ropeToken), { addr: new web3_js_1.PublicKey("HLHPVwgzYjTHmu1fmV9eZzdE8H3fZwhuCBRNNN2Z5miA") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("7Be3aStQmKgeXC1xqfJnA8qaGzw6keQTLqHYAJprZK2H") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(2, 1000),
ownerFee: percentage_1.Percentage.fromFraction(1, 1000),
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.solUsdtPool = Object.freeze({
address: new web3_js_1.PublicKey("4bS6bkBdJ4B1Bt4ft3oGF8La7eKpCqz8xnu1AMpMxWSP"),
exports.stepSolPool = Object.freeze({
address: new web3_js_1.PublicKey("2sNtf8wLZMR7XJm2pzvvVUNPTNRFsGTiC5vgDSGv5QGD"),
nonce: 255,
authority: new web3_js_1.PublicKey("EAvLj3zW236pUSSSzwjL18QuPpkTxkWaVSR5GdX7yiNa"),
poolTokenMint: new web3_js_1.PublicKey("BmZNYGt7aApGTUUxAQUYsW64cMbb6P7uniokCWaptj4D"),
poolTokenDecimals: 9,
feeAccount: new web3_js_1.PublicKey("HR2rWgcU6SNCWxJDozDu6qCgSSvUoKCynbhQPGRNqpCG"),
tokenIds: [exports.solToken.mint.toString(), exports.usdtToken.mint.toString()],
authority: new web3_js_1.PublicKey("HzAJLVqZ7fnmc2LfRPtz2GHu93RpAPQsdDTg6DRoTTmf"),
poolTokenMint: new web3_js_1.PublicKey("8nTzqDXHriG2CXKbybeuEh1EqDQMtrbYMFWcP7AkiDaP"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("5FEmPmAk72NycwzMXLD3hc2f47zRXocv4mvd3HEUZ5io"),
tokenIds: [Tokens.stepToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[exports.solToken.mint.toString()]: Object.assign(Object.assign({}, exports.solToken), { addr: new web3_js_1.PublicKey("BBDQmitNga99M9QsBRnyos9uWPumNbWLC1mfbReJi45C") }),
[exports.usdtToken.mint.toString()]: Object.assign(Object.assign({}, exports.usdtToken), { addr: new web3_js_1.PublicKey("8xepSs1iXsSw8QrCS1rpZk8KY3fMwUZqDT4dmzDa2trX") }),
[Tokens.stepToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.stepToken), { addr: new web3_js_1.PublicKey("35opuEpVvggzfV361hQVNXiC7KAKS1HCeDoVpfVybo8k") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("A3DSsYZJWHiwXSQb7P2AbEoaWhpauJLU1PVdTPnzV5s9") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(2, 1000),
ownerFee: percentage_1.Percentage.fromFraction(1, 1000),
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.raySolPool = Object.freeze({
address: new web3_js_1.PublicKey("4c8jpn6sLMrZHMYNq6idFfMdLBWEqn1r1wFNtgsPqTwE"),
nonce: 252,
authority: new web3_js_1.PublicKey("6nL4UZVRkn34Mxb7DGU91U86zhtF2PTX72Ncs64sUFx"),
poolTokenMint: new web3_js_1.PublicKey("GWEmABT4rD3sGhyghv9rKbfdiaFe5uMHeJqr6hhu3XvA"),
poolTokenDecimals: 9,
feeAccount: new web3_js_1.PublicKey("3uUNB1KSwyF6YDuiQiRbFnnDW4Q625SQJk7LuoxQA8Pw"),
tokenIds: [exports.rayToken.mint.toString(), exports.solToken.mint.toString()],
exports.srmSolPool = Object.freeze({
address: new web3_js_1.PublicKey("EJRXAkKyDhDgzdZz1Ss5CpWKWSK9xTR5S6GDLAer8mdh"),
nonce: 255,
authority: new web3_js_1.PublicKey("2pQbngWBSWUjBHWVWQ3tppKxW3Y5NzUcye1822itKyzZ"),
poolTokenMint: new web3_js_1.PublicKey("9tf8rBSEQYG7AqL896fN2nZi1iYPqpWaLEdpbeQaC1Vy"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("APyc1s8wES4Q2FTqHN8jXZtRuWQyRWZ82u7EFfras2iZ"),
tokenIds: [Tokens.srmToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[exports.rayToken.mint.toString()]: Object.assign(Object.assign({}, exports.rayToken), { addr: new web3_js_1.PublicKey("HxuUQPpqkxzYPYQqM6XkVVVw2UQt4m3eMYzYQFJZjuvG") }),
[exports.solToken.mint.toString()]: Object.assign(Object.assign({}, exports.solToken), { addr: new web3_js_1.PublicKey("B6whMxirSzzNcSeJ1G4HDFTRKjPFcWovCL53uxG7LexB") }),
[Tokens.srmToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.srmToken), { addr: new web3_js_1.PublicKey("2JCxZv6LaFjtWqBXSC2brsWE9WryS4Cp3VwwDeNGvLyv") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("EdhG3vQbTVVAARZB4AbhU2HsVbvfFqX2yhBAfFV22nzA") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(2, 1000),
ownerFee: percentage_1.Percentage.fromFraction(1, 1000),
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.ethSolPool = Object.freeze({
address: new web3_js_1.PublicKey("4vWJYxLx9F7WPQeeYzg9cxhDeaPjwruZXCffaSknWFxy"),
nonce: 252,
authority: new web3_js_1.PublicKey("Hmjv9wvRctYXHRaX7dTdHB4MsFk4mZgKQrqrgQJXNXii"),
poolTokenMint: new web3_js_1.PublicKey("7bb88DAnQY7LSoWEuqezCcbk4vutQbuRqgJMqpX8h6dL"),
poolTokenDecimals: 9,
feeAccount: new web3_js_1.PublicKey("CYGRBB4qAYzSqdnvVaXvyZLg5j7YNVcuqM6gdD2MMUi1"),
tokenIds: [exports.ethToken.mint.toString(), exports.solToken.mint.toString()],
exports.fttSolPool = Object.freeze({
address: new web3_js_1.PublicKey("68Bg6yQxWm3mrUYk3XzMiF5ycE41HwPhyEdaB1cp6wuo"),
nonce: 255,
authority: new web3_js_1.PublicKey("BpshqwEmPXmJwJfFgTFafmXoHN8Lc7SouvFsh6jyYQAm"),
poolTokenMint: new web3_js_1.PublicKey("EsYaDKJCmcJtJHFuJYwQZwqohvVMCrFzcg8yo3i328No"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("FWBCbjZnypLKz7uHGJXpBAEez2FurQXi9J3js7ZT1xDe"),
tokenIds: [Tokens.fttToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[exports.ethToken.mint.toString()]: Object.assign(Object.assign({}, exports.ethToken), { addr: new web3_js_1.PublicKey("FidGus13X2HPzd3cuBEFSq32UcBQkF68niwvP6bM4fs2") }),
[exports.solToken.mint.toString()]: Object.assign(Object.assign({}, exports.solToken), { addr: new web3_js_1.PublicKey("5x1amFuGMfUVzy49Y4Pc3HyCVD2usjLaofnzB3d8h7rv") }),
[Tokens.fttToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.fttToken), { addr: new web3_js_1.PublicKey("3eVE92aEAsLYcBACXNu1yxoHVfTM8e8vmQC2zSApGRJX") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("BbsiNbFfJsRDwqF4JaiJ6sKecNuY4eWmEaDHcY6h6HuD") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(2, 1000),
ownerFee: percentage_1.Percentage.fromFraction(1, 1000),
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.ethUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("DY8qBwVGLeLJSrWib7L16mL7oB4HNAQ2f9yiYWKof54v"),
exports.copeSolPool = Object.freeze({
address: new web3_js_1.PublicKey("BRx4dJecxzeGYc1BskCWonfGCeMyv9G7tk66cf2QGhK6"),
nonce: 254,
authority: new web3_js_1.PublicKey("JAJr1D6BQHFj9qJ8pfXhvJgLfn9vTcviU9sTA8MhKzN4"),
poolTokenMint: new web3_js_1.PublicKey("CzieDbGRdN1QGaGDNpSqzEA18bi881ccvkkGZi51pe1k"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("9X8VRnxk6EVKGA7TErdSZYFC8oLUM569pDbZTtycjvXw"),
tokenIds: [Tokens.copeToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.copeToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.copeToken), { addr: new web3_js_1.PublicKey("7v5GCdHH439SztxcqL4wpfWdPvv9EfMm8GYTHSUQoGoY") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("5tSgRUK6f2x1nAXA4gdcHNXiWdToqni9pr5xvq2Fq82u") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.oxySolPool = Object.freeze({
address: new web3_js_1.PublicKey("Cq4EZrvuFQpsCz8L3gS6t7iQ7VWzTtqDgSxD4AgVAAfd"),
nonce: 255,
authority: new web3_js_1.PublicKey("82oSibpDKnPZ2Yk1vn6McjCsQQbKfBkGeEh5FsqeVrtU"),
poolTokenMint: new web3_js_1.PublicKey("7TYb32qkwYosUQfUspU45cou7Bb3nefJocVMFX2mEGTT"),
poolTokenDecimals: 9,
feeAccount: new web3_js_1.PublicKey("AcMaBVt6S43JQXKnEDqdicxYofb5Cj1UgFWF9AsurTp6"),
tokenIds: [exports.ethToken.mint.toString(), exports.usdcToken.mint.toString()],
authority: new web3_js_1.PublicKey("FxxcJPunf6Vj9Ve5zyM9yatMbmkrzTQ1QSk4NqKW9DvK"),
poolTokenMint: new web3_js_1.PublicKey("7tYCdLN84EnTMkxM7HNamWJx7F4xgKe9KiiWvLyWjbgT"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("Ch8i2A1GAspivXYfdme7vSxh1mhRjmRgeiKN8KpWhVqo"),
tokenIds: [Tokens.oxyToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[exports.ethToken.mint.toString()]: Object.assign(Object.assign({}, exports.ethToken), { addr: new web3_js_1.PublicKey("8eUUP3t9nkXPub8X6aW2a2gzi82pUFqefwkSY8rCcVxg") }),
[exports.usdcToken.mint.toString()]: Object.assign(Object.assign({}, exports.usdcToken), { addr: new web3_js_1.PublicKey("2tNEBoEuqJ1pPmA1fpitDnowgUQZXvCT6W3fui67AFfV") }),
[Tokens.oxyToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.oxyToken), { addr: new web3_js_1.PublicKey("BoZQMfTLTPcXnevJxNFkECVbKesfhXnTUg4kxLgzV9BX") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("8ZrEcJbgg7BdoBga5RYDR8aMujLf5cAQp8zdPZqk7nNC") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(2, 1000),
ownerFee: percentage_1.Percentage.fromFraction(1, 1000),
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.btcSolPool = Object.freeze({
address: new web3_js_1.PublicKey("7N2AEJ98qBs4PwEwZ6k5pj8uZBKMkZrKZeiC7A64B47u"),
nonce: 255,
authority: new web3_js_1.PublicKey("GqnLhu3bPQ46nTZYNFDnzhwm31iFoqhi3ntXMtc5DPiT"),
poolTokenMint: new web3_js_1.PublicKey("Acxs19v6eUMTEfdvkvWkRB4bwFCHm3XV9jABCy7c1mXe"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("4yPG4A9jB3ibDMVXEN2aZW4oA1e1xzzA3z5VWjkZd18B"),
tokenIds: [Tokens.btcToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.btcToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.btcToken), { addr: new web3_js_1.PublicKey("9G5TBPbEUg2iaFxJ29uVAT8ZzxY77esRshyHiLYZKRh8") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("5eqcnUasgU2NRrEAeWxvFVRTTYWJWfAJhsdffvc6nJc2") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.merSolPool = Object.freeze({
address: new web3_js_1.PublicKey("UJBm2tHwDbQZpjQvaHozg5qkjh6prSKhnWheqR5T76Q"),
nonce: 255,
authority: new web3_js_1.PublicKey("C8HcMrC9WRqqXVbHRhZWjuZPbbWmszDobKFxevCtGhpT"),
poolTokenMint: new web3_js_1.PublicKey("HiwRobjfHZ4zsPtqCC4oBS24pSmy4t8GGkXRbQj4yU6L"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("3Fdj69449GhiDmqyvWWTSafjRphGdiDhZ5i5rqfHBdio"),
tokenIds: [Tokens.merToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.merToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.merToken), { addr: new web3_js_1.PublicKey("DHdkRWTa9SRJNMtWZQYvNNbjrDP3n92EWLHezjFGPipb") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("DC5RwjB3VkXdt2PoWKTA4Ub9KbtcY8xXpmPNKsFjALwq") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.fidaSolPool = Object.freeze({
address: new web3_js_1.PublicKey("4SUBbivGMvMhem3ajVtkmuPvL4GuQ8kfYTJFuQfG4F8t"),
nonce: 255,
authority: new web3_js_1.PublicKey("owuNLod7H14GpQCUodcdBBeD4LiZ2T5U9KpS2sAbTp6"),
poolTokenMint: new web3_js_1.PublicKey("EYsNdtyu4gGTaGz8N5m5iQ3G1N6rDyMbR72B3CqbWW4W"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("J2s1GpduscTTvMYt3os8LdvT24uhr9bPnTbxSKZZhEma"),
tokenIds: [Tokens.fidaToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.fidaToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.fidaToken), { addr: new web3_js_1.PublicKey("9ofyx5yFzjH1XWmJzfiGCDfhq6ho8yFbszGQrrJXe54") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("55moYcq91pXbSRpL2DR8P3BehqSNWiJrdTn5SZFc2STn") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.mapsSolPool = Object.freeze({
address: new web3_js_1.PublicKey("4rkgbbCPKk5zx3KiwcCNiSpNSSLgAkswKGfX7CJjGgtC"),
nonce: 255,
authority: new web3_js_1.PublicKey("8uuBxVsGf2bqH5t8mct5NfpgcTDb7czXuWVEm6Boia4x"),
poolTokenMint: new web3_js_1.PublicKey("99pfC8fWymXgbq3CvrExhx3UxQDC1fMWEWLbNT83F45e"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("8w3gx1GQ1UN5sodEVP14qUwzCcgopHWUeWbT26hgK3xh"),
tokenIds: [Tokens.mapsToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.mapsToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.mapsToken), { addr: new web3_js_1.PublicKey("BqExNTYk7YdeiaREHqnqN2q1F3dBCTPhkwrrWBFD4F1m") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("HdEQ99E979aXn2xTcg5UXEfLynwFkqpPTxLaNkH7Nz7P") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.orcaSolPool = Object.freeze({
address: new web3_js_1.PublicKey("2ZnVuidTHpi5WWKUwFXauYGhvdT9jRKYv5MDahtbwtYr"),
nonce: 255,
authority: new web3_js_1.PublicKey("2PH1quJj9MHQXATCmNZ6qQ2gZqM8R236DpKaz99ggVpm"),
poolTokenMint: new web3_js_1.PublicKey("2uVjAuRXavpM6h1scGQaxqb6HVaNRn6T2X7HHXTabz25"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("4Zc4kQZhRQeGztihvcGSWezJE1k44kKEgPCAkdeBfras"),
tokenIds: [Tokens.orcaToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.orcaToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.orcaToken), { addr: new web3_js_1.PublicKey("AioST8HKQJRqjE1mknk4Rydc8wVADhdQwRJmAAYX1T6Z") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("73zdy95DynZP4exdpuXTDsexcrWbDJX9TFi2E6CDzXh4") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.orcaUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("2p7nYbtPBgtmY69NsE8DAW6szpRJn7tQvDnqvoEWQvjY"),
nonce: 254,
authority: new web3_js_1.PublicKey("3fr1AhdiAmWLeNrS24CMoAu9pPgbzVhwLtJ6QUPmw2ob"),
poolTokenMint: new web3_js_1.PublicKey("n8Mpu28RjeYD7oUX3LG1tPxzhRZh3YYLRSHcHRdS3Zx"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("7CXZED4jfRp3qdHB9Py3up6v1C4UhHofFvfT6RXbJLRN"),
tokenIds: [Tokens.orcaToken.mint.toString(), Tokens.usdcToken.mint.toString()],
tokens: {
[Tokens.orcaToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.orcaToken), { addr: new web3_js_1.PublicKey("9vYWHBPz817wJdQpE8u3h8UoY3sZ16ZXdCcvLB7jY4Dj") }),
[Tokens.usdcToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.usdcToken), { addr: new web3_js_1.PublicKey("6UczejMUv1tzdvUzKpULKHxrK9sqLm8edR1v9jinVWm9") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.kinSolPool = Object.freeze({
address: new web3_js_1.PublicKey("Ez52BLSoZw3MxWxMK4ADsJXqzUiYW9sUnwcrrQwQGdLT"),
nonce: 253,
authority: new web3_js_1.PublicKey("C6WisvFQzqxTBF3DV6RFbPMPBiVHE816CZHoctB3WzrW"),
poolTokenMint: new web3_js_1.PublicKey("HEvnD66WcBfTajS9adUYnGRBMDehFtLySiFHSD6kEBWs"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("5bLeJU66qTopjZBa48BUd7EXWcj4UeCMfHjjrvt8Zcgs"),
tokenIds: [Tokens.kinToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.kinToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.kinToken), { addr: new web3_js_1.PublicKey("2Ssm5Dd1Zc5QpGSZzuqt3Ef4bADteuBbCGiEZJ5n48rV") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("HCS9EpKRxWDS9GCRFStNbPWgRQpvV6EyBWChJja2UbCm") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.samoSolPool = Object.freeze({
address: new web3_js_1.PublicKey("DiAP9qmp5foN7fLTWfBWjo9KBS1jgvKUJLWi1ZhqKaja"),
nonce: 255,
authority: new web3_js_1.PublicKey("3uZcofBKVBYFrQ7jVjTFLEMWAQiZcih4AES5tKBqdo7m"),
poolTokenMint: new web3_js_1.PublicKey("D6N9j8F2DhtzDtrdpT74y3u2YmYAzcggiLc3nTjqux9M"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("BYAjG645fRRHZ5JFnZKnXc4dzK9WppcoVWDMYj3zm3KF"),
tokenIds: [Tokens.samoToken.mint.toString(), Tokens.solToken.mint.toString()],
tokens: {
[Tokens.samoToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.samoToken), { addr: new web3_js_1.PublicKey("AFcbD7UTzk9d1njRxyDHNbQ5Q6miPNAE1GctjD96JYAi") }),
[Tokens.solToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.solToken), { addr: new web3_js_1.PublicKey("6kYbPDsYLQUwptV7ZvQKG3gjNreEEgaWh2CM4DQPYTpq") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
exports.liqUsdcPool = Object.freeze({
address: new web3_js_1.PublicKey("AXSeEafwPUGSamiZWH8m2PJtvpDVtrofxvycNwxiysdh"),
nonce: 254,
authority: new web3_js_1.PublicKey("6Y5TnCwgifc8Z7QYo672nT9uNd2hcivVR1NT6oDkJx6P"),
poolTokenMint: new web3_js_1.PublicKey("3PD9SZFwXKkXr4akLf4ofo37ZUMycwML89R2P3qxcbZG"),
poolTokenDecimals: 6,
feeAccount: new web3_js_1.PublicKey("FSVPcprrTkQLRtDACFEpa2rhEVx4kBvjPuQaxj572SaC"),
tokenIds: [Tokens.liqToken.mint.toString(), Tokens.usdcToken.mint.toString()],
tokens: {
[Tokens.liqToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.liqToken), { addr: new web3_js_1.PublicKey("CVspL8Tj5YdqntXJegNeDXHiBn3648QDNB7gex6D9MgY") }),
[Tokens.usdcToken.mint.toString()]: Object.assign(Object.assign({}, Tokens.usdcToken), { addr: new web3_js_1.PublicKey("8YzLsZ1FtsruswkBogEaXwmRTf5PMuyVcfSZXRAdi8qA") }),
},
curveType: pool_types_1.CurveType.ConstantProduct,
feeStructure: {
traderFee: percentage_1.Percentage.fromFraction(25, 10000),
ownerFee: percentage_1.Percentage.fromFraction(5, 10000),
},
});
/**
* Mapping for OrcaPool parameters
* Key: poolTokenMint : OrcaPoolParams
*/
exports.orcaPoolConfigs = {
[config_1.OrcaPoolConfig.SOL_USDC]: exports.solUsdcPool,
[config_1.OrcaPoolConfig.SOL_USDT]: exports.solUsdtPool,
[config_1.OrcaPoolConfig.RAY_SOL]: exports.raySolPool,
[config_1.OrcaPoolConfig.ETH_SOL]: exports.ethSolPool,
[config_1.OrcaPoolConfig.ETH_USDC]: exports.ethUsdcPool,
APDFRM3HMr8CAGXwKHiu2f5ePSpaiEJhaURwhsRrUUt9: exports.solUsdcPool,
FZthQCuYHhcfiDma7QrX7buDHwrZEd7vL8SjS6LQa3Tx: exports.solUsdtPool,
"71FymgN2ZUf7VvVTLE8jYEnjP3jSK1Frp2XT1nHs8Hob": exports.ethSolPool,
"3e1W6Aqcbuk2DfHUwRiRcyzpyYRRjg6yhZZcyEARydUX": exports.ethUsdcPool,
"5kimD5W6yJpHRHCyPtnEyDsQRdiiJKivu5AqN3si82Jc": exports.raySolPool,
ADrvfPBsRcJfGsN6Bs385zYddH52nuM5FA8UaAkX9o2V: exports.ropeSolPool,
"8nTzqDXHriG2CXKbybeuEh1EqDQMtrbYMFWcP7AkiDaP": exports.stepSolPool,
"9tf8rBSEQYG7AqL896fN2nZi1iYPqpWaLEdpbeQaC1Vy": exports.srmSolPool,
EsYaDKJCmcJtJHFuJYwQZwqohvVMCrFzcg8yo3i328No: exports.fttSolPool,
CzieDbGRdN1QGaGDNpSqzEA18bi881ccvkkGZi51pe1k: exports.copeSolPool,
"7tYCdLN84EnTMkxM7HNamWJx7F4xgKe9KiiWvLyWjbgT": exports.oxySolPool,
Acxs19v6eUMTEfdvkvWkRB4bwFCHm3XV9jABCy7c1mXe: exports.btcSolPool,
HiwRobjfHZ4zsPtqCC4oBS24pSmy4t8GGkXRbQj4yU6L: exports.merSolPool,
EYsNdtyu4gGTaGz8N5m5iQ3G1N6rDyMbR72B3CqbWW4W: exports.fidaSolPool,
"99pfC8fWymXgbq3CvrExhx3UxQDC1fMWEWLbNT83F45e": exports.mapsSolPool,
"2uVjAuRXavpM6h1scGQaxqb6HVaNRn6T2X7HHXTabz25": exports.orcaSolPool,
n8Mpu28RjeYD7oUX3LG1tPxzhRZh3YYLRSHcHRdS3Zx: exports.orcaUsdcPool,
HEvnD66WcBfTajS9adUYnGRBMDehFtLySiFHSD6kEBWs: exports.kinSolPool,
D6N9j8F2DhtzDtrdpT74y3u2YmYAzcggiLc3nTjqux9M: exports.samoSolPool,
"3PD9SZFwXKkXr4akLf4ofo37ZUMycwML89R2P3qxcbZG": exports.liqUsdcPool,
};

@@ -87,4 +87,4 @@ "use strict";

const minimumAmountOutU64 = public_1.U64Utils.toTokenU64(minimumAmountOut, outputPoolToken, "minimumAmountOut");
const _a = yield public_1.resolveAssociatedTokenAddress(this.connection, owner.publicKey, inputPoolToken.mint, amountInU64), { address: inputPoolTokenUserAddress } = _a, resolveInputAddrInstructions = __rest(_a, ["address"]);
const _b = yield public_1.resolveAssociatedTokenAddress(this.connection, owner.publicKey, outputPoolToken.mint, amountInU64), { address: outputPoolTokenUserAddress } = _b, resolveOutputAddrInstructions = __rest(_b, ["address"]);
const _a = yield public_1.resolveOrCreateAssociatedTokenAddress(this.connection, owner, inputPoolToken.mint, amountInU64), { address: inputPoolTokenUserAddress } = _a, resolveInputAddrInstructions = __rest(_a, ["address"]);
const _b = yield public_1.resolveOrCreateAssociatedTokenAddress(this.connection, owner, outputPoolToken.mint, amountInU64), { address: outputPoolTokenUserAddress } = _b, resolveOutputAddrInstructions = __rest(_b, ["address"]);
if (inputPoolTokenUserAddress === undefined || outputPoolTokenUserAddress === undefined) {

@@ -91,0 +91,0 @@ throw new Error("Unable to derive input / output token associated address.");

@@ -9,3 +9,3 @@ "use strict";

const decimal_js_1 = __importDefault(require("decimal.js"));
const constants_1 = require("../../constants");
const tokens_1 = require("../../constants/tokens");
const public_1 = require("../../public");

@@ -81,3 +81,3 @@ /**

let numSigs;
if (params.inputToken === constants_1.solToken || params.outputToken === constants_1.solToken) {
if (params.inputToken === tokens_1.solToken || params.outputToken === tokens_1.solToken) {
numSigs = 3;

@@ -84,0 +84,0 @@ }

/**
* Constants
* TODO: Generate these from collectibles.json
* The following content is auto-generated.
*/

@@ -9,7 +8,22 @@ /**

export declare enum OrcaPoolConfig {
SOL_USDC = "SOL_USDC",
SOL_USDT = "SOL_USDT",
RAY_SOL = "RAY_SOL",
ETH_SOL = "ETH_SOL",
ETH_USDC = "ETH_USDC"
SOL_USDC = "APDFRM3HMr8CAGXwKHiu2f5ePSpaiEJhaURwhsRrUUt9",
SOL_USDT = "FZthQCuYHhcfiDma7QrX7buDHwrZEd7vL8SjS6LQa3Tx",
ETH_SOL = "71FymgN2ZUf7VvVTLE8jYEnjP3jSK1Frp2XT1nHs8Hob",
ETH_USDC = "3e1W6Aqcbuk2DfHUwRiRcyzpyYRRjg6yhZZcyEARydUX",
RAY_SOL = "5kimD5W6yJpHRHCyPtnEyDsQRdiiJKivu5AqN3si82Jc",
ROPE_SOL = "ADrvfPBsRcJfGsN6Bs385zYddH52nuM5FA8UaAkX9o2V",
STEP_SOL = "8nTzqDXHriG2CXKbybeuEh1EqDQMtrbYMFWcP7AkiDaP",
SRM_SOL = "9tf8rBSEQYG7AqL896fN2nZi1iYPqpWaLEdpbeQaC1Vy",
FTT_SOL = "EsYaDKJCmcJtJHFuJYwQZwqohvVMCrFzcg8yo3i328No",
COPE_SOL = "CzieDbGRdN1QGaGDNpSqzEA18bi881ccvkkGZi51pe1k",
OXY_SOL = "7tYCdLN84EnTMkxM7HNamWJx7F4xgKe9KiiWvLyWjbgT",
BTC_SOL = "Acxs19v6eUMTEfdvkvWkRB4bwFCHm3XV9jABCy7c1mXe",
MER_SOL = "HiwRobjfHZ4zsPtqCC4oBS24pSmy4t8GGkXRbQj4yU6L",
FIDA_SOL = "EYsNdtyu4gGTaGz8N5m5iQ3G1N6rDyMbR72B3CqbWW4W",
MAPS_SOL = "99pfC8fWymXgbq3CvrExhx3UxQDC1fMWEWLbNT83F45e",
ORCA_SOL = "2uVjAuRXavpM6h1scGQaxqb6HVaNRn6T2X7HHXTabz25",
ORCA_USDC = "n8Mpu28RjeYD7oUX3LG1tPxzhRZh3YYLRSHcHRdS3Zx",
KIN_SOL = "HEvnD66WcBfTajS9adUYnGRBMDehFtLySiFHSD6kEBWs",
SAMO_SOL = "D6N9j8F2DhtzDtrdpT74y3u2YmYAzcggiLc3nTjqux9M",
LIQ_USDC = "3PD9SZFwXKkXr4akLf4ofo37ZUMycwML89R2P3qxcbZG"
}
"use strict";
/**
* Constants
* TODO: Generate these from collectibles.json
* The following content is auto-generated.
*/

@@ -13,7 +12,22 @@ Object.defineProperty(exports, "__esModule", { value: true });

(function (OrcaPoolConfig) {
OrcaPoolConfig["SOL_USDC"] = "SOL_USDC";
OrcaPoolConfig["SOL_USDT"] = "SOL_USDT";
OrcaPoolConfig["RAY_SOL"] = "RAY_SOL";
OrcaPoolConfig["ETH_SOL"] = "ETH_SOL";
OrcaPoolConfig["ETH_USDC"] = "ETH_USDC";
OrcaPoolConfig["SOL_USDC"] = "APDFRM3HMr8CAGXwKHiu2f5ePSpaiEJhaURwhsRrUUt9";
OrcaPoolConfig["SOL_USDT"] = "FZthQCuYHhcfiDma7QrX7buDHwrZEd7vL8SjS6LQa3Tx";
OrcaPoolConfig["ETH_SOL"] = "71FymgN2ZUf7VvVTLE8jYEnjP3jSK1Frp2XT1nHs8Hob";
OrcaPoolConfig["ETH_USDC"] = "3e1W6Aqcbuk2DfHUwRiRcyzpyYRRjg6yhZZcyEARydUX";
OrcaPoolConfig["RAY_SOL"] = "5kimD5W6yJpHRHCyPtnEyDsQRdiiJKivu5AqN3si82Jc";
OrcaPoolConfig["ROPE_SOL"] = "ADrvfPBsRcJfGsN6Bs385zYddH52nuM5FA8UaAkX9o2V";
OrcaPoolConfig["STEP_SOL"] = "8nTzqDXHriG2CXKbybeuEh1EqDQMtrbYMFWcP7AkiDaP";
OrcaPoolConfig["SRM_SOL"] = "9tf8rBSEQYG7AqL896fN2nZi1iYPqpWaLEdpbeQaC1Vy";
OrcaPoolConfig["FTT_SOL"] = "EsYaDKJCmcJtJHFuJYwQZwqohvVMCrFzcg8yo3i328No";
OrcaPoolConfig["COPE_SOL"] = "CzieDbGRdN1QGaGDNpSqzEA18bi881ccvkkGZi51pe1k";
OrcaPoolConfig["OXY_SOL"] = "7tYCdLN84EnTMkxM7HNamWJx7F4xgKe9KiiWvLyWjbgT";
OrcaPoolConfig["BTC_SOL"] = "Acxs19v6eUMTEfdvkvWkRB4bwFCHm3XV9jABCy7c1mXe";
OrcaPoolConfig["MER_SOL"] = "HiwRobjfHZ4zsPtqCC4oBS24pSmy4t8GGkXRbQj4yU6L";
OrcaPoolConfig["FIDA_SOL"] = "EYsNdtyu4gGTaGz8N5m5iQ3G1N6rDyMbR72B3CqbWW4W";
OrcaPoolConfig["MAPS_SOL"] = "99pfC8fWymXgbq3CvrExhx3UxQDC1fMWEWLbNT83F45e";
OrcaPoolConfig["ORCA_SOL"] = "2uVjAuRXavpM6h1scGQaxqb6HVaNRn6T2X7HHXTabz25";
OrcaPoolConfig["ORCA_USDC"] = "n8Mpu28RjeYD7oUX3LG1tPxzhRZh3YYLRSHcHRdS3Zx";
OrcaPoolConfig["KIN_SOL"] = "HEvnD66WcBfTajS9adUYnGRBMDehFtLySiFHSD6kEBWs";
OrcaPoolConfig["SAMO_SOL"] = "D6N9j8F2DhtzDtrdpT74y3u2YmYAzcggiLc3nTjqux9M";
OrcaPoolConfig["LIQ_USDC"] = "3PD9SZFwXKkXr4akLf4ofo37ZUMycwML89R2P3qxcbZG";
})(OrcaPoolConfig = exports.OrcaPoolConfig || (exports.OrcaPoolConfig = {}));

@@ -46,3 +46,3 @@ import { Keypair, PublicKey } from "@solana/web3.js";

* NOTE:
* 1. User has to ensure that their owner address has established spl-token accounts for the trading pair.
* 1. Associated Token Address initialization instructions will be appended if the ATA of the specified token does not exist in the user's wallet
* 2. OrcaU64 must have the same scale as the corresponding token scale value

@@ -49,0 +49,0 @@ *

@@ -5,3 +5,3 @@ "use strict";

const web3_js_1 = require("@solana/web3.js");
exports.ORCA_TOKEN_SWAP_ID = new web3_js_1.PublicKey("DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1");
exports.ORCA_TOKEN_SWAP_ID = new web3_js_1.PublicKey("9W959DqEETiGZocYWCQPaJ6sBmUzgfxXfqGeTEdp3aQP");
exports.SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID = new web3_js_1.PublicKey("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
import { Keypair, Signer, Transaction, TransactionInstruction, TransactionSignature } from "@solana/web3.js";
export declare const emptyInstruction: Instruction;
export declare type Instruction = {

@@ -3,0 +4,0 @@ instructions: TransactionInstruction[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.emptyInstruction = void 0;
exports.emptyInstruction = {
instructions: [],
cleanupInstructions: [],
signers: [],
};
import { u64 } from "@solana/spl-token";
import { Connection, PublicKey } from "@solana/web3.js";
import { Instruction } from "..";
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
import { Instruction } from "../models/instruction";
export declare type ResolvedTokenAddressInstruction = {
address: PublicKey;
} & Instruction;
export declare function resolveAssociatedTokenAddress(connection: Connection, walletAddress: PublicKey, tokenMint: PublicKey, amountIn?: u64): Promise<ResolvedTokenAddressInstruction>;
export declare function resolveOrCreateAssociatedTokenAddress(connection: Connection, owner: Keypair, tokenMint: PublicKey, amountIn?: u64): Promise<ResolvedTokenAddressInstruction>;
export declare function deriveAssociatedTokenAddress(walletAddress: PublicKey, tokenMint: PublicKey): Promise<PublicKey>;

@@ -12,16 +12,27 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.deriveAssociatedTokenAddress = exports.resolveAssociatedTokenAddress = void 0;
exports.deriveAssociatedTokenAddress = exports.resolveOrCreateAssociatedTokenAddress = void 0;
const spl_token_1 = require("@solana/spl-token");
const web3_js_1 = require("@solana/web3.js");
const pools_1 = require("../../../constants/pools");
const tokens_1 = require("../../../constants/tokens");
const constants_1 = require("../constants");
const instruction_1 = require("../models/instruction");
const deserialize_account_1 = require("./deserialize-account");
const token_instructions_1 = require("./instructions/token-instructions");
function resolveAssociatedTokenAddress(connection, walletAddress, tokenMint, amountIn = new spl_token_1.u64(0)) {
function resolveOrCreateAssociatedTokenAddress(connection, owner, tokenMint, amountIn = new spl_token_1.u64(0)) {
return __awaiter(this, void 0, void 0, function* () {
if (tokenMint !== pools_1.solToken.mint) {
if (tokenMint !== tokens_1.solToken.mint) {
const derivedAddress = yield deriveAssociatedTokenAddress(owner.publicKey, tokenMint);
// Check if current wallet has an ATA for this spl-token mint. If not, create one.
let resolveAtaInstruction = instruction_1.emptyInstruction;
yield connection.getAccountInfo(derivedAddress).then((info) => {
const tokenAccountInfo = deserialize_account_1.deserializeAccount(info === null || info === void 0 ? void 0 : info.data);
if (!tokenAccountInfo) {
resolveAtaInstruction = token_instructions_1.createAssociatedTokenAccountInstruction(derivedAddress, owner.publicKey, owner.publicKey, tokenMint, owner);
}
});
return {
address: yield deriveAssociatedTokenAddress(walletAddress, tokenMint),
instructions: [],
cleanupInstructions: [],
signers: [],
address: derivedAddress,
instructions: resolveAtaInstruction.instructions,
cleanupInstructions: resolveAtaInstruction.cleanupInstructions,
signers: resolveAtaInstruction.signers,
};

@@ -33,7 +44,7 @@ }

// Create a temp-account to transfer SOL in the form of WSOL
return token_instructions_1.createWSOLAccountInstructions(walletAddress, pools_1.solToken.mint, amountIn, accountRentExempt);
return token_instructions_1.createWSOLAccountInstructions(owner.publicKey, tokens_1.solToken.mint, amountIn, accountRentExempt);
}
});
}
exports.resolveAssociatedTokenAddress = resolveAssociatedTokenAddress;
exports.resolveOrCreateAssociatedTokenAddress = resolveOrCreateAssociatedTokenAddress;
function deriveAssociatedTokenAddress(walletAddress, tokenMint) {

@@ -40,0 +51,0 @@ return __awaiter(this, void 0, void 0, function* () {

@@ -33,3 +33,3 @@ "use strict";

const [authorityForPoolAddress] = yield web3_js_1.PublicKey.findProgramAddress([poolParams.address.toBuffer()], constants_1.ORCA_TOKEN_SWAP_ID);
const swapInstruction = spl_token_swap_1.TokenSwap.swapInstruction(poolParams.address, authorityForPoolAddress, userTransferAuthority, inputTokenUserAddress, inputToken.addr, outputToken.addr, outputTokenUserAddress, poolParams.poolTokenMint, poolParams.feeAccount, owner.publicKey, constants_1.ORCA_TOKEN_SWAP_ID, spl_token_1.TOKEN_PROGRAM_ID, amountInU64, minimumAmountOutU64);
const swapInstruction = spl_token_swap_1.TokenSwap.swapInstruction(poolParams.address, authorityForPoolAddress, userTransferAuthority, inputTokenUserAddress, inputToken.addr, outputToken.addr, outputTokenUserAddress, poolParams.poolTokenMint, poolParams.feeAccount, null, constants_1.ORCA_TOKEN_SWAP_ID, spl_token_1.TOKEN_PROGRAM_ID, amountInU64, minimumAmountOutU64);
return {

@@ -36,0 +36,0 @@ instructions: [swapInstruction],

import { u64 } from "@solana/spl-token";
import { PublicKey } from "@solana/web3.js";
import { Keypair, PublicKey } from "@solana/web3.js";
import { Instruction } from "../..";
import { ResolvedTokenAddressInstruction } from "../ata-utils";
export declare const createWSOLAccountInstructions: (owner: PublicKey, solMint: PublicKey, amountIn: u64, rentExemptLamports: number) => ResolvedTokenAddressInstruction;
export declare function createAssociatedTokenAccountInstruction(associatedTokenAddress: PublicKey, fundSource: PublicKey, destination: PublicKey, tokenMint: PublicKey, fundAddressOwner: Keypair): Instruction;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWSOLAccountInstructions = void 0;
exports.createAssociatedTokenAccountInstruction = exports.createWSOLAccountInstructions = void 0;
const spl_token_1 = require("@solana/spl-token");
const web3_js_1 = require("@solana/web3.js");
const __1 = require("../..");
const createWSOLAccountInstructions = (owner, solMint, amountIn, rentExemptLamports) => {

@@ -25,1 +26,52 @@ const tempAccount = new web3_js_1.Keypair();

exports.createWSOLAccountInstructions = createWSOLAccountInstructions;
function createAssociatedTokenAccountInstruction(associatedTokenAddress, fundSource, destination, tokenMint, fundAddressOwner) {
const systemProgramId = new web3_js_1.PublicKey("11111111111111111111111111111111");
const keys = [
{
pubkey: fundSource,
isSigner: true,
isWritable: true,
},
{
pubkey: associatedTokenAddress,
isSigner: false,
isWritable: true,
},
{
pubkey: destination,
isSigner: false,
isWritable: false,
},
{
pubkey: tokenMint,
isSigner: false,
isWritable: false,
},
{
pubkey: systemProgramId,
isSigner: false,
isWritable: false,
},
{
pubkey: spl_token_1.TOKEN_PROGRAM_ID,
isSigner: false,
isWritable: false,
},
{
pubkey: web3_js_1.SYSVAR_RENT_PUBKEY,
isSigner: false,
isWritable: false,
},
];
const createATAInstruction = new web3_js_1.TransactionInstruction({
keys,
programId: __1.SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID,
data: Buffer.from([]),
});
return {
instructions: [createATAInstruction],
cleanupInstructions: [],
signers: [fundAddressOwner],
};
}
exports.createAssociatedTokenAccountInstruction = createAssociatedTokenAccountInstruction;
{
"name": "@orca-so/sdk",
"version": "1.0.4",
"version": "1.1.0",
"description": "Typescript SDK for the Orca protocol.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -14,7 +14,7 @@ # Orca Typescript SDK

- SOLUSDC, SOLUSDT, RAYSOL, ETHSOL, ETHUSDC
- The SDK supports all pools currently listed on [Orca](https://www.orca.so/pools)
**Features Coming Soon**
- Supporting more pools on Orca!
- More trader information (APY, Volume)
- Support @project-serum/sol-wallet-adapter to support browser use-case
- Deposit/Withdraw from OrcaPools

@@ -62,2 +62,4 @@

// Perform a swap for 1USDC to the quoted minimum amount of ETH
// If the user does not have the Associated Token Address(ATA) to receive the output token, the ATA
// instructions will be appended in the transaction.
const txId = await pool.swap(owner, usdcToken, tradeValue, quote.getMinOutputAmount()).execute();

@@ -75,6 +77,2 @@ } catch (err) {

**Funding Associated Token Addresses**
The swap() function assumes the owner keypair address has already created & initialized the [associated token addresses](https://spl.solana.com/associated-token-account) for the trading pair tokens. The swap will fail if this is not the case.
**Stability of the Public Util Functions**

@@ -81,0 +79,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc