{"version":3,"file":"reallocInstruction.cjs","sources":["../../../src/instructions/reallocInstruction.ts"],"sourcesContent":["import { AccountRole, Address, IAccountMeta, IInstruction } from \"@solana/kit\";\r\nimport { serialize } from \"borsh\";\r\n\r\nexport class ReallocInstruction {\r\n  tag: number;\r\n  space: number;\r\n\r\n  static schema = {\r\n    struct: {\r\n      tag: \"u8\",\r\n      space: \"u32\",\r\n    },\r\n  };\r\n\r\n  constructor(obj: { space: number }) {\r\n    this.tag = 4;\r\n    this.space = obj.space;\r\n  }\r\n\r\n  serialize(): Uint8Array {\r\n    return serialize(ReallocInstruction.schema, this);\r\n  }\r\n\r\n  getInstruction(\r\n    programAddress: Address,\r\n    systemProgramId: Address,\r\n    payerKey: Address,\r\n    nameAccountKey: Address,\r\n    nameOwnerKey: Address\r\n  ): IInstruction {\r\n    const data = this.serialize();\r\n\r\n    const accounts: IAccountMeta[] = [\r\n      {\r\n        address: systemProgramId,\r\n        role: AccountRole.READONLY,\r\n      },\r\n      {\r\n        address: payerKey,\r\n        role: AccountRole.WRITABLE_SIGNER,\r\n      },\r\n      {\r\n        address: nameAccountKey,\r\n        role: AccountRole.WRITABLE,\r\n      },\r\n      {\r\n        address: nameOwnerKey,\r\n        role: AccountRole.READONLY_SIGNER,\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":["ReallocInstruction","tag","space","static","struct","constructor","obj","this","serialize","schema","getInstruction","programAddress","systemProgramId","payerKey","nameAccountKey","nameOwnerKey","data","accounts","address","role","AccountRole","READONLY","WRITABLE_SIGNER","WRITABLE","READONLY_SIGNER"],"mappings":"qGAGaA,EACXC,IACAC,MAEAC,cAAgB,CACdC,OAAQ,CACNH,IAAK,KACLC,MAAO,QAIX,WAAAG,CAAYC,GACVC,KAAKN,IAAM,EACXM,KAAKL,MAAQI,EAAIJ,MAGnB,SAAAM,GACE,OAAOA,YAAUR,EAAmBS,OAAQF,MAG9C,cAAAG,CACEC,EACAC,EACAC,EACAC,EACAC,GAEA,MAAMC,EAAOT,KAAKC,YAqBlB,MAAO,CACLG,iBACAM,SArB+B,CAC/B,CACEC,QAASN,EACTO,KAAMC,EAAWA,YAACC,UAEpB,CACEH,QAASL,EACTM,KAAMC,EAAWA,YAACE,iBAEpB,CACEJ,QAASJ,EACTK,KAAMC,EAAWA,YAACG,UAEpB,CACEL,QAASH,EACTI,KAAMC,EAAWA,YAACI,kBAOpBR"}