Download the PHP package neto737/bitgosdk-php without Composer

On this page you can find all versions of the php package neto737/bitgosdk-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package bitgosdk-php

BitGoSDK PHP

A PHP client for the BitGo API and BitGo Express.
Manage wallets, addresses, transfers, policies and webhooks, and send coins, from your PHP code.

Latest Stable Version Total Downloads PHP 7.4 or later CI Coverage


Features

Requirements

Installation

Quick start

More examples are in examples/.

[!NOTE] Requests to Express carry wallet passphrases and private keys. Use plain http:// only when Express runs on the same host. Otherwise see Use TLS unless Express is on the same host.

What's covered

BitGoSDK: the BitGo API

Area Methods
User and session getCurrentUserProfile(), getSessionInfo(), lockSession(), unlockSession(), logout()
Wallets listWallets(), getWallet(), getWalletByAddress(), getTotalBalances(), getMaximumSpendable(), freezeWallet()
Addresses createWalletAddress(), getWalletAddress(), getWalletAddresses(), updateWalletAddress()
Transfers and unspents listWalletTransfers(), getWalletTransfer(), getWalletTransferBySequenceId(), getWalletTransactions(), getWalletTransaction(), listWalletUnspents()
Keychains listKeychains(), getKeychain(), createBitGoKeychain(), createBackupKeychain(), addKeychain()
Policies setVelocityPolicyRule(), updateVelocityPolicyRule(), removePolicyRule()
Wallet sharing listWalletShares(), getWalletShare(), resendWalletShareInvite(), cancelWalletShare(), removeWalletUser()
Pending approvals listPendingApprovals(), getPendingApproval()
Webhooks Wallet and user webhooks: list…, add…, remove… and simulate…Webhook(). getWebhookPayload() reads an incoming webhook.
Fees and prices estimateTransactionFees(), getMarketPriceData()
Amounts toSatoshi(), toBTC(), toBaseUnits(), fromBaseUnits()

BitGoExpress: your BitGo Express instance

Area Methods
Status and login ping(), pingExpress(), login()
Wallets generateWallet(), addWallet(), createKeychain()
Sending sendTransaction(), sendTransactionToMany()
Build, sign and send in steps buildTransaction(), signBuildTransaction(), sendBuildTransaction()
Unspent management consolidateWalletUnspents(), fanoutWalletUnspents(), sweep()
Sharing and approvals shareWallet(), acceptWalletShare(), updatePendingApproval()
Utilities encrypt(), decrypt(), verifyAddress()

Each method's parameters are documented in its docblock. For what each endpoint does, see the BitGo API reference and the Express API reference.

Error handling

Calls don't throw on API or network errors. They return an array with an error message and the HTTP status, plus any other fields BitGo sent:

buildTransaction() and signBuildTransaction() return the same fields as an object.

IDs and addresses you pass in are percent-encoded into the URL, so they can't change which endpoint a request reaches. An empty ID, . or .. would still reach a different endpoint, so the call throws an InvalidArgumentException instead of sending the request. So does any wallet method called before walletId is set.

Receiving webhooks

Anyone who knows your webhook URL can POST to it, so treat the payload as untrusted. Check that hash looks like a transaction hash, then look the transfer up on BitGo with getWalletTransaction() and act on what BitGo returns, not on the webhook body. examples/receiveWebhook.php shows how, and answers BitGo before the lookup so slow handlers don't trigger retries.

BitGo Express

BitGo signs transactions on the client, so sending coins, creating wallets and other calls that use your keys go through BitGoExpress, which talks to your own BitGo Express instance. See Install BitGo Express to run one.

Use TLS unless Express is on the same host

Over plain http://, Express is only safe when it listens on localhost. Otherwise, run Express with a TLS certificate and prefix the hostname with https://:

setCaFile() throws an InvalidArgumentException if the file can't be read. Certificates are verified by default. setVerifyTls(false) turns verification off, so use it only for local testing.

Minimum Express version

Use BitGo Express 14.1.3 or later. Older versions fail on two changes BitGo made on its side:

Client settings

Both clients have these settings:

BitGoSDK::setRequestIP('203.0.113.10') sends requests from that local IP. It returns false on testnet or for an invalid IP.

TLS certificates

Both clients check certificates against your system's CA store. If PHP can't find one, they use the Mozilla CA bundle from composer/ca-bundle, so keep your dependencies up to date. To trust a different CA, for example behind a TLS-inspecting proxy, call setCaFile('/path/to/ca.pem').

Documentation

Upgrading from 2.2.x? 2.3 keeps the same methods, but it needs PHP 7.4 or later, and two behaviours changed: 0 and false params are now sent, and errors come back as ['error' => …, 'status' => …]. Read the 2.3.0 changelog before you upgrade.

Upgrading from 2.3.0? 2.3.1 is a security fix (GHSA-qr36-39c2-hp84). Wallet methods now throw an InvalidArgumentException if walletId isn't set, so set it before you call them.

Contributing

Bug reports and pull requests are welcome. See CONTRIBUTING.md for the branch model and release process. To run the checks:

Each check can also run on its own: composer test (PHPUnit), composer analyse (PHPStan) and composer cs (PHP-CS-Fixer). composer cs:fix fixes the coding style. The code follows PSR-12, with 4-space indentation and LF line endings.

The tests replace the HTTP transport with a recorder, so they don't need a BitGo account or network access.

To report a security issue, follow SECURITY.md instead of opening a public issue.

Credits

Created and maintained by Neto Melo.

This is a community project. It is not affiliated with or endorsed by BitGo, Inc.

Support the project :heart:

If this library saves you time, you can support its development via Liberapay, PayPal or crypto:

License

Released under the MIT License. Versions 2.2.3 and earlier were released under GPL-3.0.


All versions of bitgosdk-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
php-http/discovery Version ^1.20
psr/http-client Version ^1.0
psr/http-client-implementation Version ^1.0
psr/http-factory Version ^1.1
psr/http-factory-implementation Version ^1.0
psr/http-message Version ^1.1 || ^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package neto737/bitgosdk-php contains the following files

Loading the files please wait ...