chargeclient

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: MIT, Apache-2.0, MIT Imports: 12 Imported by: 0

Documentation

Overview

Package chargeclient contains the Tempo charge client method for creating Payment Credentials that satisfy Tempo HTTP 402 Challenges. It is usually imported as charge alongside the generic client package.

Package chargeclient creates Tempo charge Credentials for MPP HTTP clients.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Signer signs Tempo transactions and proof payloads.
	Signer *temposigner.Signer
	// PrivateKey constructs Signer when Signer is nil.
	PrivateKey string
	// RPC overrides the Tempo JSON-RPC client used for signing flows.
	RPC tempo.RPCClient
	// RPCURL is used to build an RPC client when RPC is nil.
	RPCURL string
	// ChainID constrains the challenge to a specific Tempo chain when set.
	ChainID int64
	// ClientID is folded into automatically generated attribution memos.
	ClientID string
	// CredentialType selects transaction, hash, or proof credentials.
	CredentialType tempo.CredentialType
}

Config configures a Tempo charge client method.

type Method

type Method struct {
	// contains filtered or unexported fields
}

Method implements Tempo charge credential creation for the generic MPP client.

func New

func New(config Config) (*Method, error)

New constructs a Tempo charge client method.

func (*Method) CreateCredential

func (m *Method) CreateCredential(ctx context.Context, challenge *mpp.Challenge) (*mpp.Credential, error)

CreateCredential turns a Tempo charge Challenge into a Tempo Credential.

func (*Method) Name

func (m *Method) Name() string

Name returns the method token used in Challenges and Credentials.

Jump to

Keyboard shortcuts

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