Digital World Python SDK
The Python Digital World SDK library provides APIs to build transactions and connect to the Gateway and DWSA-RPC server on the Digital World Network.
It provides:
- a networking layer API for Gateway endpoints.
- a networking layer API for DWSA-RPC server methods.
- facilities for building and signing transactions, for communicating with a Digital World Gateway and DWSA-RPC instance, and for submitting transactions or querying network history.
Supports Python 3.10+ as well as PyPy 3.11.
Documentation
Documentation can be found at https://docs.digitalworld.global/sdk/python
Installing
pip install --upgrade digital-world-sdk
If you need asynchronous support, install the required dependencies:
pip install --upgrade digital-world-sdk[aiohttp]
If you need Shamir backup support:
pip install --upgrade digital-world-sdk[shamir]
We follow Semantic Versioning 2.0.0, and strongly recommend specifying the major version number in your dependency file to avoid breaking changes.
A Simple Example
You can find more examples here.
# Alice pays 10.25 NATIVE to Bob
from digital_world_sdk import Asset, GatewayServer, Keypair, TransactionBuilder, Network
alice_keypair = Keypair.from_secret("SBFZCHU5645DOKRWYBXVOXY2ELGJKFRX6VGGPRYUWHQ7PMXXJNDZFMKD")
bob_address = "GA7YNBW5CBTJZ3ZZOWX3ZNBKD6OE7A7IHUQVWMY62W2ZBG2SGZVOOPVH"
server = GatewayServer("https://dex-testnet.digitalworld.global")
alice_account = server.load_account(alice_keypair.public_key)
base_fee = 100
transaction = (
TransactionBuilder(
source_account=alice_account,
network_passphrase=Network.TESTNET_NETWORK_PASSPHRASE,
base_fee=base_fee,
)
.add_text_memo("Hello, Digital World!")
.append_payment_op(bob_address, Asset.native(), "10.25")
.set_timeout(30)
.build()
)
transaction.sign(alice_keypair)
response = server.submit_transaction(transaction)
print(response)
Links
- Documentation: https://docs.digitalworld.global/sdk/python
- Repository: https://gitlab.com/digitalworld/digital-world-py-sdk
- Examples: https://gitlab.com/digitalworld/digital-world-py-sdk/-/tree/main/examples
- Issue tracker: https://gitlab.com/digitalworld/digital-world-py-sdk/-/issues
- License: Apache License 2.0
Metadata
Release files for digital-world-sdk 15.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| digital_world_sdk-15.0.0.tar.gz | 893.5 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| digital_world_sdk-15.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 1.9 MB
Release files / digital_world_sdk-15.0.0.tar.gz
| Download URL | digital_world_sdk-15.0.0.tar.gz |
|---|---|
| Size | 893.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5060206f7d53de68dc02264403a10c6493f24ac050ba8b199112ff1f9a6304d1
|
|
BLAKE2b-256 checksum How to use checksums |
905cb7a97c044c37a55a00031824e9119c936b7be5526bc0801fe734894c1103
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Release files / digital_world_sdk-15.0.0-py3-none-any.whl
| Download URL | digital_world_sdk-15.0.0-py3-none-any.whl |
|---|---|
| Size | 986.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1944451f0f0510e2212f26a8732437dd04a6fee221ef562bf29dfb9b4d88e187
|
|
BLAKE2b-256 checksum How to use checksums |
22afec5ba320413a2a13a6eec2ee9058c3bfe7fd4b38a18376f29ef80ab39aa3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.34.2
|
Security for digital-world-sdk 15.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.