Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Copyright (c) 2017-2024 Digital Asset (Switzerland) GmbH and/or its affiliates. All Rights Reserved. SPDX-License-Identifier: Apache-2.0
Rich Python bindings for accessing Ledger API-based applications.
The user documentation is available online here.
If you just want to use the library, you can install it locally with pip
:
pip install --user dazl
WARNING: The next major version of dazl (v8.0.0) will require Python 3.8 or later.
All of the examples below assume you imported dazl
, and are running a ledger with the default scenario generated with daml new
.
Connect to the ledger and submit a single command:
import asyncio
import dazl
async def main():
async with dazl.connect(url='http://localhost:6865', act_as='Alice') as client:
contract = { 'issuer' : 'Alice', 'owner' : 'Alice', 'name' : 'hello world!' }
await client.create('Main:Asset', contract)
# Python 3.7+
asyncio.run(main())
# Python 3.6+
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Connect to the ledger as a single party, print all contracts, and close:
import asyncio
import dazl
from dazl.ledgerutil import ACS
async def main():
async with dazl.connect(url='http://localhost:6865', read_as='Alice') as conn:
async with ACS(conn, {"*": {}}) as acs:
snapshot = await acs.read()
print(snapshot)
# Python 3.7+
asyncio.run(main())
# Python 3.6+
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
You will need additional dependencies to build locally:
Once you have these prerequisites in place:
make build
If you see errors about incompatible python versions, switch your environment to python3 using poetry env use python3
, for instance.
Tests in the Daml Python bindings are written using pytest. You can run them by doing:
make test
The Daml Python bindings library is supported under the Daml Enterprise license. If you do not have a Daml Enterprise license and are in need of support, have questions or just want to engage in friendly conversation anything Daml, contact us on our Daml Community Forum.
FAQs
high-level Ledger API client for Daml ledgers
We found that dazl demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.