remotesigning

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: Apache-2.0 Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeclineToSignMessages

func DeclineToSignMessages(client *services.LightsparkClient, event webhooks.WebhookEvent) (string, error)

func HandleDeriveKeyAndSignWebhook

func HandleDeriveKeyAndSignWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleEcdhWebhook

func HandleEcdhWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleGetPerCommitmentPointWebhook

func HandleGetPerCommitmentPointWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleReleaseInvoicePreimageWebhook

func HandleReleaseInvoicePreimageWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleReleasePerCommitmentSecretWebhook

func HandleReleasePerCommitmentSecretWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleRemoteSigningWebhook

func HandleRemoteSigningWebhook(
	client *services.LightsparkClient,
	validator Validator,
	webhook webhooks.WebhookEvent,
	seedBytes []byte,
) (string, error)

HandleRemoteSigningWebhook handles a webhook event that is related to remote signing.

This method should only be called with a webhook event that has the event_type `WebhookEventTypeRemoteSigning`. The method will call the appropriate handler for the sub_event_type of the webhook.

Args:

	client: The LightsparkClient used to respond to webhook events.
    validator: A validator for deciding whether to sign events.
	webhook: The webhook event that you want to handle.
	seedBytes: The bytes of the master seed that you want to use to sign messages or derive keys.

func HandleRequestInvoicePaymentHashWebhook

func HandleRequestInvoicePaymentHashWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

func HandleSignInvoiceWebhook

func HandleSignInvoiceWebhook(client *services.LightsparkClient, webhook webhooks.WebhookEvent, seedBytes []byte) (string, error)

Types

type PositiveValidator

type PositiveValidator struct{}

func (PositiveValidator) ShouldSign

type SigningJob

type SigningJob struct {
	Id             string  `json:"id"`
	DerivationPath string  `json:"derivation_path"`
	Message        string  `json:"message"`
	AddTweak       *string `json:"add_tweak"`
	MulTweak       *string `json:"mul_tweak"`
	IsRaw          bool    `json:"is_raw"`
}

func (*SigningJob) AddTweakBytes

func (j *SigningJob) AddTweakBytes() ([]byte, error)

func (*SigningJob) MessageBytes

func (j *SigningJob) MessageBytes() ([]byte, error)

func (*SigningJob) MulTweakBytes

func (j *SigningJob) MulTweakBytes() ([]byte, error)

type Validator

type Validator interface {
	ShouldSign(webhookEvent webhooks.WebhookEvent) bool
}

Validator an interface which decides whether to sign or reject a remote signing webhook event.

Jump to

Keyboard shortcuts

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