class LNURL

Public Instance Methods

create(data) click to toggle source

Create Lightning URL & LN address

  • Required Function Parameters:

    data: {
          identifier: string,
          identifierType: string,
          customerEmail: string,
          tld: string,
          image: string   #jpg,png,svg url link
          description: string,
          satMinSendable: int
          satMaxSendable: int
          }
# File lib/bitnob/objects/lnurl.rb, line 24
def create(data)
    required_parameters = %w[identifier identifierType tld image customerEmail description satMinSendable satMaxSendable]

    checked_passed_parameters(required_parameters, data)
    payload = data.to_json
    post_request("#{base_url}#{BaseEndpoints::LNURL}", payload)
end
decode_ln_address(data) click to toggle source

DECODE LN ADDRESS

  • Required Function Parameters:

    data: {
    
          lnAddress: string,
          }
# File lib/bitnob/objects/lnurl.rb, line 88
def decode_ln_address(data)
    required_parameters = %w[lnAddress]
    checked_passed_parameters(required_parameters, data)
    payload = data.to_json
    post_request("#{base_url}#{BaseEndpoints::LNURL}/decodelnaddress", payload)
end
decode_lnurl(encoded_ln_url) click to toggle source

Decoding LN URL

  • Required Function Parameters:

    encoded_ln_url: string
# File lib/bitnob/objects/lnurl.rb, line 36
def decode_lnurl(encoded_ln_url)
    payload = {encodedLnUrl: encoded_ln_url}
    post_request("#{base_url}#{BaseEndpoints::LNURL}", payload.to_json)
end
get_by_identifier(identifier) click to toggle source

Get lnurl by identifier e.g email, username

# File lib/bitnob/objects/lnurl.rb, line 120
def get_by_identifier(identifier)
    get_request("#{base_url}#{BaseEndpoints::LNURL}/fetchlnurl/#{identifier}")
end
get_id(id) click to toggle source

Get lnurl by id

# File lib/bitnob/objects/lnurl.rb, line 125
def get_id(id)
    get_request("#{base_url}#{BaseEndpoints::LNURL}/#{id}")
end
get_lnurls() click to toggle source

get all lnurls

# File lib/bitnob/objects/lnurl.rb, line 115
def get_lnurls()
    get_request("#{base_url}#{BaseEndpoints::LNURL}/")
end
ln_withdrawal(data) click to toggle source

CREATE LN WITHDRAWAL

  • Required Function Parameters:

    data: {
    
          customerEmail: string,
          satoshis: int,
          description: string,
          }
# File lib/bitnob/objects/lnurl.rb, line 72
def ln_withdrawal(data)
    required_parameters = %w[description customerEmail satoshis ]
    checked_passed_parameters(required_parameters, data)
    payload = data.to_json
    post_request("#{base_url}#{BaseEndpoints::LNURL}/createLnUrlWithdrawal", payload)
end
pay_ln_address(data) click to toggle source

PAY LIGHTNING ADDRESS

  • Required Function Parameters:

    data: {
          lnAddress: string,
          customerEmail: string,
          satoshis: int,
          reference: string
          }
# File lib/bitnob/objects/lnurl.rb, line 107
def pay_ln_address(data)
    required_parameters = %w[lnAddress customerEmail satoshis reference ]
    checked_passed_parameters(required_parameters, data)
    payload = data.to_json
    post_request("#{base_url}#{BaseEndpoints::LNURL}/paylnaddress", payload)
end
pay_lnurl(data) click to toggle source

PAY LNURL

  • Required Function Parameters:

    data: {
    
          encodedLnUrl: string,
          customerEmail: string,
          satoshis: int,
          reference: string,
          comment: string // optional 
          }
# File lib/bitnob/objects/lnurl.rb, line 54
def pay_lnurl(data)
    required_parameters = %w[encodedLnUrl customerEmail satoshis reference ]
    checked_passed_parameters(required_parameters, data)
    payload = data.to_json
    post_request("#{base_url}#{BaseEndpoints::LNURL}/paylnurl", payload)
end
update_lnurl(id, data) click to toggle source

PAY LNURL

  • Required Function Parameters:

    id, 
    data: {
          identifier: string,
          customerEmail: string,
          tld: string,
          image: string   #jpg,png,svg url link
          description: string,
          satMinSendable: int
          satMaxSendable: int
          }
# File lib/bitnob/objects/lnurl.rb, line 143
def update_lnurl(id, data)
    required_parameters = %w[identifier customerEmail tld image description satMinSendable satMinSendable ]
    checked_passed_parameters(required_parameters, data)
    put_request("#{base_url}#{BaseEndpoints::LNURL}/#{id}")
end