Documentation ¶
Index ¶
- Constants
- type AccessKeys
- type Client
- type Error
- type Event
- type InvoiceParams
- type LnTx
- type PayParams
- type Pywl
- type StatusType
- type TransferParams
- type Wal
- type Wallet
- func (w *Wallet) Details() (wal Wal, err error)
- func (w *Wallet) Invoice(params InvoiceParams) (lntx LnTx, err error)
- func (w *Wallet) Pay(params PayParams) (wtx Wtx, err error)
- func (w *Wallet) Transactions() (txs []Wtx, err error)
- func (w *Wallet) Transfer(params TransferParams) (wtx Wtx, err error)
- type WebhookPaywallConversion
- type WebhookPaywallCreated
- type WebhookWalletCreated
- type WebhookWalletInternalTransfer
- type WebhookWalletReceive
- type WebhookWalletSend
- type Wtx
- type WtxType
Constants ¶
const ( BASE_URL = "https://lnpay.co/v1" TEST_KEY = "pak_O0iUMxk8kK_qUzkT4YKFvp1ZsUtp" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccessKeys ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
NewClient is the first function you must call. Pass your main API key here. It will return a client you can later use to access wallets and transactions. You can find it at https://lnpay.co/developers/dashboard
func (*Client) CreateWallet ¶
CreateWallet creates a new wallet with a given descriptive label. It will return the wallet object which you can use to create invoices and payments. https://docs.lnpay.co/wallet/create-wallet
func (*Client) Transaction ¶
Transaction
type Error ¶
type InvoiceParams ¶
type InvoiceParams struct { Memo string `json:"memo"` // the invoice description. NumSatoshis int64 `json:"num_satoshis"` // the invoice amount. Expiry int64 `json:"expiry"` // seconds, default 86400 (1 day). // custom data you may want to associate with this invoice. optional. PassThru map[string]interface{} `json:"passThru"` // base64-encoded. If this is provided, memo will be ignored. // don't use this if you don't know what it means. DescriptionHash string `json:"description_hash"` }
type LnTx ¶
type LnTx struct { ID string `json:"id"` CreatedAt int `json:"created_at"` DestPubkey string `json:"dest_pubkey"` PaymentRequest string `json:"payment_request"` RHashDecoded string `json:"r_hash_decoded"` Memo string `json:"memo"` DescriptionHash string `json:"description_hash"` NumSatoshis int64 `json:"num_satoshis"` Expiry int `json:"expiry"` ExpiresAt int `json:"expires_at"` PaymentPreimage string `json:"payment_preimage"` Settled int `json:"settled"` SettledAt int `json:"settled_at"` IsKeysend bool `json:"is_keysend"` CustomRecords map[string]interface{} `json:"custom_records"` }
type Pywl ¶
type Pywl struct { DestinationURL string `json:"destination_url"` Memo string `json:"memo"` ShortURL string `json:"short_url"` NumSatoshis int64 `json:"lnd_value"` CreatedAt int `json:"created_at"` UpdatedAt int `json:"updated_at"` Metadata map[string]interface{} `json:"metadata"` ID string `json:"id"` PaywallLink string `json:"paywall_link"` CustyDomain struct { DomainName string `json:"domain_name"` } `json:"custyDomain"` StatusType StatusType `json:"statusType"` PaywallType struct { Name string `json:"name"` DisplayName string `json:"display_name"` Description string `json:"description"` } `json:"paywallType"` Template struct { Layout string `json:"layout"` } `json:"template"` LinkExpRule struct { Type string `json:"type"` Name string `json:"name"` DisplayName string `json:"display_name"` TimeMinutes int `json:"time_minutes"` } `json:"linkExpRule"` }
type StatusType ¶
type TransferParams ¶
type Wal ¶
type Wal struct { ID string `json:"id"` UserLabel string `json:"user_label"` CreatedAt int `json:"created_at"` UpdatedAt int `json:"updated_at"` Balance int64 `json:"balance"` StatusType StatusType `json:"statusType"` AccessKeys *AccessKeys `json:"accessKeys"` }
type Wallet ¶
func (*Wallet) Details ¶
Details returns basic information about a wallet, such as its id, label or balance. https://docs.lnpay.co/wallet/get-balance
func (*Wallet) Invoice ¶
func (w *Wallet) Invoice(params InvoiceParams) (lntx LnTx, err error)
Invoice creates an invoice associated with this wallet. https://docs.lnpay.co/wallet/generate-invoice
func (*Wallet) Pay ¶
Pay pays a given invoice with funds from the wallet. https://docs.lnpay.co/wallet/pay-invoice
func (*Wallet) Transactions ¶
Transactions returns a list of the transactions associated with the wallet. https://docs.lnpay.co/wallet/get-transactions
func (*Wallet) Transfer ¶
func (w *Wallet) Transfer(params TransferParams) (wtx Wtx, err error)
Transfer transfers between two lnpay.co wallets. https://docs.lnpay.co/wallet/transfers-between-wallets
type WebhookPaywallConversion ¶
type WebhookPaywallConversion struct { ID string `json:"id"` CreatedAt int `json:"created_at"` Event Event `json:"event"` Data struct { Pywl Pywl `json:"pywl"` Wtx Wtx `json:"wtx"` } `json:"data"` }
"paywall_conversion" webhook payload https://docs.lnpay.co/webhooks/getting-started#paywalls
type WebhookPaywallCreated ¶
type WebhookPaywallCreated struct { ID string `json:"id"` CreatedAt int `json:"created_at"` Event Event `json:"event"` Data struct { Pywl Pywl `json:"pywl"` } `json:"data"` }
"paywall_created" webhook payload https://docs.lnpay.co/webhooks/getting-started#paywalls
type WebhookWalletCreated ¶
type WebhookWalletCreated struct { CreatedAt int `json:"created_at"` ID string `json:"id"` Event Event `json:"event"` Data struct { Wal Wal `json:"wal"` } `json:"data"` }
"wallet_created" webhook payload https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletInternalTransfer ¶
type WebhookWalletInternalTransfer struct { ID string `json:"id"` CreatedAt int `json:"created_at"` Event Event `json:"event"` Data struct { Wtx Wtx `json:"wtx"` } `json:"data"` }
"wallet_receive" webhook payload https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletReceive ¶
type WebhookWalletReceive struct { CreatedAt int `json:"created_at"` ID string `json:"id"` Event Event `json:"event"` Data struct { Wtx Wtx `json:"wtx"` } `json:"data"` }
"wallet_transfer_IN/OUT" webhook payload https://docs.lnpay.co/webhooks/getting-started#payloads
type WebhookWalletSend ¶
type WebhookWalletSend struct { CreatedAt int `json:"created_at"` ID string `json:"id"` Event Event `json:"event"` Data struct { Wtx Wtx `json:"wtx"` } `json:"data"` }
"wallet_send" webhook payload https://docs.lnpay.co/webhooks/getting-started#payloads