Skip to main content
Bumped by Community user
added 113 characters in body
Source Link

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine.

Also, the field "metadata" gives an error: "Object literal may only specify known properties, and '"metadata"' does not exist in type LossHarvester"

I also tried adding it then running anchor deploy as per this post: Anchor IDL address missing from json

export const IDL: LossHarvester = {
  "version": "0.1.0",
  "name": "loss_harvester",
  "metadata": {
    "address": "[PROGRAM_PUB_KEY]"
  },
...rest of code

Beginning of my program:

#[program]
pub mod loss_harvester {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Am I missing something here? Using anchor 0.29 with Solana 1.18.1. Something to note is that I started out with the hello-world template and renamed everything to loss-harvester.

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine.

Also, the field "metadata" gives an error: "Object literal may only specify known properties, and '"metadata"' does not exist in type LossHarvester"

I also tried adding it then running anchor deploy as per this post: Anchor IDL address missing from json

export const IDL: LossHarvester = {
  "version": "0.1.0",
  "name": "loss_harvester",
  "metadata": {
    "address": "[PROGRAM_PUB_KEY]"
  },
...rest of code

Beginning of my program:

#[program]
pub mod loss_harvester {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Am I missing something here? Using anchor 0.29 with Solana 1.18.1

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine.

Also, the field "metadata" gives an error: "Object literal may only specify known properties, and '"metadata"' does not exist in type LossHarvester"

I also tried adding it then running anchor deploy as per this post: Anchor IDL address missing from json

export const IDL: LossHarvester = {
  "version": "0.1.0",
  "name": "loss_harvester",
  "metadata": {
    "address": "[PROGRAM_PUB_KEY]"
  },
...rest of code

Beginning of my program:

#[program]
pub mod loss_harvester {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Am I missing something here? Using anchor 0.29 with Solana 1.18.1. Something to note is that I started out with the hello-world template and renamed everything to loss-harvester.

Source Link

Error: IDL for program `loss_harvester` does not have `metadata.address` field

When running anchor test on my solana program it complains that the IDL is missing the metadata.address field. But when I add it, it disappears again after running anchor test. My program built fine.

Also, the field "metadata" gives an error: "Object literal may only specify known properties, and '"metadata"' does not exist in type LossHarvester"

I also tried adding it then running anchor deploy as per this post: Anchor IDL address missing from json

export const IDL: LossHarvester = {
  "version": "0.1.0",
  "name": "loss_harvester",
  "metadata": {
    "address": "[PROGRAM_PUB_KEY]"
  },
...rest of code

Beginning of my program:

#[program]
pub mod loss_harvester {
    use super::*;

    pub fn initialize(ctx: Context<Initialize>) -> Result<()> {

Am I missing something here? Using anchor 0.29 with Solana 1.18.1