29 lines
No EOL
975 B
Python
29 lines
No EOL
975 B
Python
from cdp import cdp_client
|
|
import asyncio
|
|
from dotenv import load_dotenv
|
|
|
|
load_dotenv()
|
|
|
|
async def main():
|
|
cdp = cdp_client.CdpClient()
|
|
#account = await cdp.evm.create_account()
|
|
#account = await cdp.evm.get_account(address="0x8c8619DaEeafC2bC1a54F73d1480f2509Df10945")
|
|
#print(f"Received EVM account: {account.address} with name '{account.name}'")
|
|
#faucet_hash = await cdp.evm.request_faucet(
|
|
# address=account.address,
|
|
# network="base-sepolia",
|
|
# token="eth",
|
|
#)
|
|
#print(f"Requested funds from ETH faucet: https://sepolia.basescan.org/tx/{faucet_hash}")
|
|
account = await cdp.solana.create_account(name="api-naco-li")
|
|
|
|
tx_signature_response = await cdp.solana.request_faucet(
|
|
address=account.address,
|
|
token="sol"
|
|
)
|
|
|
|
print(f"Requested funds from Solana faucet: https://explorer.solana.com/tx/{tx_signature_response.transaction_signature}?cluster=devnet")
|
|
await cdp.close()
|
|
|
|
|
|
asyncio.run(main()) |