{"version":3,"file":"writeRoaInstruction.cjs","sources":["../../../src/instructions/writeRoaInstruction.ts"],"sourcesContent":["import {\r\n  AccountRole,\r\n  Address,\r\n  IAccountMeta,\r\n  IInstruction,\r\n  ReadonlyUint8Array,\r\n} from \"@solana/kit\";\r\nimport { serialize } from \"borsh\";\r\n\r\nimport { addressCodec } from \"../codecs\";\r\n\r\nexport class writeRoaInstruction {\r\n  tag: number;\r\n  roaId: ReadonlyUint8Array;\r\n\r\n  static schema = {\r\n    struct: {\r\n      tag: \"u8\",\r\n      roaId: { array: { type: \"u8\" } },\r\n    },\r\n  };\r\n\r\n  constructor(obj: { roaId: Address }) {\r\n    this.tag = 6;\r\n    this.roaId = addressCodec.encode(obj.roaId);\r\n  }\r\n\r\n  serialize(): Uint8Array {\r\n    return serialize(writeRoaInstruction.schema, this);\r\n  }\r\n\r\n  getInstruction(\r\n    programAddress: Address,\r\n    systemProgram: Address,\r\n    splNameServiceProgram: Address,\r\n    feePayer: Address,\r\n    record: Address,\r\n    domain: Address,\r\n    domainOwner: Address,\r\n    centralState: Address\r\n  ): IInstruction {\r\n    const data = this.serialize();\r\n\r\n    const accounts: IAccountMeta[] = [\r\n      {\r\n        address: systemProgram,\r\n        role: AccountRole.READONLY,\r\n      },\r\n      {\r\n        address: splNameServiceProgram,\r\n        role: AccountRole.READONLY,\r\n      },\r\n      {\r\n        address: feePayer,\r\n        role: AccountRole.WRITABLE_SIGNER,\r\n      },\r\n      {\r\n        address: record,\r\n        role: AccountRole.WRITABLE,\r\n      },\r\n      {\r\n        address: domain,\r\n        role: AccountRole.WRITABLE,\r\n      },\r\n      {\r\n        address: domainOwner,\r\n        role: AccountRole.WRITABLE_SIGNER,\r\n      },\r\n      {\r\n        address: centralState,\r\n        role: AccountRole.READONLY,\r\n      },\r\n    ];\r\n\r\n    return {\r\n      programAddress,\r\n      accounts,\r\n      data,\r\n    };\r\n  }\r\n}\r\n"],"names":["writeRoaInstruction","tag","roaId","static","struct","array","type","constructor","obj","this","addressCodec","encode","serialize","schema","getInstruction","programAddress","systemProgram","splNameServiceProgram","feePayer","record","domain","domainOwner","centralState","data","accounts","address","role","AccountRole","READONLY","WRITABLE_SIGNER","WRITABLE"],"mappings":"gIAWaA,EACXC,IACAC,MAEAC,cAAgB,CACdC,OAAQ,CACNH,IAAK,KACLC,MAAO,CAAEG,MAAO,CAAEC,KAAM,SAI5B,WAAAC,CAAYC,GACVC,KAAKR,IAAM,EACXQ,KAAKP,MAAQQ,EAAAA,aAAaC,OAAOH,EAAIN,OAGvC,SAAAU,GACE,OAAOA,YAAUZ,EAAoBa,OAAQJ,MAG/C,cAAAK,CACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAOd,KAAKG,YAiClB,MAAO,CACLG,iBACAS,SAjC+B,CAC/B,CACEC,QAAST,EACTU,KAAMC,EAAWA,YAACC,UAEpB,CACEH,QAASR,EACTS,KAAMC,EAAWA,YAACC,UAEpB,CACEH,QAASP,EACTQ,KAAMC,EAAWA,YAACE,iBAEpB,CACEJ,QAASN,EACTO,KAAMC,EAAWA,YAACG,UAEpB,CACEL,QAASL,EACTM,KAAMC,EAAWA,YAACG,UAEpB,CACEL,QAASJ,EACTK,KAAMC,EAAWA,YAACE,iBAEpB,CACEJ,QAASH,EACTI,KAAMC,EAAWA,YAACC,WAOpBL"}