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

Function findAppAddress

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

Source from the content-addressed store, hash-verified

32}
33
34export function findAppAddress(
35 auth: web3.PublicKey,
36 appId: number,
37 programId: web3.PublicKey
38) {
39 return web3.PublicKey.findProgramAddressSync(
40 [
41 Buffer.from("APP"),
42 auth.toBuffer(),
43 new BN(appId).toArrayLike(Buffer, "be", 1),
44 ],
45 programId
46 )
47}
48
49export function numberToAppId(appId: number): Buffer {
50 return new BN(appId).toArrayLike(Buffer, "be", 1)

Callers 1

referrals.tsFile · 0.90

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected