-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathexample.py
More file actions
42 lines (28 loc) · 1.22 KB
/
example.py
File metadata and controls
42 lines (28 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import os
from dotenv import load_dotenv
from reclaim_python_sdk import ReclaimProofRequest
import asyncio
# Load environment variables from .env file
load_dotenv()
async def main():
# Retrieve app ID and other details from environment variables
try:
app_id = os.getenv("APP_ID")
app_secret = os.getenv("APP_SECRET")
provider_id = os.getenv("PROVIDER_ID")
reclaim_proof_request = await ReclaimProofRequest.init(app_id, app_secret, provider_id, {"log": True})
reclaim_proof_request.set_params({
'name': 'John Doe',
'age': '30',
'email': '[email protected]'
})
reclaim_proof_request.add_context('0x00000000000', 'Example context message')
reclaim_proof_request.set_redirect_url('https://example.com/redirect')
reclaim_proof_request.set_app_callback_url('https://webhook.site/29c6fff0-100c-4e34-8e28-5915f13a6aa4', True)
print(reclaim_proof_request.to_json_string())
request_url = await reclaim_proof_request.get_request_url()
print(f"Request URL: {request_url}")
except Exception as e:
print(f"Error: {str(e)}")
if __name__ == "__main__":
asyncio.run(main())