token_admin_registry

package
v0.0.0-...-fb0831a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 2, 2026 License: MIT Imports: 4 Imported by: 2 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const ContractType = "TokenAdminRegistry"

ContractType labels TokenAdminRegistry.

Variables

View Source
var AcceptAdminRole = cldfops.NewOperation(
	"token-admin-registry:accept-admin-role",
	stellarops.ContractDeploymentVersion,
	"Accepts administrator role for a token in TokenAdminRegistry",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in AcceptAdminRoleInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.AcceptAdminRole(b.GetContext(), in.LocalToken); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

AcceptAdminRole calls `accept_admin_role`.

View Source
var AcceptOwnership = cldfops.NewOperation(
	"token-admin-registry:accept-ownership",
	stellarops.ContractDeploymentVersion,
	"Accepts TokenAdminRegistry ownership after transfer_ownership",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in AcceptOwnershipInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.AcceptOwnership(b.GetContext()); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

AcceptOwnership calls `accept_ownership` on TokenAdminRegistry.

View Source
var Deploy = stellarops.NewDeployOperation("token-admin-registry:deploy", "Deploys the TokenAdminRegistry Soroban contract from WASM")

Deploy uploads token_admin_registry.wasm and runs its constructor.

View Source
var GetTokenConfig = cldfops.NewOperation(
	"token-admin-registry:get-token-config",
	stellarops.ContractDeploymentVersion,
	"Reads the token config (admin, pending admin, pool) for one token",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in GetTokenConfigInput) (*tarbindings.TokenConfig, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		return c.GetTokenConfig(b.GetContext(), in.LocalToken)
	},
)

GetTokenConfig reads the registry's admin/pending-admin/pool record for a token.

View Source
var ProposeAdministrator = cldfops.NewOperation(
	"token-admin-registry:propose-administrator",
	stellarops.ContractDeploymentVersion,
	"Proposes a token administrator in TokenAdminRegistry",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in ProposeAdministratorInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.ProposeAdministrator(b.GetContext(), in.Caller, in.LocalToken, in.Administrator); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

ProposeAdministrator calls `propose_administrator`.

View Source
var SetPool = cldfops.NewOperation(
	"token-admin-registry:set-pool",
	stellarops.ContractDeploymentVersion,
	"Sets the default pool for a token in TokenAdminRegistry",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in SetPoolInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.SetPool(b.GetContext(), in.LocalToken, in.Pool); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

SetPool calls `set_pool`.

View Source
var TransferAdminRole = cldfops.NewOperation(
	"token-admin-registry:transfer-admin-role",
	stellarops.ContractDeploymentVersion,
	"Transfers a token's admin role to a new admin in TokenAdminRegistry",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in TransferAdminRoleInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.TransferAdminRole(b.GetContext(), in.LocalToken, in.NewAdmin); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

TransferAdminRole calls `transfer_admin_role` (invoked by the current admin).

View Source
var TransferOwnership = cldfops.NewOperation(
	"token-admin-registry:transfer-ownership",
	stellarops.ContractDeploymentVersion,
	"Transfers TokenAdminRegistry ownership to a pending new owner",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in TransferOwnershipInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.TransferOwnership(b.GetContext(), in.NewOwner); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

TransferOwnership calls `transfer_ownership` on TokenAdminRegistry.

View Source
var Upgrade = cldfops.NewOperation(
	"token-admin-registry:upgrade",
	stellarops.ContractDeploymentVersion,
	"Upgrades the TokenAdminRegistry Soroban contract in place to a new WASM hash",
	func(b cldfops.Bundle, d stellardeps.StellarDeps, in UpgradeInput) (stellarops.Void, error) {
		c := tarbindings.NewTokenAdminRegistryClient(d.Invoker, in.ContractID)
		if err := c.Upgrade(b.GetContext(), in.NewWasmHash); err != nil {
			return stellarops.Void{}, err
		}
		return stellarops.Void{}, nil
	},
)

Upgrade calls `upgrade` on TokenAdminRegistry (owner-gated in-place self-upgrade).

Functions

This section is empty.

Types

type AcceptAdminRoleInput

type AcceptAdminRoleInput struct {
	ContractID string `json:"contract_id"`
	LocalToken string `json:"local_token"`
}

AcceptAdminRoleInput accepts the proposed admin role for a token.

type AcceptOwnershipInput

type AcceptOwnershipInput struct {
	ContractID string `json:"contract_id"`
}

AcceptOwnershipInput completes two-step ownership transfer for the caller.

type GetTokenConfigInput

type GetTokenConfigInput struct {
	ContractID string `json:"contract_id"`
	LocalToken string `json:"local_token"`
}

GetTokenConfigInput identifies a token admin registry token config read.

type ProposeAdministratorInput

type ProposeAdministratorInput struct {
	ContractID    string `json:"contract_id"`
	Caller        string `json:"caller"`
	LocalToken    string `json:"local_token"`
	Administrator string `json:"administrator"`
}

ProposeAdministratorInput proposes a token administrator.

type SetPoolInput

type SetPoolInput struct {
	ContractID string  `json:"contract_id"`
	LocalToken string  `json:"local_token"`
	Pool       *string `json:"pool,omitempty"`
}

SetPoolInput registers the default pool for a token.

type TransferAdminRoleInput

type TransferAdminRoleInput struct {
	ContractID string  `json:"contract_id"`
	LocalToken string  `json:"local_token"`
	NewAdmin   *string `json:"new_admin,omitempty"`
}

TransferAdminRoleInput transfers a token's admin role to a new admin.

type TransferOwnershipInput

type TransferOwnershipInput struct {
	ContractID string `json:"contract_id"`
	NewOwner   string `json:"new_owner"`
}

TransferOwnershipInput starts two-step ownership transfer.

type UpgradeInput

type UpgradeInput struct {
	ContractID  string   `json:"contract_id"`
	NewWasmHash [32]byte `json:"new_wasm_hash"`
}

UpgradeInput upgrades the TokenAdminRegistry contract in place to a new Wasm hash.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL