github.com/gagliardetto/solana-go@v1.11.0/programs/token/types.go (about)

     1  // Copyright 2021 github.com/gagliardetto
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package token
    16  
    17  import (
    18  	ag_binary "github.com/gagliardetto/binary"
    19  )
    20  
    21  type AuthorityType ag_binary.BorshEnum
    22  
    23  const (
    24  	// Authority to mint new tokens
    25  	AuthorityMintTokens AuthorityType = iota
    26  
    27  	// Authority to freeze any account associated with the Mint
    28  	AuthorityFreezeAccount
    29  
    30  	// Owner of a given token account
    31  	AuthorityAccountOwner
    32  
    33  	// Authority to close a token account
    34  	AuthorityCloseAccount
    35  )
    36  
    37  type AccountState ag_binary.BorshEnum
    38  
    39  const (
    40  	// Account is not yet initialized
    41  	Uninitialized AccountState = iota
    42  
    43  	// Account is initialized; the account owner and/or delegate may perform permitted operations
    44  	// on this account
    45  	Initialized
    46  
    47  	// Account has been frozen by the mint freeze authority. Neither the account owner nor
    48  	// the delegate are able to perform operations on this account.
    49  	Frozen
    50  )