Hierarchy

  • ProfileVault

Implements

  • Account

Constructors

  • Parameters

    • _data: AnchorTypeDef<{
          docs: ["An authority over vaults for a profile"];
          name: "vaultAuthority";
          type: {
              fields: [{
                  docs: ["The data version of this account."];
                  name: "version";
                  type: "u8";
              }, {
                  docs: ["The profile the authority is for"];
                  name: "profile";
                  type: "publicKey";
              }, {
                  docs: ["The seed of this authority"];
                  name: "vaultSeed";
                  type: "publicKey";
              }, {
                  docs: ["The bump for this authority"];
                  name: "vaultBump";
                  type: "u8";
              }];
              kind: "struct";
          };
      } & {
          name: "vaultAuthority";
      }, AnchorDefined<ProfileVaultIDL, Record<string, never>>>
    • _key: PublicKey

    Returns ProfileVault

Properties

ACCOUNT_NAME: "vaultAuthority" = 'vaultAuthority'
MIN_DATA_SIZE: number = PROFILE_VAULT_MIN_DATA_SIZE

Accessors

  • get data(): Readonly<AnchorTypeDef<{
        docs: ["An authority over vaults for a profile"];
        name: "vaultAuthority";
        type: {
            fields: [{
                docs: ["The data version of this account."];
                name: "version";
                type: "u8";
            }, {
                docs: ["The profile the authority is for"];
                name: "profile";
                type: "publicKey";
            }, {
                docs: ["The seed of this authority"];
                name: "vaultSeed";
                type: "publicKey";
            }, {
                docs: ["The bump for this authority"];
                name: "vaultBump";
                type: "u8";
            }];
            kind: "struct";
        };
    } & {
        name: "vaultAuthority";
    }, AnchorDefined<ProfileVaultIDL, Record<string, never>>>>
  • Returns Readonly<AnchorTypeDef<{
        docs: ["An authority over vaults for a profile"];
        name: "vaultAuthority";
        type: {
            fields: [{
                docs: ["The data version of this account."];
                name: "version";
                type: "u8";
            }, {
                docs: ["The profile the authority is for"];
                name: "profile";
                type: "publicKey";
            }, {
                docs: ["The seed of this authority"];
                name: "vaultSeed";
                type: "publicKey";
            }, {
                docs: ["The bump for this authority"];
                name: "vaultBump";
                type: "u8";
            }];
            kind: "struct";
        };
    } & {
        name: "vaultAuthority";
    }, AnchorDefined<ProfileVaultIDL, Record<string, never>>>>

  • get key(): Readonly<PublicKey>
  • Returns Readonly<PublicKey>

Methods

  • Closes a vault, transferring all remaining tokens

    Parameters

    • program: ProfileVaultIDLProgram

      the profile vault program

    • vault: PublicKey

      the profile vault

    • vaultAuthority: PublicKey

      the vault's authority

    • tokensTo: PublicKey

      the address to receive tokens in vault

    • fundsTo: "funder" | PublicKey

      the account to receive rent refund

    • keyInput: ProfileKeyInput<VaultPermissions, AsyncSigner<unknown>>

      The key to use to sign the transaction

    • Optional optionalProfilesOrRoles: OptionalProfileOrRoleInput[]

      Optional profiles or roles to add to the transaction to authorize transaction.

    Returns InstructionReturn

    InstructionReturn

  • Create a new vault

    Parameters

    • program: ProfileVaultIDLProgram

      the profile vault program

    • vaultSeed: PublicKey

      the vault seed

    • keyInput: ProfileKeyInput<VaultPermissions, AsyncSigner<unknown>>

      The key to use to sign the transaction

    • Optional optionalProfilesOrRoles: OptionalProfileOrRoleInput[]

      Optional profiles or roles to add to the transaction to authorize transaction.

    Returns {
        instructions: InstructionReturn;
        vaultSigner: [PublicKey, number];
    }

    InstructionReturn

    • instructions: InstructionReturn
    • vaultSigner: [PublicKey, number]
  • Drains tokens out of a vault

    Parameters

    • program: ProfileVaultIDLProgram

      the profile vault program

    • vault: PublicKey

      the profile vault

    • vaultAuthority: PublicKey

      the vault's authority

    • tokensTo: PublicKey

      the address to receive drained tokens

    • amount: BN

      the amount of tokens to drain

    • keyInput: ProfileKeyInput<VaultPermissions, AsyncSigner<unknown>>

      The key to use to sign the transaction

    • Optional optionalProfilesOrRoles: OptionalProfileOrRoleInput[]

      Optional profiles or roles to add to the transaction to authorize transaction.

    Returns InstructionReturn

    InstructionReturn

  • Find the PDA of a vault signer

    Parameters

    • program: ProfileVaultIDLProgram

      the profile vault program

    • profile: PublicKey

      the player profile account address

    • vaultSeed: PublicKey

      the vault seed

    Returns [PublicKey, number]

    PDA & Bump

Generated using TypeDoc