Skip to content

Should other instructions be an array? #61

@austbot

Description

@austbot

In the quote response I'm seeing other instructions coming back as an [] but in the deserialization code found here

'otherInstructions': InstructionFromJSON(json['otherInstructions']),

its being treated like an object.

Here is some output on a USDC to BONK quote

Swap instructions received: {
  otherInstructions: [],
  computeBudgetInstructions: [
    {
      programId: "ComputeBudget111111111111111111111111111111",
      accounts: [],
      data: "AljXAwA=",
    }, {
      programId: "ComputeBudget111111111111111111111111111111",
      accounts: [],
      data: "AzAwBgAAAAAA",
    }
  ],

Here is my request

swapRequest {
  userPublicKey: "<redacted>",
  wrapAndUnwrapSol: true,
  useSharedAccounts: undefined,
  feeAccount: undefined,
  trackingAccount: undefined,
  prioritizationFeeLamports: {
    priorityLevelWithMaxLamports: {
      priorityLevel: "medium",
      maxLamports: 1000000,
    },
    jitoTipLamports: undefined,
  },
  asLegacyTransaction: undefined,
  destinationTokenAccount: undefined,
  dynamicComputeUnitLimit: true,
  skipUserAccountsRpcCalls: undefined,
  dynamicSlippage: undefined,
  computeUnitPriceMicroLamports: undefined,
  quoteResponse: {
    inputMint: "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
    inAmount: "10000000",
    outputMint: "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263",
    outAmount: "73945723793",
    otherAmountThreshold: "73871778070",
    swapMode: "ExactIn",
    slippageBps: 10,
    platformFee: undefined,
    priceImpactPct: "0.0004607674230336317235341978",
....

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions