fix cancel in oracle creator

This commit is contained in:
Adrian Brzeziński 2024-06-24 18:18:46 +02:00
parent 6ccd3caa37
commit c21ffd2d14
2 changed files with 70 additions and 0 deletions

View File

@ -436,6 +436,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => {
targetAmount: number,
tokenMint: PublicKey,
) => {
setIsSolPool(false)
const swaps = await handleGetRoutesWithFixedArgs(
targetAmount ? targetAmount : 100,
tokenMint,
@ -530,6 +531,7 @@ const ListToken = ({ goBack }: { goBack: () => void }) => {
setProposedProposedTargetAmount(0)
setBaseTokenPrice(0)
setIsLST(false)
setIsSolPool(false)
}
const isFormValid = useCallback(

View File

@ -216,6 +216,74 @@ const CreateSwitchboardOracleModal = ({
if (!settingFromLib) {
throw wrongTierPassedForCreation
}
console.log(
OracleJob.fromObject({
tasks: [
{
conditionalTask: {
attempt: [
{
valueTask: {
big: swapValue,
},
},
{
divideTask: {
job: {
tasks: [
{
jupiterSwapTask: {
inTokenAddress: USDC_MINT,
outTokenAddress: baseTokenPk,
baseAmountString: swapValue,
},
},
],
},
},
},
],
onFailure: onFailureTaskDesc,
},
},
{
conditionalTask: {
attempt: [
{
multiplyTask: {
job: {
tasks: [
{
oracleTask: {
pythAddress: pythUsdOracle,
pythAllowedConfidenceInterval: 10,
},
},
],
},
},
},
],
onFailure: [
{
multiplyTask: {
job: {
tasks: [
{
oracleTask: {
switchboardAddress: switchboardUsdDaoOracle,
},
},
],
},
},
},
],
},
},
],
}).toJSON(),
)
const [aggregatorAccount, txArray1] =
await queueAccount.createFeedInstructions(payer, {
name: `${baseTokenName}/${quoteTokenName}`,