MCPcopy Create free account
hub / github.com/Unboxed-Software/anchor-subscriptions / appAccountKey

Function appAccountKey

tests/utils/basic-functions.ts:20–32  ·  view source on GitHub ↗
(
  auth: web3.PublicKey,
  appId: number
)

Source from the content-addressed store, hash-verified

18}
19
20export function appAccountKey(
21 auth: web3.PublicKey,
22 appId: number
23): web3.PublicKey {
24 return web3.PublicKey.findProgramAddressSync(
25 [
26 Buffer.from("APP"),
27 auth.toBuffer(),
28 new BN(appId).toArrayLike(Buffer, "be", 1),
29 ],
30 global.program.programId
31 )[0]
32}
33
34export function findAppAddress(
35 auth: web3.PublicKey,

Callers 1

createGeneralScaffoldingFunction · 0.70

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected