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

Function tierAccountKey

tests/utils/basic-functions.ts:53–65  ·  view source on GitHub ↗
(
  app: web3.PublicKey,
  tierId: number
)

Source from the content-addressed store, hash-verified

51}
52
53export function tierAccountKey(
54 app: web3.PublicKey,
55 tierId: number
56): web3.PublicKey {
57 return web3.PublicKey.findProgramAddressSync(
58 [
59 Buffer.from("SUBSCRIPTION_TIER"),
60 app.toBuffer(),
61 new BN(tierId).toArrayLike(Buffer, "be", 1),
62 ],
63 global.program.programId
64 )[0]
65}
66
67export function subscriptionAccountKey(
68 subscriber: web3.PublicKey,

Callers 2

referrals.tsFile · 0.90
createGeneralScaffoldingFunction · 0.70

Calls 1

fromMethod · 0.80

Tested by

no test coverage detected