Models
spl.token.models
Pydantic models for SPL token types.
AccountInfo
Information about an account.
Source code in src/spl/token/models.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | |
amount
instance-attribute
Amount of tokens this account holds.
close_authority
instance-attribute
Optional authority to close the account.
delegate
instance-attribute
The delegate for this account.
delegated_amount
instance-attribute
The amount of tokens the delegate authorized to the delegate.
is_frozen
instance-attribute
Is this account frozen.
is_initialized
instance-attribute
Is this account initialized.
is_native
instance-attribute
Is this a native token account.
mint
instance-attribute
The mint associated with this account.
owner
instance-attribute
Owner of this account.
rent_exempt_reserve
instance-attribute
If this account is a native token, it must be rent-exempt.
This value logs the rent-exempt reserve which must remain in the balance until the account is closed.
AmountToUiAmountParams
AmountToUiAmount token transaction params.
Source code in src/spl/token/models.py
480 481 482 483 484 485 486 487 488 | |
amount
instance-attribute
Amount of tokens to reformat.
mint
instance-attribute
Mint to use for conversion.
program_id
instance-attribute
SPL Token program account.
ApproveCheckedParams
ApproveChecked token transaction params.
Source code in src/spl/token/models.py
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 | |
amount
instance-attribute
Maximum number of tokens the delegate may transfer.
decimals
instance-attribute
Amount decimals.
delegate
instance-attribute
Delegate account authorized to perform a transfer of tokens from the source account.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the source account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig.
source
instance-attribute
Source account.
ApproveParams
Approve token transaction params.
Source code in src/spl/token/models.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 | |
amount
instance-attribute
Maximum number of tokens the delegate may transfer.
delegate
instance-attribute
Delegate account authorized to perform a transfer of tokens from the source account.
owner
instance-attribute
Owner of the source account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig.
source
instance-attribute
Source account.
AuthorityType
Specifies the authority type for SetAuthority instructions.
Source code in src/spl/token/models.py
13 14 15 16 17 18 19 20 21 22 23 | |
ACCOUNT_OWNER = 2
class-attribute
instance-attribute
Owner of a given token account.
CLOSE_ACCOUNT = 3
class-attribute
instance-attribute
Authority to close a token account.
FREEZE_ACCOUNT = 1
class-attribute
instance-attribute
Authority to freeze any account associated with the Mint.
MINT_TOKENS = 0
class-attribute
instance-attribute
"Authority to mint new tokens.
BurnCheckedParams
BurnChecked token transaction params.
Source code in src/spl/token/models.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 | |
account
instance-attribute
Account to burn tokens from.
amount
instance-attribute
Amount to burn.
decimals
instance-attribute
Amount decimals.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig
BurnParams
Burn token transaction params.
Source code in src/spl/token/models.py
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |
account
instance-attribute
Account to burn tokens from.
amount
instance-attribute
Amount to burn.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig
CloseAccountParams
Close token account transaction params.
Source code in src/spl/token/models.py
268 269 270 271 272 273 274 275 276 277 278 279 280 | |
account
instance-attribute
Address of account to close.
dest
instance-attribute
Address of account to receive the remaining balance of the closed account.
owner
instance-attribute
Owner of the account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig
FreezeAccountParams
Freeze token account transaction params.
Source code in src/spl/token/models.py
283 284 285 286 287 288 289 290 291 292 293 294 295 | |
account
instance-attribute
Account to freeze.
authority
instance-attribute
Mint freeze authority
mint
instance-attribute
Public key of the minter account.
multi_signers = []
class-attribute
instance-attribute
Signing accounts if authority is a multiSig
program_id
instance-attribute
SPL Token program account.
GetAccountDataSizeParams
GetAccountDataSize token transaction params.
Source code in src/spl/token/models.py
402 403 404 405 406 407 408 | |
mint
instance-attribute
Mint to calculate account size for.
program_id
instance-attribute
SPL Token program account.
HarvestWithheldTokensToMintParams
HarvestWithheldTokensToMint token transaction params.
Source code in src/spl/token/models.py
469 470 471 472 473 474 475 476 477 | |
mint
instance-attribute
Mint to harvest withheld tokens to.
program_id
instance-attribute
SPL Token 2022 program account.
sources = []
class-attribute
instance-attribute
Token accounts to harvest withheld tokens from.
InitializeAccount2Params
Initialize token account transaction params with owner in instruction data.
Source code in src/spl/token/models.py
118 119 120 121 122 123 124 125 126 127 128 | |
account
instance-attribute
Public key of the new account.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the new account.
program_id
instance-attribute
SPL Token program account.
InitializeAccount3Params
Initialize token account transaction params with owner in instruction data and no Rent sysvar.
Source code in src/spl/token/models.py
131 132 133 134 135 136 137 138 139 140 141 | |
account
instance-attribute
Public key of the new account.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the new account.
program_id
instance-attribute
SPL Token program account.
InitializeAccountParams
Initialize token account transaction params.
Source code in src/spl/token/models.py
105 106 107 108 109 110 111 112 113 114 115 | |
account
instance-attribute
Public key of the new account.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the new account.
program_id
instance-attribute
SPL Token program account.
InitializeImmutableOwnerParams
InitializeImmutableOwner token transaction params.
Source code in src/spl/token/models.py
411 412 413 414 415 416 417 | |
account
instance-attribute
Token account to initialize immutable owner for.
program_id
instance-attribute
SPL Token program account.
InitializeMint2Params
Initialize token mint transaction params without Rent sysvar.
Source code in src/spl/token/models.py
90 91 92 93 94 95 96 97 98 99 100 101 102 | |
decimals
instance-attribute
Number of base 10 digits to the right of the decimal place.
freeze_authority = None
class-attribute
instance-attribute
The freeze authority/multisignature of the mint.
mint
instance-attribute
Public key of the minter account.
mint_authority
instance-attribute
The authority/multisignature to mint tokens.
program_id
instance-attribute
SPL Token program account.
InitializeMintParams
Initialize token mint transaction params.
Source code in src/spl/token/models.py
75 76 77 78 79 80 81 82 83 84 85 86 87 | |
decimals
instance-attribute
Number of base 10 digits to the right of the decimal place.
freeze_authority = None
class-attribute
instance-attribute
The freeze authority/multisignature of the mint.
mint
instance-attribute
Public key of the minter account.
mint_authority
instance-attribute
The authority/multisignature to mint tokens.
program_id
instance-attribute
SPL Token program account.
InitializeMultisig2Params
Initialize multisig token account transaction params without Rent sysvar.
Source code in src/spl/token/models.py
157 158 159 160 161 162 163 164 165 166 167 | |
m
instance-attribute
The number of signers (M) required to validate this multisignature account.
multisig
instance-attribute
New multisig account address.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Addresses of multisig signers.
InitializeMultisigParams
Initialize multisig token account transaction params.
Source code in src/spl/token/models.py
144 145 146 147 148 149 150 151 152 153 154 | |
m
instance-attribute
The number of signers (M) required to validate this multisignature account.
multisig
instance-attribute
New multisig account address.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Addresses of multisig signers.
InitializeTransferFeeConfigParams
InitializeTransferFeeConfig token transaction params.
Source code in src/spl/token/models.py
420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 | |
maximum_fee
instance-attribute
Maximum fee assessed on transfers.
mint
instance-attribute
Mint to initialize transfer fee config for.
program_id
instance-attribute
SPL Token 2022 program account.
transfer_fee_basis_points
instance-attribute
Amount of transfer collected as fees, expressed in basis points.
transfer_fee_config_authority
instance-attribute
Authority that may update the transfer fee config.
withdraw_withheld_authority
instance-attribute
Authority that may withdraw withheld tokens.
MintInfo
Information about the mint.
Source code in src/spl/token/models.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
decimals
instance-attribute
Number of base 10 digits to the right of the decimal place.
freeze_authority
instance-attribute
Optional authority to freeze token accounts.
is_initialized
instance-attribute
Is this mint initialized.
mint_authority
instance-attribute
"Optional authority used to mint new tokens.
The mint authority may only be provided during mint creation. If no mint authority is present then the mint has a fixed supply and no further tokens may be minted.
supply
instance-attribute
Total supply of tokens.
MintToCheckedParams
MintToChecked token transaction params.
Source code in src/spl/token/models.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 | |
amount
instance-attribute
Amount to mint.
decimals
instance-attribute
Amount decimals.
dest
instance-attribute
Public key of the account to mint to.
mint
instance-attribute
Public key of the minter account.
mint_authority
instance-attribute
The mint authority.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if mint_authority is a multiSig.
MintToParams
Mint token transaction params.
Source code in src/spl/token/models.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |
amount
instance-attribute
Amount to mint.
dest
instance-attribute
Public key of the account to mint to.
mint
instance-attribute
Public key of the minter account.
mint_authority
instance-attribute
The mint authority.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if mint_authority is a multiSig.
RevokeParams
Revoke token transaction params.
Source code in src/spl/token/models.py
204 205 206 207 208 209 210 211 212 213 214 | |
account
instance-attribute
Source account for which transfer authority is being revoked.
owner
instance-attribute
Owner of the source account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig.
SetAuthorityParams
Set token authority transaction params.
Source code in src/spl/token/models.py
217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 | |
account
instance-attribute
Public key of the token account.
authority
instance-attribute
The type of authority to update.
current_authority
instance-attribute
Current authority of the specified type.
new_authority = None
class-attribute
instance-attribute
New authority of the account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if current_authority is a multiSig.
SyncNativeParams
SyncNative token transaction params.
Source code in src/spl/token/models.py
393 394 395 396 397 398 399 | |
account
instance-attribute
Account to sync.
program_id
instance-attribute
SPL Token program account.
ThawAccountParams
Thaw token account transaction params.
Source code in src/spl/token/models.py
298 299 300 301 302 303 304 305 306 307 308 309 310 | |
account
instance-attribute
Account to thaw.
authority
instance-attribute
Mint freeze authority
mint
instance-attribute
Public key of the minter account.
multi_signers = []
class-attribute
instance-attribute
Signing accounts if authority is a multiSig
program_id
instance-attribute
SPL Token program account.
TransferCheckedParams
TransferChecked token transaction params.
Source code in src/spl/token/models.py
313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 | |
amount
instance-attribute
Number of tokens to transfer.
decimals
instance-attribute
Amount decimals.
dest
instance-attribute
Destination account.
mint
instance-attribute
Public key of the minter account.
owner
instance-attribute
Owner of the source account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig.
source
instance-attribute
Source account.
TransferParams
Transfer token transaction params.
Source code in src/spl/token/models.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 | |
amount
instance-attribute
Number of tokens to transfer.
dest
instance-attribute
Destination account.
owner
instance-attribute
Owner of the source account.
program_id
instance-attribute
SPL Token program account.
signers = []
class-attribute
instance-attribute
Signing accounts if owner is a multiSig.
source
instance-attribute
Source account.
UiAmountToAmountParams
UiAmountToAmount token transaction params.
Source code in src/spl/token/models.py
491 492 493 494 495 496 497 498 499 | |
mint
instance-attribute
Mint to use for conversion.
program_id
instance-attribute
SPL Token program account.
ui_amount
instance-attribute
The ui_amount string to convert.
WithdrawWithheldTokensFromAccountsParams
WithdrawWithheldTokensFromAccounts token transaction params.
Source code in src/spl/token/models.py
437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 | |
authority
instance-attribute
Withdraw withheld authority.
dest
instance-attribute
Fee receiver token account.
mint
instance-attribute
Mint that includes the TransferFeeConfig extension.
program_id
instance-attribute
SPL Token 2022 program account.
signers = []
class-attribute
instance-attribute
Signing accounts if authority is a multiSig.
sources = []
class-attribute
instance-attribute
Token accounts to withdraw withheld tokens from.
WithdrawWithheldTokensFromMintParams
WithdrawWithheldTokensFromMint token transaction params.
Source code in src/spl/token/models.py
454 455 456 457 458 459 460 461 462 463 464 465 466 | |
authority
instance-attribute
Withdraw withheld authority.
dest
instance-attribute
Fee receiver token account.
mint
instance-attribute
Mint that includes the TransferFeeConfig extension.
program_id
instance-attribute
SPL Token 2022 program account.
signers = []
class-attribute
instance-attribute
Signing accounts if authority is a multiSig.