Gathering detailed insights and metrics for @ryniaubenpm/magni-facere-inventore
Gathering detailed insights and metrics for @ryniaubenpm/magni-facere-inventore
Gathering detailed insights and metrics for @ryniaubenpm/magni-facere-inventore
Gathering detailed insights and metrics for @ryniaubenpm/magni-facere-inventore
npm install @ryniaubenpm/magni-facere-inventore
Typescript
Module System
Node Version
NPM Version
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
26
NodeJS's implementation of BlockBee's payment gateway
NodeJS >= 20
1npm install @ryniaubenpm/magni-facere-inventore
1var BlockBee = require('@ryniaubenpm/magni-facere-inventore')
1const bb = new BlockBee(coin, myAddress, callbackUrl, params, blockbeeParams, apiKey)
2
3const address = await bb.getAddress()
coin
is the coin you wish to use, from BlockBee's supported currencies (e.g 'btc', 'eth', 'erc20_usdt', ...).myAddress
is your own crypto address, where your funds will be sent to. It's optional, you can leave it empty (e.g ''
) if you are setting it up in BlockBee's dashboard.callbackUrl
is the URL that will be called upon payment.params
is any parameter you wish to send to identify the payment, such as {orderId: 1234}
.blockbeeParams
parameters that will be passed to BlockBee _(check which extra parameters are available here: https://docs.blockbee.io/#operation/create).apiKey
is the API Key provided by BlockBee's dashboard.address
is the newly generated address, that you will show your users in order to receive payments.0x0E945b1554c8029A6B9bE1F7A24ae75d2F44d8DB
Once your customer makes a payment, BlockBee will send a callback to your
callbackUrl
. This callback information is by default inGET
but you can se it toPOST
by settingpost: 1
inblockbeeParams
. The parameters sent by BlockBee in this callback can be consulted here: https://docs.blockbee.io/#operation/confirmedcallbackget
1const bb = new BlockBee(coin, myAddress, callbackUrl, params, blockbeeParams, apiKey)
2
3const data = await bb.checkLogs()
1{ 2 "status": "success", 3 "callback_url": "https://example.com/?order_id=1235", 4 "address_in": "0x58e90D31530A5566dA97e34205730323873eb88B", 5 "address_out": "0xA6B78B56ee062185E405a1DDDD18cE8fcBC4395d", 6 "notify_pending": false, 7 "notify_confirmations": 1, 8 "priority": "default", 9 "callbacks": [] 10}
All the data
returned in the response can be checked here: https://docs.blockbee.io/#operation/logs
1const bb = new BlockBee(coin, myAddress, callbackUrl, params, blockbeeParams, apiKey)
2
3const qrCode = await bb.getQrcode(value, size)
For object creation, same parameters as before. You must first call ``getAddress` as this method requires the payment address to have been created.
value
is the value requested to the user in the coin to which the request was done. Optional, can be empty if you don't wish to add the value to the QR Code.size
Size of the QR Code image in pixels. Optional, leave empty to use the default size of 512.apiKey
is the API Key provided by BlockBee's dashboard.Response is an object with
qr_code
(base64 encoded image data) andpayment_uri
(the value encoded in the QR), see https://docs.blockbee.io/#operation/qrcode for more information.
1{ 2 "status": "success", 3 "qr_code": "iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAIAAAD2HxkiAAAYeklEQVR4nO3daZQdZZkH8Od5q+quvXenO3tCQtg3WQLDOiwi4FEGRA96RhkRlEUd9cw5Ojif/DTOHEcF4YAwntFRhBEHBPWoKAECGNnXSICQBEL23m/fvkvV+8yHut3pEPoSaop6qjv/3wcOSbrurVv3/vutW8/7vMUiQgCgx2jvAMD+DiEEUIYQAihDCAGUIYQAyhBCAGUIIYAyhBBAmdvk35g5sf2IS4S5BxFe5nTPEu8Ri3ceRYwvM9qjRXiWBJ49MU1eJkZCAGUIIYAyhBBAGUIIoAwhBFCGEAIoQwgBlDWrE05HvQ9YvRw33Q4kU1iL9mjxvmsxVkqbbBJhn2fihxMjIYAyhBBAGUIIoAwhBFCGEAIoQwgBlCGEAMoQQgBlUYr1Tej2ekajXvieTmrbcJs8UYQdSPMbPZ149xkjIYAyhBBAGUIIoAwhBFCGEAIoQwgBlCGEAMpirhPu51Lbbdzk0aL11CazYrJ6h24yMBICKEMIAZQhhADKEEIAZQghgDKEEEAZQgigDCEEULa/FOvjrWInU5RPpqk3zauG7ycwEgIoQwgBlCGEAMoQQgBlCCGAMoQQQBlCCKAs5jpharswE6uGRdiBCJtMt8/qN8qN8ESJfWZS++HES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Wm4yTb3qtU0s/gsw8yCEAMoQQgBlCCGAMoQQQBlCCKAMIQRQhhACKItSrE8z3fKuet05AvVVw5PpkI79iWKEkRBAGUIIoAwhBFCGEAIoQwgBlCGEAMoQQgBlzeqEAJAAjIQAyhBCAGUIIYAyhBBAGUIIoAwhBFCGEAIoQwgBlP0fDDJ0PYOZxyEAAAAASUVORK5CYII=", 4 "payment_uri": "0x0E945b1554c8029A6B9bE1F7A24ae75d2F44d8DB" 5}
1<img src={`data:image/png;base64,${qr_code}`}/>
1const fees = await BlockBee.getEstimate(coin, apiKey, addresses, priority)
coin
is the coin you wish to check, from BlockBee's supported currencies (e.g btc
, eth
, erc20_usdt
, ...)apiKey
is the API Key provided by BlockBee's dashboard.addresses
The number of addresses to forward the funds to. Optional, defaults to 1.priority
Confirmation priority, (check this article to learn more about it). Optional, defaults to default
.Response is an object with
estimated_cost
andestimated_cost_usd
, see https://docs.blockbee.io/#operation/estimate for more information.
1{ 2 "status": "success", 3 "estimated_cost": "0.00637010", 4 "estimated_cost_currency": { 5 "AED": "0.03", 6 "AUD": "0.01", 7 "BGN": "0.01", 8 "BRL": "0.04" 9 } 10}
1const conversion = await BlockBee.getConvert(coin, value, from, apiKey)
coin
the target currency to convert to, from BlockBee's supported currencies (e.g 'btc', 'eth', 'erc20_usdt', ...)value
value to convert in from
.from
currency to convert from, FIAT or crypto.apiKey
is the API Key provided by BlockBee's dashboard.Response is an object with
value_coin
andexchange_rate
, see https://docs.blockbee.io/#operation/convert for more information.
1{ 2 "status": "success", 3 "value_coin": "241.126", 4 "exchange_rate": "0.803753" 5}
1const supportedCoins = await BlockBee.getSupportedCoins(apiKey)
apiKey
is the API Key provided by BlockBee's dashboard.Response is an array with all supported coins.
1{ 2 "btc": { 3 "coin": "Bitcoin", 4 "logo": "https://api.cryptapi.io/media/token_logos/btc.png", 5 "ticker": "btc", 6 "minimum_transaction": 8000, 7 "minimum_transaction_coin": "0.00008000", 8 "minimum_fee": 546, 9 "minimum_fee_coin": "0.00000546", 10 "fee_percent": "1.000", 11 "network_fee_estimation": "0.00002518" 12 }, 13 "bch": { 14 "coin": "Bitcoin Cash", 15 "logo": "https://api.cryptapi.io/media/token_logos/bch.png", 16 "ticker": "bch", 17 "minimum_transaction": 50000, 18 "minimum_transaction_coin": "0.00050000", 19 "minimum_fee": 546, 20 "minimum_fee_coin": "0.00000546", 21 "fee_percent": "1.000", 22 "network_fee_estimation": "0.00000305" 23 } 24}
1const paymentRequest = await BlockBee.paymentRequest(redirectUrl, notifyUrl, value, params, bbParams, apiKey)
redirectUrl
URL in your platform, where the user will be redirected to following the payment. Should be able to process the payment using the success_token
, if you wish to use this URL to confirm payment.notifyUrl
URL in your platform, where the IPN will be sent notifying that a deposit was done. Parameters are available here: https://docs.blockbee.io/#operation/depositipn.value
amount in currency set in Payment Settings you want to receive from the user.bbParams
parameters that will be passed to BlockBee _(check which extra parameters are available here: https://docs.blockbee.io/#operation/create).params
is any parameter you wish to send to identify the payment, such as {order_id: 1234}
.apiKey
is the API Key provided by our Dashboard.When receiving payments, you have the option to receive them in either the
notify_url
or theredirect_url
, but adding theredirect_url
is required (refer to our documentation at https://docs.blockbee.io/#operation/paymentipn).
1{ 2 "status": "success", 3 "success_token": "G4asA2xwEr0UeY2IZqlZjX3IYrNofmnIAkzHPAoxmpmlYP9ZLTvQUolKN0X27Z0B", 4 "payment_url": "https://pay.blockbee.io/payment/OcRrZGsKQFGsoi0asqZkr97WbitMxFMb/", 5 "payment_id": "OcRrZGsKQFGsoi0asqZkr97WbitMxFMb" 6}
Fetch Payment information and IPN logs.
1const logs = await BlockBee.paymentLogs(token, apiKey);
token
is the payment_id
returned by the payment creation endpoint.1{ 2 "status": "success", 3 "is_paid": false, 4 "is_pending": false, 5 "is_expired": false, 6 "is_partial": false, 7 "payment_data": [ 8 { 9 "value": "0.000137", 10 "value_paid": "0", 11 "value_outstanding": "0.000137", 12 "exchange_rate": "0.0000137489", 13 "coin": "btc", 14 "txid": [] 15 } 16 ], 17 "notifications": [] 18}
1const deposit = await BlockBee.depositRequest( notifyUrl, apiKey, params, bbParams )
notifyUrl
URL in your platform, where the IPN will be sent notifying that a deposit was done. Parameters are available here: https://docs.blockbee.io/#operation/depositipn.apiKey
is the API Key provided by our Dashboard.params
is any parameter you wish to send to identify the payment, such as {order_id: 1234}
.bbParams
parameters that will be passed to BlockBee _(check which extra parameters are available here: https://docs.blockbee.io/#operation/deposit).1{ 2 "status": "success", 3 "payment_url": "https://pay.blockbee.io/deposit/jv12du8IWqS96WVDjZK2J285WOBOBycc/", 4 "payment_id": "jv12du8IWqS96WVDjZK2J285WOBOBycc" 5}
Fetch Deposit information and IPN logs.
1const logs = await BlockBee.depositLogs(token, apiKey);
token
is the payment_id
returned by the deposit creation endpoint.1{ 2 "status": "success", 3 "deposits": [], 4 "total_deposited": "0", 5 "currency": "USDT", 6 "notifications": [] 7}
This function can be used by you to create Payouts.
1const coin = 'polygon_matic' 2 3const requests = { 4 '0xA6B78B56ee062185E405a1DDDD18cE8fcBC4395d': 0.5, 5 '0x18B211A1Ba5880C7d62C250B6441C2400d588589': 0.1 6} 7 8const createPayout = await BlockBee.createPayout(coin, requests, apiKey, process);
coin
The cryptocurrency you want to request the Payout in (e.g btc
, eth
, erc20_usdt
, ...).
requests
Address(es) together with the amount that must be sent.
process
If the Payout Requests will be sent right away. Defaults to false
. Note: if true
will instantly queue the payouts to be sent to the destination addresses.
If process
is false
.
1{ 2 "status": "success", 3 "request_ids": [ 4 103227, 5 103228 6 ] 7}
If process
is true
.
1{ 2 "status": "success", 3 "queued": true 4}
List all Payouts or Payout Requests in your account.
Note: If requests
is true
it will fetch a Payout Requests list.
1const createPayout = await BlockBee.listPayouts(coin, status, page, apiKey, requests);
coin
The cryptocurrency you want to request the lists in (e.g btc
, eth
, erc20_usdt
, ...).
status
The status of the Payout / Payout Request. Possible statuses are:
all
, pending
, rejected
, processing
, done
]created
, processing
, done
, error
]page
This endpoint is paginated and will show only 50
items per page. Defaults to 1
.
requests
If true
will fetch Payout Requests, otherwise will fetch Payouts. Defaults to false
.
1{ 2 "status": "success", 3 "payouts": [ 4 { 5 "id": 2460, 6 "status": "Done", 7 "total_requested": "0.6", 8 "total_with_fee": "0.606", 9 "total_fiat": "", 10 "fee": "0.006", 11 "coin": "polygon_matic", 12 "timestamp": "13/03/2024 17:48:39" 13 } 14 ], 15 "num_pages": 1 16}
Gets your Payout Wallet for the specified coin
. Can algo get the balance.
1const wallet = await getPayoutWallet(coin, apiKey, balance)
coin
The cryptocurrency you want to request the lists in (e.g btc
, eth
, erc20_usdt
, ...).
balance
If true
will also fetch the balance of the address.
1{ 2 "address": "0x18B211A1Ba5880C7d62C250B6441C2400d588589", 3 "balance": "2.7" 4}
With this function you can create a Payout in the created
status by simply providing an array with the Payout Requests ID
.
1const ids = [52211, 52212] 2 3const payout = await createPayoutByIds(apiKey, ids)
ids
its an array with the Payout Requests ID
.1{ 2 "status": "success", 3 "payout_info": { 4 "id": 2461, 5 "status": "Created", 6 "from": "", 7 "requests": { 8 "0xA8EbeD50f2e05fB4a25b2DdCdc651A7CA769B5CF": "0.300000000000000000", 9 "0xA6B78B56ee062185E405a1DDDD18cE8fcBC4395d": "0.200000000000000000" 10 }, 11 "total_requested": "0.5", 12 "total_with_fee": "0.505", 13 "total_fiat": "", 14 "fee": "0.005", 15 "coin": "bep20_usdt", 16 "txid": "", 17 "timestamp": "05/03/2024 15:00:00" 18 } 19}
By default, a Payout when created will be in created
state. With this function you may finish it using its ID
.
1const payout = await BlockBee.processPayout(apiKey, ids)
id
Its the ID
of the Payout you wish to fulfill.1{ 2 "status": "success", 3 "queued": true 4}
Will return all important information regarding a Payout, specially its status.
1const id = 51621 2 3const status = await BlockBee.checkPayoutStatus(apiKey, id)
id
Its the ID
of the Payout you wish to check.1{ 2 "status": "success", 3 "payout_info": { 4 "id": 2463, 5 "status": "Done", 6 "from": "0x18B211A1Ba5880C7d62C250B6441C2400d588589", 7 "requests": { 8 "0xA6B78B56ee062185E405a1DDDD18cE8fcBC4395d": "0.500000000000000000", 9 "0x18B211A1Ba5880C7d62C250B6441C2400d588589": "0.100000000000000000" 10 }, 11 "total_requested": "0.6", 12 "total_with_fee": "0.606", 13 "total_fiat": "", 14 "fee": "0.006", 15 "coin": "polygon_matic", 16 "txid": "0xf9aa1618a7e460f8c68b6a02369b5058282c53a4ee23f967abef0d35203f328c", 17 "timestamp": "13/03/2024 18:10:35" 18 } 19}
Need help?
Contact us @ https://blockbee.io/contacts/
createPayout
parameters were changed and will require you to update your code.No vulnerabilities found.
No security vulnerabilities found.