πAuth by Keys
Prerequisites
Ensure you have the following libraries installed:
pip install asyncio json sha256 base58 ed25519 httpx py_nearImport Necessary Modules
import asyncio
import json
from hashlib import sha256
import base58
import ed25519
import httpx
from py_near.account import Account
from app import dao_nc
from configs import CONFIGDefine Keys and Wallet ID
public_key = "[KEY]"
private_key = "...."
wallet_id = "EHGDUJ7GDASucUVU4ngsgUsTYZT1FpG91CTFG8iUmGQ5"
pk = ed25519.SigningKey(base58.b58decode(private_key))Add Access
The following steps outline how to add access to a wallet.
Get Wallet Information
Prepare Access Data
Create and Sign the Message
Call the
grant_assessFunction
Revoke Access
The following steps outline how to revoke access from a wallet.
Create and Sign the Message for Revoking Access
Call the
revoke_assessFunction
Execute Multiple Actions
The following steps outline how to execute multiple actions in a single call.
Create and Sign the Messages
Call the
executeFunction
Running the Function
To run the function, use the following:
This documentation provides a clear example of how to manage wallet access using digital signatures and API calls in an asynchronous Python environment.
Last updated