Documentation
¶
Index ¶
- Constants
- type BillingPolicy
- type BillingPolicyProto
- type CreditMetadata
- type EmailRequest
- type Fee
- type HashFunction
- type KeysignMessage
- type KeysignRequest
- type PluginID
- type PluginKeysignRequest
- type PluginPolicy
- type Pricing
- type PricingAsset
- type PricingCreateDataDto
- type PricingCreateDto
- type PricingFrequency
- type PricingMetric
- type PricingType
- type ReshareRequest
- type TxType
- type UserFeeStatus
Constants ¶
View Source
const ( FeeTypeInstallationFee = "installation_fee" FeeTypeTrial = "trial" FeeSubscriptionFee = "subscription_fee" FeeTxExecFee = "transaction_execution_fee" FeeTypeBatch = "batch" FeeTypeBatchFailed = "batch_failed" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BillingPolicy ¶
type BillingPolicy struct {
ID uuid.UUID `json:"id" validate:"required"`
Type PricingType `json:"type" validate:"required"`
Frequency *PricingFrequency `json:"frequency"`
StartDate time.Time `json:"start_date"` // Number of a month, e.g., "1" for the first month. Only allow 1 for now
Amount uint64 `json:"amount" validate:"required"` // Amount in the smallest unit, e.g., "1000000" for 0.01 VULTI
Asset string `json:"asset"` // The asset that the fee is denominated in, e.g., "usdc"
}
type BillingPolicyProto ¶
type BillingPolicyProto struct {
ID *uuid.UUID `json:"id" validate:"required"`
Type rtypes.FeeType `json:"type" validate:"required"`
Frequency rtypes.BillingFrequency `json:"frequency"`
StartDate time.Time `json:"start_date"` // Number of a month, e.g., "1" for the first month. Only allow 1 for now
Amount uint64 `json:"amount" validate:"required"` // Amount in the smallest unit, e.g., "1000000" for 0.01 VULTI
Asset string `json:"asset"` // The asset that the fee is denominated in, e.g., "usdc"
}
type CreditMetadata ¶
type EmailRequest ¶
type Fee ¶
type Fee struct {
ID uint64 `json:"id"` // The unique id of the fee incurred
PolicyID uuid.UUID `json:"policy_id"` // The policy ID that has incurred the fee
PublicKey string `json:"public_key"` // The public key "account" connected to the fee
TxType TxType `json:"transaction_type"`
Amount uint64 `json:"amount"` // The amount of the fee in the smallest unit, e.g., "1000000" for 0.01 VULTI
CreatedAt time.Time `json:"created_at"`
FeeType string `json:"fee_type"`
Metadata json.RawMessage `json:"metadata"`
UnderlyingType string `json:"underlying_type"`
UnderlyingID string `json:"underlying_id"`
}
type KeysignMessage ¶
type KeysignMessage struct {
TxIndexerID string `json:"tx_indexer_id"` // Tx indexer uuid
RawMessage string `json:"raw_message"` // Raw message, used to decode the transaction
Message string `json:"message"`
Hash string `json:"hash"`
HashFunction HashFunction `json:"hash_function"`
Chain vgcommon.Chain `json:"chain"`
}
type KeysignRequest ¶
type KeysignRequest struct {
PublicKey string `json:"public_key"` // public key, used to identify the backup file
Messages []KeysignMessage `json:"messages"`
SessionID string `json:"session"` // Session ID , it should be an UUID
HexEncryptionKey string `json:"hex_encryption_key"` // Hex encryption key, used to encrypt the keysign messages
Parties []string `json:"parties"` // parties to join the session
PluginID string `json:"plugin_id"` // plugin id
PolicyID uuid.UUID `json:"policy_id"` // policy id
}
func (KeysignRequest) IsValid ¶
func (r KeysignRequest) IsValid() error
IsValid checks if the keysign request is valid
type PluginID ¶
type PluginID string
const ( PluginVultisigDCA_0000 PluginID = "vultisig-dca-0000" PluginVultisigRecurringSends_0000 PluginID = "vultisig-recurring-sends-0000" PluginVultisigPayroll_0000 PluginID = "vultisig-payroll-0000" PluginVultisigFees_feee PluginID = "vultisig-fees-feee" PluginNBitsLabsMerkle_0000 PluginID = "nbits-labs-merkle-e93d" )
Each plugin must reserve a unique ID.
A plugin ID is comprised of a all-lowercase string, ending with 4 random hex digits.
Example: vultisig-dca-00a1
type PluginKeysignRequest ¶
type PluginKeysignRequest struct {
KeysignRequest
Transaction string `json:"transactions"`
TransactionType string `json:"transaction_type"`
}
func NewPluginKeysignRequestEvm ¶
func NewPluginKeysignRequestEvm(policy PluginPolicy, txToTrack string, chain vgcommon.Chain, tx []byte) ( *PluginKeysignRequest, error)
type PluginPolicy ¶
type PluginPolicy struct {
ID uuid.UUID `json:"id" validate:"required"`
PublicKey string `json:"public_key" validate:"required"`
PluginID PluginID `json:"plugin_id" validate:"required"`
PluginVersion string `json:"plugin_version" validate:"required"`
PolicyVersion int `json:"policy_version" validate:"required"`
Signature string `json:"signature" validate:"required"`
Recipe string `json:"recipe" validate:"required"` // base64 encoded recipe protobuf bytes
Billing []BillingPolicy `json:"billing" validate:"required"` // This will be populated later
Active bool `json:"active" validate:"required"`
}
This type should be used externally when creating or updating a plugin policy. It keeps the protobuf encoded billing recipe as a string which is used to verify a signature.
func (*PluginPolicy) ParseBillingFromRecipe ¶
func (p *PluginPolicy) ParseBillingFromRecipe() error
This is used to populate the Billing field of a PluginPolicy from the Recipe field. It does not validate this information against the plugin pricing.
type Pricing ¶
type Pricing struct {
ID uuid.UUID `json:"id" validate:"required"`
Type PricingType `json:"type" validate:"required"`
Frequency *PricingFrequency `json:"frequency,omitempty"`
Amount uint64 `json:"amount" validate:"gte=0"`
Asset PricingAsset `json:"asset" validate:"required"`
Metric PricingMetric `json:"metric" validate:"required"`
CreatedAt time.Time `json:"created_at" validate:"required"`
UpdatedAt time.Time `json:"updated_at" validate:"required"`
PluginID PluginID `json:"plugin_id" validate:"required"`
}
type PricingCreateDataDto ¶
type PricingCreateDataDto struct {
Type PricingType `json:"type" validate:"required"`
Frequency *PricingFrequency `json:"frequency,omitempty" validate:"omitempty"`
Amount uint64 `json:"amount" validate:"gte=0"`
Metric PricingMetric `json:"metric" validate:"required"`
}
type PricingCreateDto ¶
type PricingCreateDto struct {
PricingCreateDataDto
PluginID PluginID `json:"plugin_id" validate:"required"`
}
type PricingFrequency ¶
type PricingFrequency string
const ( PricingFrequencyDaily PricingFrequency = "daily" PricingFrequencyWeekly PricingFrequency = "weekly" PricingFrequencyBiweekly PricingFrequency = "biweekly" PricingFrequencyMonthly PricingFrequency = "monthly" )
type PricingType ¶
type PricingType string
const ( PricingTypeOnce PricingType = "once" PricingTypeRecurring PricingType = "recurring" PricingTypePerTx PricingType = "per-tx" )
type ReshareRequest ¶
type ReshareRequest struct {
}
ReshareRequest is a struct that represents a request to reshare a vault
func (*ReshareRequest) IsValid ¶
func (req *ReshareRequest) IsValid() error
Click to show internal directories.
Click to hide internal directories.