Documentation
¶
Index ¶
- type Rewards
- func (r *Rewards) CreateReward(ctx context.Context, cr *v1.CreateReward, deadlineBlockHeight int64) (*v1.GetRewardResponse, error)
- func (r *Rewards) CreateRewardPool(ctx context.Context, msg *v1.CreateRewardPool, rmKey ed25519.PrivateKey, ...) (string, error)
- func (r *Rewards) DeleteReward(ctx context.Context, dr *v1.DeleteReward, deadlineBlockHeight int64) (string, error)
- func (r *Rewards) GetDeleteRewardSenderAttestation(ctx context.Context, addr string, rewardsManagerPubkey string) (*v1.GetDeleteRewardSenderAttestationResponse, error)
- func (r *Rewards) GetReward(ctx context.Context, address string) (*v1.GetRewardResponse, error)
- func (r *Rewards) GetRewardAttestation(ctx context.Context, req *v1.GetRewardAttestationRequest) (*v1.GetRewardAttestationResponse, error)
- func (r *Rewards) GetRewardPool(ctx context.Context, rewardsManagerPubkey string) (*v1.GetRewardPoolResponse, error)
- func (r *Rewards) GetRewardSenderAttestation(ctx context.Context, addr string, rewardsManagerPubkey string) (*v1.GetRewardSenderAttestationResponse, error)
- func (r *Rewards) GetRewards(ctx context.Context, claim_authority string) (*v1.GetRewardsResponse, error)
- func (r *Rewards) SetPrivKey(privKey *ecdsa.PrivateKey)
- func (r *Rewards) SetRewardPoolAuthorities(ctx context.Context, msg *v1.SetRewardPoolAuthorities, ...) (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Rewards ¶
type Rewards struct {
// contains filtered or unexported fields
}
func NewRewards ¶
func NewRewards(core corev1connect.CoreServiceClient) *Rewards
func (*Rewards) CreateReward ¶
func (r *Rewards) CreateReward(ctx context.Context, cr *v1.CreateReward, deadlineBlockHeight int64) (*v1.GetRewardResponse, error)
func (*Rewards) CreateRewardPool ¶ added in v1.2.13
func (r *Rewards) CreateRewardPool(ctx context.Context, msg *v1.CreateRewardPool, rmKey ed25519.PrivateKey, deadlineBlockHeight int64) (string, error)
CreateRewardPool submits a CreateRewardPool transaction. The pool is keyed by msg.RewardsManagerPubkey (the Solana reward manager pubkey it will govern, base58 32 bytes); subsequent SetRewardPoolAuthorities / CreateReward calls reference the pool by this same value.
rmKey is the ed25519 PRIVATE key whose public key is msg.RewardsManagerPubkey — i.e., the Solana RM state account's keypair. For launchpad-minted coins, the relay derives this from (launchpadDeterministicSecret, mint). The validator requires the envelope-level rm_owner_signature to verify against msg.RewardsManagerPubkey, so possession of the matching ed25519 secret is the proof-of-RM-control that defeats pool-creation frontrunning.
Returns the cometbft tx hash.
func (*Rewards) DeleteReward ¶
func (*Rewards) GetDeleteRewardSenderAttestation ¶ added in v1.2.13
func (r *Rewards) GetDeleteRewardSenderAttestation(ctx context.Context, addr string, rewardsManagerPubkey string) (*v1.GetDeleteRewardSenderAttestationResponse, error)
GetDeleteRewardSenderAttestation is the inverse of GetRewardSenderAttestation: the validator signs an attestation authorizing the removal of addr as a sender on the Solana RM. For pool-managed RMs, the validator signs iff addr ∉ pool.authorities (proving OAP-side rotation already happened). Used to deregister leaked / rotated-out keys from Solana.
func (*Rewards) GetRewardAttestation ¶
func (r *Rewards) GetRewardAttestation(ctx context.Context, req *v1.GetRewardAttestationRequest) (*v1.GetRewardAttestationResponse, error)
func (*Rewards) GetRewardPool ¶ added in v1.2.13
func (r *Rewards) GetRewardPool(ctx context.Context, rewardsManagerPubkey string) (*v1.GetRewardPoolResponse, error)
GetRewardPool fetches a pool by its rewards_manager_pubkey (Solana RM pubkey, base58, 32 bytes).
func (*Rewards) GetRewardSenderAttestation ¶ added in v1.2.13
func (r *Rewards) GetRewardSenderAttestation(ctx context.Context, addr string, rewardsManagerPubkey string) (*v1.GetRewardSenderAttestationResponse, error)
GetRewardSenderAttestation requests an attestation that the validator will sign authorizing addr to be added as a sender on the Solana reward manager account identified by rewardsManagerPubkey. For pool-managed RMs, the validator signs iff addr ∈ pool.authorities; for unmanaged RMs (notably AUDIO), the validator falls back to its validator/AAO trust set. The returned attestation is meant to be combined with attestations from other validators and submitted to Solana via CreateSenderPublic.
func (*Rewards) GetRewards ¶
func (*Rewards) SetPrivKey ¶
func (r *Rewards) SetPrivKey(privKey *ecdsa.PrivateKey)
func (*Rewards) SetRewardPoolAuthorities ¶ added in v1.2.13
func (r *Rewards) SetRewardPoolAuthorities(ctx context.Context, msg *v1.SetRewardPoolAuthorities, deadlineBlockHeight int64) (string, error)
SetRewardPoolAuthorities replaces the pool's authority set wholesale. The caller composes the desired list (current minus the one to remove, current plus the one to add, etc.); add and remove are derived views. No RM keypair signature is needed — rotation is gated by signer ∈ current pool authorities, by design (the launchpad needn't be online to rotate).