{"version":3,"file":"validateRoaEthereumInstruction.cjs","sources":["../../../src/instructions/validateRoaEthereumInstruction.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\nexport class validateRoaEthereumInstruction {\r\n  tag: number;\r\n  validation: number;\r\n  signature: ReadonlyUint8Array;\r\n  expectedPubkey: ReadonlyUint8Array;\r\n\r\n  static schema = {\r\n    struct: {\r\n      tag: \"u8\",\r\n      validation: \"u8\",\r\n      signature: { array: { type: \"u8\" } },\r\n      expectedPubkey: { array: { type: \"u8\" } },\r\n    },\r\n  };\r\n\r\n  constructor(obj: {\r\n    validation: number;\r\n    signature: ReadonlyUint8Array;\r\n    expectedPubkey: ReadonlyUint8Array;\r\n  }) {\r\n    this.tag = 4;\r\n    this.validation = obj.validation;\r\n    this.signature = obj.signature;\r\n    this.expectedPubkey = obj.expectedPubkey;\r\n  }\r\n\r\n  serialize(): Uint8Array {\r\n    return serialize(validateRoaEthereumInstruction.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":["validateRoaEthereumInstruction","tag","validation","signature","expectedPubkey","static","struct","array","type","constructor","obj","this","serialize","schema","getInstruction","programAddress","systemProgram","splNameServiceProgram","feePayer","record","domain","domainOwner","centralState","data","accounts","address","role","AccountRole","READONLY","WRITABLE_SIGNER","WRITABLE"],"mappings":"qGASaA,EACXC,IACAC,WACAC,UACAC,eAEAC,cAAgB,CACdC,OAAQ,CACNL,IAAK,KACLC,WAAY,KACZC,UAAW,CAAEI,MAAO,CAAEC,KAAM,OAC5BJ,eAAgB,CAAEG,MAAO,CAAEC,KAAM,SAIrC,WAAAC,CAAYC,GAKVC,KAAKV,IAAM,EACXU,KAAKT,WAAaQ,EAAIR,WACtBS,KAAKR,UAAYO,EAAIP,UACrBQ,KAAKP,eAAiBM,EAAIN,eAG5B,SAAAQ,GACE,OAAOA,YAAUZ,EAA+Ba,OAAQF,MAG1D,cAAAG,CACEC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAOZ,KAAKC,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"}