DaoAdvocate
commited on
Commit
·
3c4778e
1
Parent(s):
9f0cada
add: base
Browse files- .gitignore +2 -0
- app.py +7 -0
- codebase-polywrap.ipynb +271 -0
- polywrapgpt/Readme.md +0 -0
- polywrapgpt/e2e.spec.ts +765 -0
- polywrapgpt/ens +1 -0
- polywrapgpt/examples.md +59 -0
- polywrapgpt/schema.graphql +301 -0
- requirements.txt +0 -0
.gitignore
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
.DS_Store
|
2 |
+
.env
|
app.py
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def greet(name):
|
4 |
+
return "Hello " + name + "!!"
|
5 |
+
|
6 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
+
iface.launch()
|
codebase-polywrap.ipynb
ADDED
@@ -0,0 +1,271 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"cells": [
|
3 |
+
{
|
4 |
+
"cell_type": "code",
|
5 |
+
"execution_count": 1,
|
6 |
+
"metadata": {},
|
7 |
+
"outputs": [],
|
8 |
+
"source": [
|
9 |
+
"import os\n",
|
10 |
+
"import getpass\n",
|
11 |
+
"\n",
|
12 |
+
"from langchain.embeddings.openai import OpenAIEmbeddings\n",
|
13 |
+
"from langchain.vectorstores import DeepLake\n",
|
14 |
+
"\n",
|
15 |
+
"import dotenv\n",
|
16 |
+
"dotenv.load_dotenv()\n",
|
17 |
+
"\n",
|
18 |
+
"os.environ['ACTIVELOOP_TOKEN'] = \"eyJhbGciOiJIUzUxMiIsImlhdCI6MTY4NDAxNjM2NCwiZXhwIjoxNjg1NDg1MTM5fQ.eyJpZCI6InJpaHAifQ.1rzZgsiqjiMz2UidXm1M-JBTMwJbNnah00PeQgGG-Op__xZl1uDpEKhaBxw98bXD9c2MGNIBreMT_pLxZXQSJA\" # replace with your API key from app.activeloop.ai\n",
|
19 |
+
"username = \"rihp\" # replace with your username from app.activeloop.ai\n",
|
20 |
+
"projectname = \"polywrap5\" # replace with your project name from app.activeloop.ai\n"
|
21 |
+
]
|
22 |
+
},
|
23 |
+
{
|
24 |
+
"cell_type": "code",
|
25 |
+
"execution_count": 2,
|
26 |
+
"metadata": {},
|
27 |
+
"outputs": [],
|
28 |
+
"source": [
|
29 |
+
"embeddings = OpenAIEmbeddings(disallowed_special=())\n"
|
30 |
+
]
|
31 |
+
},
|
32 |
+
{
|
33 |
+
"cell_type": "code",
|
34 |
+
"execution_count": 3,
|
35 |
+
"metadata": {},
|
36 |
+
"outputs": [
|
37 |
+
{
|
38 |
+
"name": "stdout",
|
39 |
+
"output_type": "stream",
|
40 |
+
"text": [
|
41 |
+
"Cloning into 'ens'...\n",
|
42 |
+
"remote: Enumerating objects: 152, done.\u001b[K\n",
|
43 |
+
"remote: Counting objects: 100% (152/152), done.\u001b[K\n",
|
44 |
+
"remote: Compressing objects: 100% (104/104), done.\u001b[K\n",
|
45 |
+
"remote: Total 152 (delta 66), reused 119 (delta 40), pack-reused 0\u001b[K\n",
|
46 |
+
"Receiving objects: 100% (152/152), 132.52 KiB | 1.56 MiB/s, done.\n",
|
47 |
+
"Resolving deltas: 100% (66/66), done.\n"
|
48 |
+
]
|
49 |
+
}
|
50 |
+
],
|
51 |
+
"source": [
|
52 |
+
"# !git clone https://github.com/makerdao/dai.js/ # replace any repository of your choice \n",
|
53 |
+
"# !git clone https://github.com/polywrap/ethereum/\n",
|
54 |
+
"# !git clone https://github.com/polywrap/safe-contracts-wrapper\n",
|
55 |
+
"# !git clone https://github.com/polywrap/uniswap/\n",
|
56 |
+
"# !git clone https://github.com/cbrzn/account-abstraction-wrapper/\n",
|
57 |
+
"# !git clone https://github.com/krisbitney/gelato-relay-polywrap\n",
|
58 |
+
"#!git clone https://github.com/ProjectOpenSea/opensea-js\n",
|
59 |
+
"#!git clone https://github.com/polywrap/ens.git"
|
60 |
+
]
|
61 |
+
},
|
62 |
+
{
|
63 |
+
"cell_type": "code",
|
64 |
+
"execution_count": 4,
|
65 |
+
"metadata": {},
|
66 |
+
"outputs": [],
|
67 |
+
"source": [
|
68 |
+
"import os\n",
|
69 |
+
"from langchain.document_loaders import TextLoader\n",
|
70 |
+
"\n",
|
71 |
+
"root_dir = './polywrapgpt' # Specify where your data is stored\n",
|
72 |
+
"docs = []\n",
|
73 |
+
"for dirpath, dirnames, filenames in os.walk(root_dir):\n",
|
74 |
+
" for file in filenames:\n",
|
75 |
+
" try: \n",
|
76 |
+
" loader = TextLoader(os.path.join(dirpath, file), encoding='utf-8')\n",
|
77 |
+
" docs.extend(loader.load_and_split())\n",
|
78 |
+
" except Exception as e: \n",
|
79 |
+
" pass"
|
80 |
+
]
|
81 |
+
},
|
82 |
+
{
|
83 |
+
"cell_type": "code",
|
84 |
+
"execution_count": 5,
|
85 |
+
"metadata": {},
|
86 |
+
"outputs": [],
|
87 |
+
"source": [
|
88 |
+
"%%capture\n",
|
89 |
+
"\n",
|
90 |
+
"from langchain.text_splitter import CharacterTextSplitter\n",
|
91 |
+
"\n",
|
92 |
+
"text_splitter = CharacterTextSplitter(chunk_size=1000, chunk_overlap=0)\n",
|
93 |
+
"texts = text_splitter.split_documents(docs)"
|
94 |
+
]
|
95 |
+
},
|
96 |
+
{
|
97 |
+
"cell_type": "code",
|
98 |
+
"execution_count": 6,
|
99 |
+
"metadata": {},
|
100 |
+
"outputs": [],
|
101 |
+
"source": [
|
102 |
+
"%%capture\n",
|
103 |
+
"db = DeepLake(dataset_path=f\"hub://{username}/{projectname}\", embedding_function=embeddings, public=True) #dataset would be publicly available\n",
|
104 |
+
"db.add_documents(texts)"
|
105 |
+
]
|
106 |
+
},
|
107 |
+
{
|
108 |
+
"cell_type": "code",
|
109 |
+
"execution_count": null,
|
110 |
+
"metadata": {},
|
111 |
+
"outputs": [
|
112 |
+
{
|
113 |
+
"name": "stderr",
|
114 |
+
"output_type": "stream",
|
115 |
+
"text": [
|
116 |
+
" \r"
|
117 |
+
]
|
118 |
+
},
|
119 |
+
{
|
120 |
+
"ename": "KeyboardInterrupt",
|
121 |
+
"evalue": "",
|
122 |
+
"output_type": "error",
|
123 |
+
"traceback": [
|
124 |
+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
|
125 |
+
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
|
126 |
+
"Cell \u001b[0;32mIn[7], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m db \u001b[39m=\u001b[39m DeepLake(dataset_path\u001b[39m=\u001b[39;49m\u001b[39mf\u001b[39;49m\u001b[39m\"\u001b[39;49m\u001b[39mhub://\u001b[39;49m\u001b[39m{\u001b[39;49;00musername\u001b[39m}\u001b[39;49;00m\u001b[39m/\u001b[39;49m\u001b[39m{\u001b[39;49;00mprojectname\u001b[39m}\u001b[39;49;00m\u001b[39m\"\u001b[39;49m, read_only\u001b[39m=\u001b[39;49m\u001b[39mTrue\u001b[39;49;00m, embedding_function\u001b[39m=\u001b[39;49membeddings)\n",
|
127 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/vectorstores/deeplake.py:127\u001b[0m, in \u001b[0;36mDeepLake.__init__\u001b[0;34m(self, dataset_path, token, embedding_function, read_only, ingestion_batch_size, num_workers, verbose, **kwargs)\u001b[0m\n\u001b[1;32m 121\u001b[0m creds_args \u001b[39m=\u001b[39m {\u001b[39m\"\u001b[39m\u001b[39mcreds\u001b[39m\u001b[39m\"\u001b[39m: kwargs[\u001b[39m\"\u001b[39m\u001b[39mcreds\u001b[39m\u001b[39m\"\u001b[39m]} \u001b[39mif\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39mcreds\u001b[39m\u001b[39m\"\u001b[39m \u001b[39min\u001b[39;00m kwargs \u001b[39melse\u001b[39;00m {}\n\u001b[1;32m 123\u001b[0m \u001b[39mif\u001b[39;00m (\n\u001b[1;32m 124\u001b[0m deeplake\u001b[39m.\u001b[39mexists(dataset_path, token\u001b[39m=\u001b[39mtoken, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mcreds_args)\n\u001b[1;32m 125\u001b[0m \u001b[39mand\u001b[39;00m \u001b[39m\"\u001b[39m\u001b[39moverwrite\u001b[39m\u001b[39m\"\u001b[39m \u001b[39mnot\u001b[39;00m \u001b[39min\u001b[39;00m kwargs\n\u001b[1;32m 126\u001b[0m ):\n\u001b[0;32m--> 127\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mds \u001b[39m=\u001b[39m deeplake\u001b[39m.\u001b[39;49mload(\n\u001b[1;32m 128\u001b[0m dataset_path,\n\u001b[1;32m 129\u001b[0m token\u001b[39m=\u001b[39;49mtoken,\n\u001b[1;32m 130\u001b[0m read_only\u001b[39m=\u001b[39;49mread_only,\n\u001b[1;32m 131\u001b[0m verbose\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mverbose,\n\u001b[1;32m 132\u001b[0m \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs,\n\u001b[1;32m 133\u001b[0m )\n\u001b[1;32m 134\u001b[0m logger\u001b[39m.\u001b[39minfo(\u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39mLoading deeplake \u001b[39m\u001b[39m{\u001b[39;00mdataset_path\u001b[39m}\u001b[39;00m\u001b[39m from storage.\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 135\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mverbose:\n",
|
128 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/util/spinner.py:139\u001b[0m, in \u001b[0;36mspinner.<locals>.inner\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 136\u001b[0m spinner \u001b[39m=\u001b[39m Spinner()\n\u001b[1;32m 138\u001b[0m \u001b[39mwith\u001b[39;00m run_spinner(spinner):\n\u001b[0;32m--> 139\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[1;32m 140\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 141\u001b[0m \u001b[39mreturn\u001b[39;00m func(\u001b[39m*\u001b[39margs, \u001b[39m*\u001b[39m\u001b[39m*\u001b[39mkwargs)\n",
|
129 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/api/dataset.py:584\u001b[0m, in \u001b[0;36mdataset.load\u001b[0;34m(path, read_only, memory_cache_size, local_cache_size, creds, token, org_id, verbose, access_method, reset)\u001b[0m\n\u001b[1;32m 570\u001b[0m dataset_kwargs\u001b[39m.\u001b[39mupdate(\n\u001b[1;32m 571\u001b[0m {\n\u001b[1;32m 572\u001b[0m \u001b[39m\"\u001b[39m\u001b[39maccess_method\u001b[39m\u001b[39m\"\u001b[39m: access_method,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 580\u001b[0m }\n\u001b[1;32m 581\u001b[0m )\n\u001b[1;32m 583\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 584\u001b[0m \u001b[39mreturn\u001b[39;00m dataset\u001b[39m.\u001b[39;49m_load(dataset_kwargs, access_method)\n\u001b[1;32m 585\u001b[0m \u001b[39mexcept\u001b[39;00m (AgreementError, CheckoutError, LockedException) \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 586\u001b[0m \u001b[39mraise\u001b[39;00m e \u001b[39mfrom\u001b[39;00m \u001b[39mNone\u001b[39;00m\n",
|
130 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/api/dataset.py:653\u001b[0m, in \u001b[0;36mdataset._load\u001b[0;34m(dataset_kwargs, access_method, create)\u001b[0m\n\u001b[1;32m 650\u001b[0m \u001b[39m@staticmethod\u001b[39m\n\u001b[1;32m 651\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_load\u001b[39m(dataset_kwargs, access_method\u001b[39m=\u001b[39m\u001b[39mNone\u001b[39;00m, create\u001b[39m=\u001b[39m\u001b[39mFalse\u001b[39;00m):\n\u001b[1;32m 652\u001b[0m \u001b[39mif\u001b[39;00m access_method \u001b[39min\u001b[39;00m (\u001b[39m\"\u001b[39m\u001b[39mstream\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mNone\u001b[39;00m):\n\u001b[0;32m--> 653\u001b[0m ret \u001b[39m=\u001b[39m dataset_factory(\u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mdataset_kwargs)\n\u001b[1;32m 654\u001b[0m \u001b[39mif\u001b[39;00m create:\n\u001b[1;32m 655\u001b[0m dataset_created(ret)\n",
|
131 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/dataset/__init__.py:23\u001b[0m, in \u001b[0;36mdataset_factory\u001b[0;34m(path, *args, **kwargs)\u001b[0m\n\u001b[1;32m 20\u001b[0m clz \u001b[39m=\u001b[39m Dataset\n\u001b[1;32m 22\u001b[0m \u001b[39mif\u001b[39;00m clz \u001b[39min\u001b[39;00m {Dataset, DeepLakeCloudDataset}:\n\u001b[0;32m---> 23\u001b[0m ds \u001b[39m=\u001b[39m clz(path\u001b[39m=\u001b[39;49mpath, \u001b[39m*\u001b[39;49margs, \u001b[39m*\u001b[39;49m\u001b[39m*\u001b[39;49mkwargs)\n\u001b[1;32m 24\u001b[0m \u001b[39mif\u001b[39;00m ds\u001b[39m.\u001b[39mroot\u001b[39m.\u001b[39minfo\u001b[39m.\u001b[39mget(\u001b[39m\"\u001b[39m\u001b[39mvirtual-datasource\u001b[39m\u001b[39m\"\u001b[39m, \u001b[39mFalse\u001b[39;00m):\n\u001b[1;32m 25\u001b[0m ds \u001b[39m=\u001b[39m ds\u001b[39m.\u001b[39m_get_view()\n",
|
132 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/dataset/dataset.py:241\u001b[0m, in \u001b[0;36mDataset.__init__\u001b[0;34m(self, storage, index, group_index, read_only, public, token, org_id, verbose, version_state, path, address, is_iteration, link_creds, pad_tensors, lock, enabled_tensors, view_base, libdeeplake_dataset, **kwargs)\u001b[0m\n\u001b[1;32m 238\u001b[0m dct\u001b[39m.\u001b[39mupdate(d)\n\u001b[1;32m 240\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 241\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_set_derived_attributes(address\u001b[39m=\u001b[39;49maddress)\n\u001b[1;32m 242\u001b[0m \u001b[39mexcept\u001b[39;00m LockedException:\n\u001b[1;32m 243\u001b[0m \u001b[39mraise\u001b[39;00m LockedException(\n\u001b[1;32m 244\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mThis dataset cannot be open for writing as it is locked by another machine. Try loading the dataset with `read_only=True`.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 245\u001b[0m )\n",
|
133 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/dataset/dataset.py:2199\u001b[0m, in \u001b[0;36mDataset._set_derived_attributes\u001b[0;34m(self, verbose, address)\u001b[0m\n\u001b[1;32m 2195\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_load_link_creds()\n\u001b[1;32m 2196\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_set_read_only(\n\u001b[1;32m 2197\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_read_only, err\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_read_only_error\n\u001b[1;32m 2198\u001b[0m ) \u001b[39m# TODO: weird fix for dataset unpickling\u001b[39;00m\n\u001b[0;32m-> 2199\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_populate_meta(verbose) \u001b[39m# TODO: use the same scheme as `load_info`\u001b[39;00m\n\u001b[1;32m 2200\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mindex\u001b[39m.\u001b[39mis_trivial():\n\u001b[1;32m 2201\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mindex \u001b[39m=\u001b[39m Index\u001b[39m.\u001b[39mfrom_json(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmeta\u001b[39m.\u001b[39mdefault_index)\n",
|
134 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/dataset/dataset.py:1742\u001b[0m, in \u001b[0;36mDataset._populate_meta\u001b[0;34m(self, verbose)\u001b[0m\n\u001b[1;32m 1740\u001b[0m \u001b[39m\u001b[39m\u001b[39m\"\"\"Populates the meta information for the dataset.\"\"\"\u001b[39;00m\n\u001b[1;32m 1741\u001b[0m \u001b[39mif\u001b[39;00m dataset_exists(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstorage):\n\u001b[0;32m-> 1742\u001b[0m load_meta(\u001b[39mself\u001b[39;49m)\n\u001b[1;32m 1744\u001b[0m \u001b[39melif\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mstorage\u001b[39m.\u001b[39mempty():\n\u001b[1;32m 1745\u001b[0m \u001b[39m# dataset does not exist, but the path was not empty\u001b[39;00m\n\u001b[1;32m 1746\u001b[0m \u001b[39mraise\u001b[39;00m PathNotEmptyException\n",
|
135 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/util/version_control.py:828\u001b[0m, in \u001b[0;36mload_meta\u001b[0;34m(dataset)\u001b[0m\n\u001b[1;32m 826\u001b[0m \u001b[39mif\u001b[39;00m tensor_key\u001b[39m.\u001b[39mstartswith(\u001b[39m\"\u001b[39m\u001b[39m__temp\u001b[39m\u001b[39m\"\u001b[39m):\n\u001b[1;32m 827\u001b[0m dataset\u001b[39m.\u001b[39m_temp_tensors\u001b[39m.\u001b[39mappend(tensor_key)\n\u001b[0;32m--> 828\u001b[0m _tensors[tensor_key] \u001b[39m=\u001b[39m Tensor(tensor_key, dataset)\n",
|
136 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/tensor.py:238\u001b[0m, in \u001b[0;36mTensor.__init__\u001b[0;34m(self, key, dataset, index, is_iteration, chunk_engine)\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mis_iteration \u001b[39m=\u001b[39m is_iteration\n\u001b[1;32m 236\u001b[0m commit_id \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mversion_state[\u001b[39m\"\u001b[39m\u001b[39mcommit_id\u001b[39m\u001b[39m\"\u001b[39m]\n\u001b[0;32m--> 238\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mis_iteration \u001b[39mand\u001b[39;00m \u001b[39mnot\u001b[39;00m tensor_exists(\n\u001b[1;32m 239\u001b[0m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mkey, \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mstorage, commit_id\n\u001b[1;32m 240\u001b[0m ):\n\u001b[1;32m 241\u001b[0m \u001b[39mraise\u001b[39;00m TensorDoesNotExistError(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mkey)\n\u001b[1;32m 243\u001b[0m meta_key \u001b[39m=\u001b[39m get_tensor_meta_key(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mkey, commit_id)\n",
|
137 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/util/keys.py:197\u001b[0m, in \u001b[0;36mtensor_exists\u001b[0;34m(key, storage, commit_id)\u001b[0m\n\u001b[1;32m 195\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mtensor_exists\u001b[39m(key: \u001b[39mstr\u001b[39m, storage, commit_id: \u001b[39mstr\u001b[39m) \u001b[39m-\u001b[39m\u001b[39m>\u001b[39m \u001b[39mbool\u001b[39m:\n\u001b[1;32m 196\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 197\u001b[0m storage[get_tensor_meta_key(key, commit_id)]\n\u001b[1;32m 198\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mTrue\u001b[39;00m\n\u001b[1;32m 199\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mKeyError\u001b[39;00m:\n",
|
138 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/storage/lru_cache.py:211\u001b[0m, in \u001b[0;36mLRUCache.__getitem__\u001b[0;34m(self, path)\u001b[0m\n\u001b[1;32m 208\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 209\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mnext_storage \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[1;32m 210\u001b[0m \u001b[39m# fetch from storage, may throw KeyError\u001b[39;00m\n\u001b[0;32m--> 211\u001b[0m result \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mnext_storage[path]\n\u001b[1;32m 213\u001b[0m \u001b[39mif\u001b[39;00m _get_nbytes(result) \u001b[39m<\u001b[39m\u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcache_size: \u001b[39m# insert in cache if it fits\u001b[39;00m\n\u001b[1;32m 214\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_insert_in_cache(path, result)\n",
|
139 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/storage/s3.py:215\u001b[0m, in \u001b[0;36mS3Provider.__getitem__\u001b[0;34m(self, path)\u001b[0m\n\u001b[1;32m 202\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m__getitem__\u001b[39m(\u001b[39mself\u001b[39m, path):\n\u001b[1;32m 203\u001b[0m \u001b[39m \u001b[39m\u001b[39m\"\"\"Gets the object present at the path.\u001b[39;00m\n\u001b[1;32m 204\u001b[0m \n\u001b[1;32m 205\u001b[0m \u001b[39m Args:\u001b[39;00m\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 213\u001b[0m \u001b[39m S3GetError: Any other error other than KeyError while retrieving the object.\u001b[39;00m\n\u001b[1;32m 214\u001b[0m \u001b[39m \"\"\"\u001b[39;00m\n\u001b[0;32m--> 215\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mget_bytes(path)\n",
|
140 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/storage/s3.py:258\u001b[0m, in \u001b[0;36mS3Provider.get_bytes\u001b[0;34m(self, path, start_byte, end_byte)\u001b[0m\n\u001b[1;32m 256\u001b[0m path \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m.\u001b[39mjoin((\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mpath, path))\n\u001b[1;32m 257\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 258\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get_bytes(path, start_byte, end_byte)\n\u001b[1;32m 259\u001b[0m \u001b[39mexcept\u001b[39;00m botocore\u001b[39m.\u001b[39mexceptions\u001b[39m.\u001b[39mClientError \u001b[39mas\u001b[39;00m err:\n\u001b[1;32m 260\u001b[0m \u001b[39mif\u001b[39;00m err\u001b[39m.\u001b[39mresponse[\u001b[39m\"\u001b[39m\u001b[39mError\u001b[39m\u001b[39m\"\u001b[39m][\u001b[39m\"\u001b[39m\u001b[39mCode\u001b[39m\u001b[39m\"\u001b[39m] \u001b[39m==\u001b[39m \u001b[39m\"\u001b[39m\u001b[39mNoSuchKey\u001b[39m\u001b[39m\"\u001b[39m:\n",
|
141 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/deeplake/core/storage/s3.py:230\u001b[0m, in \u001b[0;36mS3Provider._get_bytes\u001b[0;34m(self, path, start_byte, end_byte)\u001b[0m\n\u001b[1;32m 228\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 229\u001b[0m \u001b[39mrange\u001b[39m \u001b[39m=\u001b[39m \u001b[39m\"\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[0;32m--> 230\u001b[0m resp \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mclient\u001b[39m.\u001b[39;49mget_object(Bucket\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mbucket, Key\u001b[39m=\u001b[39;49mpath, Range\u001b[39m=\u001b[39;49m\u001b[39mrange\u001b[39;49m)\n\u001b[1;32m 231\u001b[0m \u001b[39mreturn\u001b[39;00m resp[\u001b[39m\"\u001b[39m\u001b[39mBody\u001b[39m\u001b[39m\"\u001b[39m]\u001b[39m.\u001b[39mread()\n",
|
142 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/client.py:530\u001b[0m, in \u001b[0;36mClientCreator._create_api_method.<locals>._api_call\u001b[0;34m(self, *args, **kwargs)\u001b[0m\n\u001b[1;32m 526\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mTypeError\u001b[39;00m(\n\u001b[1;32m 527\u001b[0m \u001b[39mf\u001b[39m\u001b[39m\"\u001b[39m\u001b[39m{\u001b[39;00mpy_operation_name\u001b[39m}\u001b[39;00m\u001b[39m() only accepts keyword arguments.\u001b[39m\u001b[39m\"\u001b[39m\n\u001b[1;32m 528\u001b[0m )\n\u001b[1;32m 529\u001b[0m \u001b[39m# The \"self\" in this scope is referring to the BaseClient.\u001b[39;00m\n\u001b[0;32m--> 530\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_api_call(operation_name, kwargs)\n",
|
143 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/client.py:943\u001b[0m, in \u001b[0;36mBaseClient._make_api_call\u001b[0;34m(self, operation_name, api_params)\u001b[0m\n\u001b[1;32m 941\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 942\u001b[0m apply_request_checksum(request_dict)\n\u001b[0;32m--> 943\u001b[0m http, parsed_response \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_request(\n\u001b[1;32m 944\u001b[0m operation_model, request_dict, request_context\n\u001b[1;32m 945\u001b[0m )\n\u001b[1;32m 947\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmeta\u001b[39m.\u001b[39mevents\u001b[39m.\u001b[39memit(\n\u001b[1;32m 948\u001b[0m \u001b[39m'\u001b[39m\u001b[39mafter-call.\u001b[39m\u001b[39m{service_id}\u001b[39;00m\u001b[39m.\u001b[39m\u001b[39m{operation_name}\u001b[39;00m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39mformat(\n\u001b[1;32m 949\u001b[0m service_id\u001b[39m=\u001b[39mservice_id, operation_name\u001b[39m=\u001b[39moperation_name\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 954\u001b[0m context\u001b[39m=\u001b[39mrequest_context,\n\u001b[1;32m 955\u001b[0m )\n\u001b[1;32m 957\u001b[0m \u001b[39mif\u001b[39;00m http\u001b[39m.\u001b[39mstatus_code \u001b[39m>\u001b[39m\u001b[39m=\u001b[39m \u001b[39m300\u001b[39m:\n",
|
144 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/client.py:966\u001b[0m, in \u001b[0;36mBaseClient._make_request\u001b[0;34m(self, operation_model, request_dict, request_context)\u001b[0m\n\u001b[1;32m 964\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_make_request\u001b[39m(\u001b[39mself\u001b[39m, operation_model, request_dict, request_context):\n\u001b[1;32m 965\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 966\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_endpoint\u001b[39m.\u001b[39;49mmake_request(operation_model, request_dict)\n\u001b[1;32m 967\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 968\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mmeta\u001b[39m.\u001b[39mevents\u001b[39m.\u001b[39memit(\n\u001b[1;32m 969\u001b[0m \u001b[39m'\u001b[39m\u001b[39mafter-call-error.\u001b[39m\u001b[39m{service_id}\u001b[39;00m\u001b[39m.\u001b[39m\u001b[39m{operation_name}\u001b[39;00m\u001b[39m'\u001b[39m\u001b[39m.\u001b[39mformat(\n\u001b[1;32m 970\u001b[0m service_id\u001b[39m=\u001b[39m\u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_service_model\u001b[39m.\u001b[39mservice_id\u001b[39m.\u001b[39mhyphenize(),\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 974\u001b[0m context\u001b[39m=\u001b[39mrequest_context,\n\u001b[1;32m 975\u001b[0m )\n",
|
145 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/endpoint.py:119\u001b[0m, in \u001b[0;36mEndpoint.make_request\u001b[0;34m(self, operation_model, request_dict)\u001b[0m\n\u001b[1;32m 113\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39mmake_request\u001b[39m(\u001b[39mself\u001b[39m, operation_model, request_dict):\n\u001b[1;32m 114\u001b[0m logger\u001b[39m.\u001b[39mdebug(\n\u001b[1;32m 115\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mMaking request for \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m with params: \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m\"\u001b[39m,\n\u001b[1;32m 116\u001b[0m operation_model,\n\u001b[1;32m 117\u001b[0m request_dict,\n\u001b[1;32m 118\u001b[0m )\n\u001b[0;32m--> 119\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_send_request(request_dict, operation_model)\n",
|
146 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/endpoint.py:199\u001b[0m, in \u001b[0;36mEndpoint._send_request\u001b[0;34m(self, request_dict, operation_model)\u001b[0m\n\u001b[1;32m 197\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_update_retries_context(context, attempts)\n\u001b[1;32m 198\u001b[0m request \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mcreate_request(request_dict, operation_model)\n\u001b[0;32m--> 199\u001b[0m success_response, exception \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_get_response(\n\u001b[1;32m 200\u001b[0m request, operation_model, context\n\u001b[1;32m 201\u001b[0m )\n\u001b[1;32m 202\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_needs_retry(\n\u001b[1;32m 203\u001b[0m attempts,\n\u001b[1;32m 204\u001b[0m operation_model,\n\u001b[0;32m (...)\u001b[0m\n\u001b[1;32m 207\u001b[0m exception,\n\u001b[1;32m 208\u001b[0m ):\n\u001b[1;32m 209\u001b[0m attempts \u001b[39m+\u001b[39m\u001b[39m=\u001b[39m \u001b[39m1\u001b[39m\n",
|
147 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/endpoint.py:241\u001b[0m, in \u001b[0;36mEndpoint._get_response\u001b[0;34m(self, request, operation_model, context)\u001b[0m\n\u001b[1;32m 235\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_get_response\u001b[39m(\u001b[39mself\u001b[39m, request, operation_model, context):\n\u001b[1;32m 236\u001b[0m \u001b[39m# This will return a tuple of (success_response, exception)\u001b[39;00m\n\u001b[1;32m 237\u001b[0m \u001b[39m# and success_response is itself a tuple of\u001b[39;00m\n\u001b[1;32m 238\u001b[0m \u001b[39m# (http_response, parsed_dict).\u001b[39;00m\n\u001b[1;32m 239\u001b[0m \u001b[39m# If an exception occurs then the success_response is None.\u001b[39;00m\n\u001b[1;32m 240\u001b[0m \u001b[39m# If no exception occurs then exception is None.\u001b[39;00m\n\u001b[0;32m--> 241\u001b[0m success_response, exception \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_do_get_response(\n\u001b[1;32m 242\u001b[0m request, operation_model, context\n\u001b[1;32m 243\u001b[0m )\n\u001b[1;32m 244\u001b[0m kwargs_to_emit \u001b[39m=\u001b[39m {\n\u001b[1;32m 245\u001b[0m \u001b[39m'\u001b[39m\u001b[39mresponse_dict\u001b[39m\u001b[39m'\u001b[39m: \u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 246\u001b[0m \u001b[39m'\u001b[39m\u001b[39mparsed_response\u001b[39m\u001b[39m'\u001b[39m: \u001b[39mNone\u001b[39;00m,\n\u001b[1;32m 247\u001b[0m \u001b[39m'\u001b[39m\u001b[39mcontext\u001b[39m\u001b[39m'\u001b[39m: context,\n\u001b[1;32m 248\u001b[0m \u001b[39m'\u001b[39m\u001b[39mexception\u001b[39m\u001b[39m'\u001b[39m: exception,\n\u001b[1;32m 249\u001b[0m }\n\u001b[1;32m 250\u001b[0m \u001b[39mif\u001b[39;00m success_response \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n",
|
148 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/endpoint.py:281\u001b[0m, in \u001b[0;36mEndpoint._do_get_response\u001b[0;34m(self, request, operation_model, context)\u001b[0m\n\u001b[1;32m 279\u001b[0m http_response \u001b[39m=\u001b[39m first_non_none_response(responses)\n\u001b[1;32m 280\u001b[0m \u001b[39mif\u001b[39;00m http_response \u001b[39mis\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m--> 281\u001b[0m http_response \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_send(request)\n\u001b[1;32m 282\u001b[0m \u001b[39mexcept\u001b[39;00m HTTPClientError \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 283\u001b[0m \u001b[39mreturn\u001b[39;00m (\u001b[39mNone\u001b[39;00m, e)\n",
|
149 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/endpoint.py:377\u001b[0m, in \u001b[0;36mEndpoint._send\u001b[0;34m(self, request)\u001b[0m\n\u001b[1;32m 376\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_send\u001b[39m(\u001b[39mself\u001b[39m, request):\n\u001b[0;32m--> 377\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mhttp_session\u001b[39m.\u001b[39;49msend(request)\n",
|
150 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/botocore/httpsession.py:455\u001b[0m, in \u001b[0;36mURLLib3Session.send\u001b[0;34m(self, request)\u001b[0m\n\u001b[1;32m 452\u001b[0m conn\u001b[39m.\u001b[39mproxy_headers[\u001b[39m'\u001b[39m\u001b[39mhost\u001b[39m\u001b[39m'\u001b[39m] \u001b[39m=\u001b[39m host\n\u001b[1;32m 454\u001b[0m request_target \u001b[39m=\u001b[39m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_get_request_target(request\u001b[39m.\u001b[39murl, proxy_url)\n\u001b[0;32m--> 455\u001b[0m urllib_response \u001b[39m=\u001b[39m conn\u001b[39m.\u001b[39;49murlopen(\n\u001b[1;32m 456\u001b[0m method\u001b[39m=\u001b[39;49mrequest\u001b[39m.\u001b[39;49mmethod,\n\u001b[1;32m 457\u001b[0m url\u001b[39m=\u001b[39;49mrequest_target,\n\u001b[1;32m 458\u001b[0m body\u001b[39m=\u001b[39;49mrequest\u001b[39m.\u001b[39;49mbody,\n\u001b[1;32m 459\u001b[0m headers\u001b[39m=\u001b[39;49mrequest\u001b[39m.\u001b[39;49mheaders,\n\u001b[1;32m 460\u001b[0m retries\u001b[39m=\u001b[39;49mRetry(\u001b[39mFalse\u001b[39;49;00m),\n\u001b[1;32m 461\u001b[0m assert_same_host\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[1;32m 462\u001b[0m preload_content\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[1;32m 463\u001b[0m decode_content\u001b[39m=\u001b[39;49m\u001b[39mFalse\u001b[39;49;00m,\n\u001b[1;32m 464\u001b[0m chunked\u001b[39m=\u001b[39;49m\u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_chunked(request\u001b[39m.\u001b[39;49mheaders),\n\u001b[1;32m 465\u001b[0m )\n\u001b[1;32m 467\u001b[0m http_response \u001b[39m=\u001b[39m botocore\u001b[39m.\u001b[39mawsrequest\u001b[39m.\u001b[39mAWSResponse(\n\u001b[1;32m 468\u001b[0m request\u001b[39m.\u001b[39murl,\n\u001b[1;32m 469\u001b[0m urllib_response\u001b[39m.\u001b[39mstatus,\n\u001b[1;32m 470\u001b[0m urllib_response\u001b[39m.\u001b[39mheaders,\n\u001b[1;32m 471\u001b[0m urllib_response,\n\u001b[1;32m 472\u001b[0m )\n\u001b[1;32m 474\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m request\u001b[39m.\u001b[39mstream_output:\n\u001b[1;32m 475\u001b[0m \u001b[39m# Cause the raw stream to be exhausted immediately. We do it\u001b[39;00m\n\u001b[1;32m 476\u001b[0m \u001b[39m# this way instead of using preload_content because\u001b[39;00m\n\u001b[1;32m 477\u001b[0m \u001b[39m# preload_content will never buffer chunked responses\u001b[39;00m\n",
|
151 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connectionpool.py:703\u001b[0m, in \u001b[0;36mHTTPConnectionPool.urlopen\u001b[0;34m(self, method, url, body, headers, retries, redirect, assert_same_host, timeout, pool_timeout, release_conn, chunked, body_pos, **response_kw)\u001b[0m\n\u001b[1;32m 700\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_prepare_proxy(conn)\n\u001b[1;32m 702\u001b[0m \u001b[39m# Make the request on the httplib connection object.\u001b[39;00m\n\u001b[0;32m--> 703\u001b[0m httplib_response \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_make_request(\n\u001b[1;32m 704\u001b[0m conn,\n\u001b[1;32m 705\u001b[0m method,\n\u001b[1;32m 706\u001b[0m url,\n\u001b[1;32m 707\u001b[0m timeout\u001b[39m=\u001b[39;49mtimeout_obj,\n\u001b[1;32m 708\u001b[0m body\u001b[39m=\u001b[39;49mbody,\n\u001b[1;32m 709\u001b[0m headers\u001b[39m=\u001b[39;49mheaders,\n\u001b[1;32m 710\u001b[0m chunked\u001b[39m=\u001b[39;49mchunked,\n\u001b[1;32m 711\u001b[0m )\n\u001b[1;32m 713\u001b[0m \u001b[39m# If we're going to release the connection in ``finally:``, then\u001b[39;00m\n\u001b[1;32m 714\u001b[0m \u001b[39m# the response doesn't need to know about the connection. Otherwise\u001b[39;00m\n\u001b[1;32m 715\u001b[0m \u001b[39m# it will also try to release it and we'll have a double-release\u001b[39;00m\n\u001b[1;32m 716\u001b[0m \u001b[39m# mess.\u001b[39;00m\n\u001b[1;32m 717\u001b[0m response_conn \u001b[39m=\u001b[39m conn \u001b[39mif\u001b[39;00m \u001b[39mnot\u001b[39;00m release_conn \u001b[39melse\u001b[39;00m \u001b[39mNone\u001b[39;00m\n",
|
152 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connectionpool.py:449\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[0;34m(self, conn, method, url, timeout, chunked, **httplib_request_kw)\u001b[0m\n\u001b[1;32m 444\u001b[0m httplib_response \u001b[39m=\u001b[39m conn\u001b[39m.\u001b[39mgetresponse()\n\u001b[1;32m 445\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mBaseException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 446\u001b[0m \u001b[39m# Remove the TypeError from the exception chain in\u001b[39;00m\n\u001b[1;32m 447\u001b[0m \u001b[39m# Python 3 (including for exceptions like SystemExit).\u001b[39;00m\n\u001b[1;32m 448\u001b[0m \u001b[39m# Otherwise it looks like a bug in the code.\u001b[39;00m\n\u001b[0;32m--> 449\u001b[0m six\u001b[39m.\u001b[39;49mraise_from(e, \u001b[39mNone\u001b[39;49;00m)\n\u001b[1;32m 450\u001b[0m \u001b[39mexcept\u001b[39;00m (SocketTimeout, BaseSSLError, SocketError) \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 451\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_raise_timeout(err\u001b[39m=\u001b[39me, url\u001b[39m=\u001b[39murl, timeout_value\u001b[39m=\u001b[39mread_timeout)\n",
|
153 |
+
"File \u001b[0;32m<string>:3\u001b[0m, in \u001b[0;36mraise_from\u001b[0;34m(value, from_value)\u001b[0m\n",
|
154 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/urllib3/connectionpool.py:444\u001b[0m, in \u001b[0;36mHTTPConnectionPool._make_request\u001b[0;34m(self, conn, method, url, timeout, chunked, **httplib_request_kw)\u001b[0m\n\u001b[1;32m 441\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mTypeError\u001b[39;00m:\n\u001b[1;32m 442\u001b[0m \u001b[39m# Python 3\u001b[39;00m\n\u001b[1;32m 443\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 444\u001b[0m httplib_response \u001b[39m=\u001b[39m conn\u001b[39m.\u001b[39;49mgetresponse()\n\u001b[1;32m 445\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mBaseException\u001b[39;00m \u001b[39mas\u001b[39;00m e:\n\u001b[1;32m 446\u001b[0m \u001b[39m# Remove the TypeError from the exception chain in\u001b[39;00m\n\u001b[1;32m 447\u001b[0m \u001b[39m# Python 3 (including for exceptions like SystemExit).\u001b[39;00m\n\u001b[1;32m 448\u001b[0m \u001b[39m# Otherwise it looks like a bug in the code.\u001b[39;00m\n\u001b[1;32m 449\u001b[0m six\u001b[39m.\u001b[39mraise_from(e, \u001b[39mNone\u001b[39;00m)\n",
|
155 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:1375\u001b[0m, in \u001b[0;36mHTTPConnection.getresponse\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 1373\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 1374\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m-> 1375\u001b[0m response\u001b[39m.\u001b[39;49mbegin()\n\u001b[1;32m 1376\u001b[0m \u001b[39mexcept\u001b[39;00m \u001b[39mConnectionError\u001b[39;00m:\n\u001b[1;32m 1377\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39mclose()\n",
|
156 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:318\u001b[0m, in \u001b[0;36mHTTPResponse.begin\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 316\u001b[0m \u001b[39m# read until we get a non-100 response\u001b[39;00m\n\u001b[1;32m 317\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mTrue\u001b[39;00m:\n\u001b[0;32m--> 318\u001b[0m version, status, reason \u001b[39m=\u001b[39m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_read_status()\n\u001b[1;32m 319\u001b[0m \u001b[39mif\u001b[39;00m status \u001b[39m!=\u001b[39m CONTINUE:\n\u001b[1;32m 320\u001b[0m \u001b[39mbreak\u001b[39;00m\n",
|
157 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/http/client.py:279\u001b[0m, in \u001b[0;36mHTTPResponse._read_status\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 278\u001b[0m \u001b[39mdef\u001b[39;00m \u001b[39m_read_status\u001b[39m(\u001b[39mself\u001b[39m):\n\u001b[0;32m--> 279\u001b[0m line \u001b[39m=\u001b[39m \u001b[39mstr\u001b[39m(\u001b[39mself\u001b[39m\u001b[39m.\u001b[39mfp\u001b[39m.\u001b[39mreadline(_MAXLINE \u001b[39m+\u001b[39m \u001b[39m1\u001b[39m), \u001b[39m\"\u001b[39m\u001b[39miso-8859-1\u001b[39m\u001b[39m\"\u001b[39m)\n\u001b[1;32m 280\u001b[0m \u001b[39mif\u001b[39;00m \u001b[39mlen\u001b[39m(line) \u001b[39m>\u001b[39m _MAXLINE:\n\u001b[1;32m 281\u001b[0m \u001b[39mraise\u001b[39;00m LineTooLong(\u001b[39m\"\u001b[39m\u001b[39mstatus line\u001b[39m\u001b[39m\"\u001b[39m)\n",
|
158 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/socket.py:706\u001b[0m, in \u001b[0;36mSocketIO.readinto\u001b[0;34m(self, b)\u001b[0m\n\u001b[1;32m 704\u001b[0m \u001b[39mwhile\u001b[39;00m \u001b[39mTrue\u001b[39;00m:\n\u001b[1;32m 705\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[0;32m--> 706\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_sock\u001b[39m.\u001b[39;49mrecv_into(b)\n\u001b[1;32m 707\u001b[0m \u001b[39mexcept\u001b[39;00m timeout:\n\u001b[1;32m 708\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_timeout_occurred \u001b[39m=\u001b[39m \u001b[39mTrue\u001b[39;00m\n",
|
159 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py:1278\u001b[0m, in \u001b[0;36mSSLSocket.recv_into\u001b[0;34m(self, buffer, nbytes, flags)\u001b[0m\n\u001b[1;32m 1274\u001b[0m \u001b[39mif\u001b[39;00m flags \u001b[39m!=\u001b[39m \u001b[39m0\u001b[39m:\n\u001b[1;32m 1275\u001b[0m \u001b[39mraise\u001b[39;00m \u001b[39mValueError\u001b[39;00m(\n\u001b[1;32m 1276\u001b[0m \u001b[39m\"\u001b[39m\u001b[39mnon-zero flags not allowed in calls to recv_into() on \u001b[39m\u001b[39m%s\u001b[39;00m\u001b[39m\"\u001b[39m \u001b[39m%\u001b[39m\n\u001b[1;32m 1277\u001b[0m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m\u001b[39m__class__\u001b[39m)\n\u001b[0;32m-> 1278\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49mread(nbytes, buffer)\n\u001b[1;32m 1279\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1280\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39msuper\u001b[39m()\u001b[39m.\u001b[39mrecv_into(buffer, nbytes, flags)\n",
|
160 |
+
"File \u001b[0;32m/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ssl.py:1134\u001b[0m, in \u001b[0;36mSSLSocket.read\u001b[0;34m(self, len, buffer)\u001b[0m\n\u001b[1;32m 1132\u001b[0m \u001b[39mtry\u001b[39;00m:\n\u001b[1;32m 1133\u001b[0m \u001b[39mif\u001b[39;00m buffer \u001b[39mis\u001b[39;00m \u001b[39mnot\u001b[39;00m \u001b[39mNone\u001b[39;00m:\n\u001b[0;32m-> 1134\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39;49m\u001b[39m.\u001b[39;49m_sslobj\u001b[39m.\u001b[39;49mread(\u001b[39mlen\u001b[39;49m, buffer)\n\u001b[1;32m 1135\u001b[0m \u001b[39melse\u001b[39;00m:\n\u001b[1;32m 1136\u001b[0m \u001b[39mreturn\u001b[39;00m \u001b[39mself\u001b[39m\u001b[39m.\u001b[39m_sslobj\u001b[39m.\u001b[39mread(\u001b[39mlen\u001b[39m)\n",
|
161 |
+
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
|
162 |
+
]
|
163 |
+
}
|
164 |
+
],
|
165 |
+
"source": [
|
166 |
+
"db = DeepLake(dataset_path=f\"hub://{username}/{projectname}\", read_only=True, embedding_function=embeddings)"
|
167 |
+
]
|
168 |
+
},
|
169 |
+
{
|
170 |
+
"cell_type": "code",
|
171 |
+
"execution_count": null,
|
172 |
+
"metadata": {},
|
173 |
+
"outputs": [],
|
174 |
+
"source": [
|
175 |
+
"retriever = db.as_retriever()\n",
|
176 |
+
"retriever.search_kwargs['distance_metric'] = 'cos'\n",
|
177 |
+
"retriever.search_kwargs['fetch_k'] = 100\n",
|
178 |
+
"retriever.search_kwargs['maximal_marginal_relevance'] = True\n",
|
179 |
+
"retriever.search_kwargs['k'] = 10"
|
180 |
+
]
|
181 |
+
},
|
182 |
+
{
|
183 |
+
"cell_type": "code",
|
184 |
+
"execution_count": null,
|
185 |
+
"metadata": {},
|
186 |
+
"outputs": [],
|
187 |
+
"source": [
|
188 |
+
"from langchain.chat_models import ChatOpenAI\n",
|
189 |
+
"from langchain.chains import ConversationalRetrievalChain\n",
|
190 |
+
"\n",
|
191 |
+
"model = ChatOpenAI(model_name='gpt-3.5-turbo') # switch to 'gpt-4'\n",
|
192 |
+
"qa = ConversationalRetrievalChain.from_llm(model, retriever=retriever)"
|
193 |
+
]
|
194 |
+
},
|
195 |
+
{
|
196 |
+
"cell_type": "code",
|
197 |
+
"execution_count": null,
|
198 |
+
"metadata": {},
|
199 |
+
"outputs": [
|
200 |
+
{
|
201 |
+
"name": "stdout",
|
202 |
+
"output_type": "stream",
|
203 |
+
"text": [
|
204 |
+
"-> **Question**: 1. Crease a sample polywrap client invokation text snippet. \n",
|
205 |
+
"\n",
|
206 |
+
"**Answer**: ```typescript\n",
|
207 |
+
"const client = new PolywrapClient();\n",
|
208 |
+
"\n",
|
209 |
+
"const result = await client.invoke({\n",
|
210 |
+
" uri: \"ens/wraps.eth:logger@1.0.0\",\n",
|
211 |
+
" method: \"log\",\n",
|
212 |
+
" args: {\n",
|
213 |
+
" message: \"Hello Polywrap!\",\n",
|
214 |
+
" },\n",
|
215 |
+
"});\n",
|
216 |
+
"\n",
|
217 |
+
"console.log(result);\n",
|
218 |
+
"``` \n",
|
219 |
+
"\n"
|
220 |
+
]
|
221 |
+
}
|
222 |
+
],
|
223 |
+
"source": [
|
224 |
+
"questions = [\n",
|
225 |
+
" \"\"\"1. Crease a sample polywrap client invokation text snippet to register the ENS domain `rihp.eth`.\"\"\", \n",
|
226 |
+
"] \n",
|
227 |
+
"chat_history = []\n",
|
228 |
+
"\n",
|
229 |
+
"for question in questions: \n",
|
230 |
+
" result = qa({\"question\": question, \"chat_history\": chat_history})\n",
|
231 |
+
" chat_history.append((question, result['answer']))\n",
|
232 |
+
" print(f\"-> **Question**: {question} \\n\")\n",
|
233 |
+
" print(f\"**Answer**: {result['answer']} \\n\")"
|
234 |
+
]
|
235 |
+
},
|
236 |
+
{
|
237 |
+
"cell_type": "code",
|
238 |
+
"execution_count": null,
|
239 |
+
"metadata": {},
|
240 |
+
"outputs": [],
|
241 |
+
"source": []
|
242 |
+
}
|
243 |
+
],
|
244 |
+
"metadata": {
|
245 |
+
"kernelspec": {
|
246 |
+
"display_name": "Python 3.11.3 64-bit",
|
247 |
+
"language": "python",
|
248 |
+
"name": "python3"
|
249 |
+
},
|
250 |
+
"language_info": {
|
251 |
+
"codemirror_mode": {
|
252 |
+
"name": "ipython",
|
253 |
+
"version": 3
|
254 |
+
},
|
255 |
+
"file_extension": ".py",
|
256 |
+
"mimetype": "text/x-python",
|
257 |
+
"name": "python",
|
258 |
+
"nbconvert_exporter": "python",
|
259 |
+
"pygments_lexer": "ipython3",
|
260 |
+
"version": "3.11.3"
|
261 |
+
},
|
262 |
+
"orig_nbformat": 4,
|
263 |
+
"vscode": {
|
264 |
+
"interpreter": {
|
265 |
+
"hash": "aee8b7b246df8f9039afb4144a1f6fd8d2ca17a180786b69acc140d282b71a49"
|
266 |
+
}
|
267 |
+
}
|
268 |
+
},
|
269 |
+
"nbformat": 4,
|
270 |
+
"nbformat_minor": 2
|
271 |
+
}
|
polywrapgpt/Readme.md
ADDED
File without changes
|
polywrapgpt/e2e.spec.ts
ADDED
@@ -0,0 +1,765 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import {
|
2 |
+
providers as testEnvProviders,
|
3 |
+
ensAddresses,
|
4 |
+
} from "@polywrap/test-env-js";
|
5 |
+
import { PolywrapClient } from "@polywrap/client-js";
|
6 |
+
import path from "path";
|
7 |
+
import { providers } from "ethers";
|
8 |
+
|
9 |
+
import { getConfig } from "./utils";
|
10 |
+
import { initInfra, stopInfra } from "./infra";
|
11 |
+
|
12 |
+
jest.setTimeout(900000);
|
13 |
+
|
14 |
+
describe("ENS Wrapper", () => {
|
15 |
+
// We will have two clients because we need two
|
16 |
+
// different signers in order to test ENS functions
|
17 |
+
let ownerClient: PolywrapClient;
|
18 |
+
let anotherOwnerClient: PolywrapClient;
|
19 |
+
|
20 |
+
let fsUri: string;
|
21 |
+
let ethersProvider: providers.JsonRpcProvider;
|
22 |
+
let registryAddress: string;
|
23 |
+
let registrarAddress: string;
|
24 |
+
let resolverAddress: string;
|
25 |
+
let reverseRegistryAddress: string;
|
26 |
+
let customFifsRegistrarAddress: string;
|
27 |
+
|
28 |
+
let owner: string;
|
29 |
+
let anotherOwner: string;
|
30 |
+
|
31 |
+
const customTld: string = "doe.eth";
|
32 |
+
const openSubdomain: string = "open." + customTld;
|
33 |
+
const customSubdomain: string = "john." + customTld;
|
34 |
+
|
35 |
+
const network: string = "testnet";
|
36 |
+
|
37 |
+
beforeAll(async () => {
|
38 |
+
await initInfra();
|
39 |
+
|
40 |
+
// get ens wrapepr uri
|
41 |
+
const apiPath: string = path.resolve(__dirname + "/../../");
|
42 |
+
fsUri = `fs/${apiPath}/build`;
|
43 |
+
|
44 |
+
// set up ethers provider
|
45 |
+
ethersProvider = providers.getDefaultProvider(
|
46 |
+
testEnvProviders.ethereum
|
47 |
+
) as providers.JsonRpcProvider;
|
48 |
+
owner = (await ethersProvider.getSigner(0).getAddress()).toLowerCase();
|
49 |
+
anotherOwner = (await ethersProvider.getSigner(1).getAddress()).toLowerCase();
|
50 |
+
registryAddress = ensAddresses.ensAddress;
|
51 |
+
registrarAddress = ensAddresses.registrarAddress;
|
52 |
+
resolverAddress = ensAddresses.resolverAddress.toLowerCase();
|
53 |
+
reverseRegistryAddress = ensAddresses.reverseAddress;
|
54 |
+
|
55 |
+
// get client
|
56 |
+
const config = getConfig(testEnvProviders.ethereum, ensAddresses.ensAddress, testEnvProviders.ipfs);
|
57 |
+
ownerClient = new PolywrapClient(config, { noDefaults: true });
|
58 |
+
|
59 |
+
const anotherOwnerConfig = getConfig(
|
60 |
+
testEnvProviders.ethereum,
|
61 |
+
ensAddresses.ensAddress,
|
62 |
+
testEnvProviders.ipfs,
|
63 |
+
anotherOwner
|
64 |
+
);
|
65 |
+
anotherOwnerClient = new PolywrapClient(anotherOwnerConfig, { noDefaults: true });
|
66 |
+
});
|
67 |
+
|
68 |
+
afterAll(async () => {
|
69 |
+
await stopInfra();
|
70 |
+
});
|
71 |
+
|
72 |
+
it("should register domain", async () => {
|
73 |
+
const result = await ownerClient.invoke<string>({
|
74 |
+
uri: fsUri,
|
75 |
+
method: "registerDomain",
|
76 |
+
args: {
|
77 |
+
domain: customTld,
|
78 |
+
owner,
|
79 |
+
registrarAddress,
|
80 |
+
connection: {
|
81 |
+
networkNameOrChainId: network
|
82 |
+
}
|
83 |
+
}
|
84 |
+
});
|
85 |
+
|
86 |
+
if (result.ok === false) throw result.error;
|
87 |
+
expect(result.value).toBeDefined();
|
88 |
+
});
|
89 |
+
|
90 |
+
it("should set and get resolver", async () => {
|
91 |
+
const setResult = await ownerClient.invoke({
|
92 |
+
uri: fsUri,
|
93 |
+
method: "setResolver",
|
94 |
+
args: {
|
95 |
+
domain: customTld,
|
96 |
+
owner,
|
97 |
+
registryAddress,
|
98 |
+
resolverAddress: resolverAddress,
|
99 |
+
connection: {
|
100 |
+
networkNameOrChainId: network
|
101 |
+
}
|
102 |
+
}
|
103 |
+
});
|
104 |
+
|
105 |
+
if (setResult.ok === false) throw setResult.error;
|
106 |
+
expect(setResult.value).toBeDefined();
|
107 |
+
|
108 |
+
const getResult = await ownerClient.invoke({
|
109 |
+
uri: fsUri,
|
110 |
+
method: "getResolver",
|
111 |
+
args: {
|
112 |
+
domain: customTld,
|
113 |
+
registryAddress,
|
114 |
+
connection: {
|
115 |
+
networkNameOrChainId: network
|
116 |
+
}
|
117 |
+
}
|
118 |
+
});
|
119 |
+
|
120 |
+
if (getResult.ok === false) throw getResult.error;
|
121 |
+
expect(getResult.value).toEqual(resolverAddress);
|
122 |
+
});
|
123 |
+
|
124 |
+
it("should set owner of subdomain and fetch it", async () => {
|
125 |
+
const subdomain = "bob." + customTld;
|
126 |
+
|
127 |
+
const setResult = await ownerClient.invoke({
|
128 |
+
uri: fsUri,
|
129 |
+
method: "setSubdomainOwner",
|
130 |
+
args: {
|
131 |
+
subdomain,
|
132 |
+
owner,
|
133 |
+
registryAddress,
|
134 |
+
connection: {
|
135 |
+
networkNameOrChainId: network
|
136 |
+
}
|
137 |
+
}
|
138 |
+
});
|
139 |
+
|
140 |
+
if (setResult.ok === false) throw setResult.error;
|
141 |
+
expect(setResult.value).toBeDefined();
|
142 |
+
|
143 |
+
const getResult = await ownerClient.invoke({
|
144 |
+
uri: fsUri,
|
145 |
+
method: "getOwner",
|
146 |
+
args: {
|
147 |
+
domain: subdomain,
|
148 |
+
registryAddress,
|
149 |
+
connection: {
|
150 |
+
networkNameOrChainId: network
|
151 |
+
}
|
152 |
+
}
|
153 |
+
});
|
154 |
+
|
155 |
+
if (getResult.ok === false) throw getResult.error;
|
156 |
+
expect(getResult.value).toBeDefined();
|
157 |
+
});
|
158 |
+
|
159 |
+
it("should register domain with subdomains recursively and fetch it", async () => {
|
160 |
+
const domain = "foo.bar.baz.mydomain.eth";
|
161 |
+
|
162 |
+
const registerDomainAndSubdomainsRecursivelyResult = await ownerClient.invoke<any[]>({
|
163 |
+
uri: fsUri,
|
164 |
+
method: "registerDomainAndSubdomainsRecursively",
|
165 |
+
args: {
|
166 |
+
domain,
|
167 |
+
owner,
|
168 |
+
registryAddress,
|
169 |
+
resolverAddress,
|
170 |
+
registrarAddress,
|
171 |
+
ttl: '0',
|
172 |
+
connection: {
|
173 |
+
networkNameOrChainId: network
|
174 |
+
}
|
175 |
+
}
|
176 |
+
});
|
177 |
+
|
178 |
+
if (registerDomainAndSubdomainsRecursivelyResult.ok === false) throw registerDomainAndSubdomainsRecursivelyResult.error;
|
179 |
+
expect(registerDomainAndSubdomainsRecursivelyResult.value).toBeDefined();
|
180 |
+
|
181 |
+
const resultingRegistrations = registerDomainAndSubdomainsRecursivelyResult.value;
|
182 |
+
|
183 |
+
expect(resultingRegistrations[0]?.name).toBe("mydomain.eth")
|
184 |
+
expect(resultingRegistrations[0]?.didRegister).toBe(true)
|
185 |
+
expect(resultingRegistrations[1]?.name).toBe("baz.mydomain.eth")
|
186 |
+
expect(resultingRegistrations[1]?.didRegister).toBe(true)
|
187 |
+
expect(resultingRegistrations[2]?.name).toBe("bar.baz.mydomain.eth")
|
188 |
+
expect(resultingRegistrations[2]?.didRegister).toBe(true)
|
189 |
+
expect(resultingRegistrations[3]?.name).toBe("foo.bar.baz.mydomain.eth")
|
190 |
+
expect(resultingRegistrations[3]?.didRegister).toBe(true)
|
191 |
+
|
192 |
+
const getOwnerResult = await ownerClient.invoke({
|
193 |
+
uri: fsUri,
|
194 |
+
method: "getOwner",
|
195 |
+
args: {
|
196 |
+
domain,
|
197 |
+
registryAddress,
|
198 |
+
connection: {
|
199 |
+
networkNameOrChainId: network
|
200 |
+
}
|
201 |
+
}
|
202 |
+
});
|
203 |
+
|
204 |
+
if (getOwnerResult.ok === false) throw getOwnerResult.error;
|
205 |
+
expect(getOwnerResult.value).toBeDefined();
|
206 |
+
expect(getOwnerResult.value).toBe(owner);
|
207 |
+
|
208 |
+
// No subdomain
|
209 |
+
|
210 |
+
const domainWithNoSubdomain = "sumtin.eth";
|
211 |
+
|
212 |
+
const domainWithNoSubdomainResult = await ownerClient.invoke<any[]>({
|
213 |
+
uri: fsUri,
|
214 |
+
method: "registerDomainAndSubdomainsRecursively",
|
215 |
+
args: {
|
216 |
+
domain: domainWithNoSubdomain,
|
217 |
+
owner,
|
218 |
+
registryAddress,
|
219 |
+
resolverAddress,
|
220 |
+
registrarAddress,
|
221 |
+
ttl: '0',
|
222 |
+
connection: {
|
223 |
+
networkNameOrChainId: network
|
224 |
+
}
|
225 |
+
}
|
226 |
+
});
|
227 |
+
|
228 |
+
if (domainWithNoSubdomainResult.ok === false) throw domainWithNoSubdomainResult.error;
|
229 |
+
expect(domainWithNoSubdomainResult.value).toBeDefined();
|
230 |
+
|
231 |
+
const domainWithNoSubdomainRegistrations = domainWithNoSubdomainResult.value;
|
232 |
+
|
233 |
+
expect(domainWithNoSubdomainRegistrations[0]?.name).toBe("sumtin.eth")
|
234 |
+
});
|
235 |
+
|
236 |
+
it("should not attempt to re-register registered subdomains/domains when recursively registering", async () => {
|
237 |
+
const rootDomain = "domain.eth"
|
238 |
+
const label = "sub"
|
239 |
+
const tld = `${label}.${rootDomain}`
|
240 |
+
const subdomain = `already.registered.${tld}`;
|
241 |
+
|
242 |
+
await ownerClient.invoke<string>({
|
243 |
+
uri: fsUri,
|
244 |
+
method: "",
|
245 |
+
args: {
|
246 |
+
domain: tld,
|
247 |
+
owner,
|
248 |
+
registryAddress,
|
249 |
+
registrarAddress,
|
250 |
+
connection: {
|
251 |
+
networkNameOrChainId: network
|
252 |
+
}
|
253 |
+
}
|
254 |
+
});
|
255 |
+
|
256 |
+
await ownerClient.invoke<string>({
|
257 |
+
uri: fsUri,
|
258 |
+
method: "registerDomain",
|
259 |
+
args: {
|
260 |
+
domain: rootDomain,
|
261 |
+
owner,
|
262 |
+
registryAddress,
|
263 |
+
registrarAddress,
|
264 |
+
connection: {
|
265 |
+
networkNameOrChainId: network
|
266 |
+
}
|
267 |
+
}
|
268 |
+
});
|
269 |
+
|
270 |
+
await ownerClient.invoke({
|
271 |
+
uri: fsUri,
|
272 |
+
method: "setSubdomainRecord",
|
273 |
+
args: {
|
274 |
+
domain: rootDomain,
|
275 |
+
label,
|
276 |
+
owner,
|
277 |
+
registryAddress,
|
278 |
+
resolverAddress,
|
279 |
+
ttl: '0',
|
280 |
+
connection: {
|
281 |
+
networkNameOrChainId: network
|
282 |
+
}
|
283 |
+
}
|
284 |
+
});
|
285 |
+
|
286 |
+
const registerDomainAndSubdomainsRecursivelyResult = await ownerClient.invoke<any[]>({
|
287 |
+
uri: fsUri,
|
288 |
+
method: "registerDomainAndSubdomainsRecursively",
|
289 |
+
args: {
|
290 |
+
domain: subdomain,
|
291 |
+
owner,
|
292 |
+
registryAddress,
|
293 |
+
resolverAddress,
|
294 |
+
registrarAddress,
|
295 |
+
ttl: '0',
|
296 |
+
connection: {
|
297 |
+
networkNameOrChainId: network
|
298 |
+
}
|
299 |
+
}
|
300 |
+
});
|
301 |
+
|
302 |
+
if (registerDomainAndSubdomainsRecursivelyResult.ok === false) throw registerDomainAndSubdomainsRecursivelyResult.error;
|
303 |
+
expect(registerDomainAndSubdomainsRecursivelyResult.value).toBeDefined();
|
304 |
+
|
305 |
+
const resultingRegistrations = registerDomainAndSubdomainsRecursivelyResult.value;
|
306 |
+
|
307 |
+
expect(resultingRegistrations[0]?.name).toBe("domain.eth")
|
308 |
+
expect(resultingRegistrations[0]?.didRegister).toBe(false)
|
309 |
+
expect(resultingRegistrations[1]?.name).toBe("sub.domain.eth")
|
310 |
+
expect(resultingRegistrations[1]?.didRegister).toBe(false)
|
311 |
+
expect(resultingRegistrations[2]?.name).toBe("registered.sub.domain.eth")
|
312 |
+
expect(resultingRegistrations[2]?.didRegister).toBe(true)
|
313 |
+
expect(resultingRegistrations[3]?.name).toBe("already.registered.sub.domain.eth")
|
314 |
+
expect(resultingRegistrations[3]?.didRegister).toBe(true)
|
315 |
+
|
316 |
+
const getOwnerResult = await ownerClient.invoke({
|
317 |
+
uri: fsUri,
|
318 |
+
method: "getOwner",
|
319 |
+
args: {
|
320 |
+
domain: subdomain,
|
321 |
+
registryAddress,
|
322 |
+
connection: {
|
323 |
+
networkNameOrChainId: network
|
324 |
+
}
|
325 |
+
},
|
326 |
+
});
|
327 |
+
|
328 |
+
if (getOwnerResult.ok === false) throw getOwnerResult.error;
|
329 |
+
expect(getOwnerResult.value).toBeDefined();
|
330 |
+
expect(getOwnerResult.value).toBe(owner);
|
331 |
+
});
|
332 |
+
|
333 |
+
it("should register subdomain recursively and fetch it", async () => {
|
334 |
+
const tld = "basedomain.eth";
|
335 |
+
const subdomain = `aaa.bbb.ccc.${tld}`;
|
336 |
+
|
337 |
+
await ownerClient.invoke<string>({
|
338 |
+
uri: fsUri,
|
339 |
+
method: "registerDomain",
|
340 |
+
args: {
|
341 |
+
domain: tld,
|
342 |
+
owner,
|
343 |
+
registrarAddress,
|
344 |
+
registryAddress,
|
345 |
+
connection: {
|
346 |
+
networkNameOrChainId: network
|
347 |
+
}
|
348 |
+
}
|
349 |
+
});
|
350 |
+
|
351 |
+
const registerSubdomainsRecursivelyResult = await ownerClient.invoke<any[]>({
|
352 |
+
uri: fsUri,
|
353 |
+
method: "registerSubdomainsRecursively",
|
354 |
+
args: {
|
355 |
+
domain: subdomain,
|
356 |
+
owner,
|
357 |
+
registryAddress,
|
358 |
+
resolverAddress,
|
359 |
+
registrarAddress,
|
360 |
+
ttl: '0',
|
361 |
+
connection: {
|
362 |
+
networkNameOrChainId: network
|
363 |
+
}
|
364 |
+
}
|
365 |
+
});
|
366 |
+
|
367 |
+
if (registerSubdomainsRecursivelyResult.ok === false) throw registerSubdomainsRecursivelyResult.error;
|
368 |
+
expect(registerSubdomainsRecursivelyResult.value).toBeDefined();
|
369 |
+
|
370 |
+
const resultingRegistrations = registerSubdomainsRecursivelyResult.value;
|
371 |
+
|
372 |
+
expect(resultingRegistrations[0]?.name).toBe("ccc.basedomain.eth")
|
373 |
+
expect(resultingRegistrations[0]?.didRegister).toBe(true)
|
374 |
+
expect(resultingRegistrations[1]?.name).toBe("bbb.ccc.basedomain.eth")
|
375 |
+
expect(resultingRegistrations[1]?.didRegister).toBe(true)
|
376 |
+
expect(resultingRegistrations[2]?.name).toBe("aaa.bbb.ccc.basedomain.eth")
|
377 |
+
expect(resultingRegistrations[2]?.didRegister).toBe(true)
|
378 |
+
|
379 |
+
const getOwnerResult = await ownerClient.invoke({
|
380 |
+
uri: fsUri,
|
381 |
+
method: "getOwner",
|
382 |
+
args: {
|
383 |
+
domain: subdomain,
|
384 |
+
registryAddress,
|
385 |
+
connection: {
|
386 |
+
networkNameOrChainId: network
|
387 |
+
}
|
388 |
+
}
|
389 |
+
});
|
390 |
+
|
391 |
+
if (getOwnerResult.ok === false) throw getOwnerResult.error;
|
392 |
+
expect(getOwnerResult.value).toBeDefined();
|
393 |
+
expect(getOwnerResult.value).toBe(owner);
|
394 |
+
});
|
395 |
+
|
396 |
+
it("should set subdomain owner, resolver and ttl", async () => {
|
397 |
+
const setSubdomainRecordResult = await ownerClient.invoke({
|
398 |
+
uri: fsUri,
|
399 |
+
method: "setSubdomainRecord",
|
400 |
+
args: {
|
401 |
+
domain: customTld,
|
402 |
+
label: "john",
|
403 |
+
owner: anotherOwner,
|
404 |
+
registryAddress,
|
405 |
+
resolverAddress,
|
406 |
+
ttl: '0',
|
407 |
+
connection: {
|
408 |
+
networkNameOrChainId: network
|
409 |
+
}
|
410 |
+
}
|
411 |
+
});
|
412 |
+
|
413 |
+
if (setSubdomainRecordResult.ok === false) throw setSubdomainRecordResult.error;
|
414 |
+
expect(setSubdomainRecordResult.value).toBeDefined();
|
415 |
+
|
416 |
+
const getOwnerResult = await ownerClient.invoke({
|
417 |
+
uri: fsUri,
|
418 |
+
method: "getOwner",
|
419 |
+
args: {
|
420 |
+
domain: customSubdomain,
|
421 |
+
registryAddress,
|
422 |
+
connection: {
|
423 |
+
networkNameOrChainId: network
|
424 |
+
}
|
425 |
+
}
|
426 |
+
});
|
427 |
+
|
428 |
+
if (getOwnerResult.ok === false) throw getOwnerResult.error;
|
429 |
+
expect(getOwnerResult.value).toEqual(anotherOwner);
|
430 |
+
});
|
431 |
+
|
432 |
+
it("should update and fetch owner", async () => {
|
433 |
+
const getOldOwnerResult = await anotherOwnerClient.invoke({
|
434 |
+
uri: fsUri,
|
435 |
+
method: "getOwner",
|
436 |
+
args: {
|
437 |
+
domain: customSubdomain,
|
438 |
+
registryAddress,
|
439 |
+
connection: {
|
440 |
+
networkNameOrChainId: network
|
441 |
+
}
|
442 |
+
}
|
443 |
+
});
|
444 |
+
|
445 |
+
if (getOldOwnerResult.ok === false) throw getOldOwnerResult.error;
|
446 |
+
expect(getOldOwnerResult.value).toEqual(anotherOwner);
|
447 |
+
|
448 |
+
const setOwnerResult = await anotherOwnerClient.invoke({
|
449 |
+
uri: fsUri,
|
450 |
+
method: "setOwner",
|
451 |
+
args: {
|
452 |
+
domain: customSubdomain,
|
453 |
+
newOwner: owner,
|
454 |
+
registryAddress,
|
455 |
+
connection: {
|
456 |
+
networkNameOrChainId: network
|
457 |
+
}
|
458 |
+
}
|
459 |
+
});
|
460 |
+
|
461 |
+
if (setOwnerResult.ok === false) throw setOwnerResult.error;
|
462 |
+
expect(setOwnerResult.value).toBeDefined();
|
463 |
+
|
464 |
+
const getNewOwnerResult = await ownerClient.invoke({
|
465 |
+
uri: fsUri,
|
466 |
+
method: "getOwner",
|
467 |
+
args: {
|
468 |
+
domain: customSubdomain,
|
469 |
+
registryAddress,
|
470 |
+
connection: {
|
471 |
+
networkNameOrChainId: network
|
472 |
+
}
|
473 |
+
}
|
474 |
+
});
|
475 |
+
|
476 |
+
if (getNewOwnerResult.ok === false) throw getNewOwnerResult.error;
|
477 |
+
expect(getNewOwnerResult.value).toBe(owner);
|
478 |
+
});
|
479 |
+
|
480 |
+
it("should set content hash and fetch it", async () => {
|
481 |
+
const cid = "0x64EC88CA00B268E5BA1A35678A1B5316D212F4F366B2477232534A8AECA37F3C".toLowerCase();
|
482 |
+
|
483 |
+
const setContentHashResult = await ownerClient.invoke({
|
484 |
+
uri: fsUri,
|
485 |
+
method: "setContentHash",
|
486 |
+
args: {
|
487 |
+
domain: customSubdomain,
|
488 |
+
cid,
|
489 |
+
resolverAddress,
|
490 |
+
connection: {
|
491 |
+
networkNameOrChainId: network
|
492 |
+
}
|
493 |
+
}
|
494 |
+
});
|
495 |
+
|
496 |
+
if (setContentHashResult.ok === false) throw setContentHashResult.error;
|
497 |
+
expect(setContentHashResult.value).toBeDefined();
|
498 |
+
|
499 |
+
const getContentHashResult = await ownerClient.invoke({
|
500 |
+
uri: fsUri,
|
501 |
+
method: "getContentHash",
|
502 |
+
args: {
|
503 |
+
domain: customSubdomain,
|
504 |
+
resolverAddress,
|
505 |
+
connection: {
|
506 |
+
networkNameOrChainId: network
|
507 |
+
}
|
508 |
+
},
|
509 |
+
});
|
510 |
+
|
511 |
+
if (getContentHashResult.ok === false) throw getContentHashResult.error;
|
512 |
+
expect(getContentHashResult.value).toEqual(cid);
|
513 |
+
|
514 |
+
const getContentHashFromDomainResult = await ownerClient.invoke({
|
515 |
+
uri: fsUri,
|
516 |
+
method: "getContentHashFromDomain",
|
517 |
+
args: {
|
518 |
+
domain: customSubdomain,
|
519 |
+
registryAddress,
|
520 |
+
connection: {
|
521 |
+
networkNameOrChainId: network
|
522 |
+
}
|
523 |
+
}
|
524 |
+
});
|
525 |
+
|
526 |
+
if (getContentHashFromDomainResult.ok === false) throw getContentHashFromDomainResult.error;
|
527 |
+
expect(getContentHashFromDomainResult.value).toEqual(cid);
|
528 |
+
});
|
529 |
+
|
530 |
+
it("should set address and fetch it", async () => {
|
531 |
+
const setAddressResult = await ownerClient.invoke({
|
532 |
+
uri: fsUri,
|
533 |
+
method: "setAddress",
|
534 |
+
args: {
|
535 |
+
domain: customTld,
|
536 |
+
address: anotherOwner,
|
537 |
+
resolverAddress,
|
538 |
+
connection: {
|
539 |
+
networkNameOrChainId: network
|
540 |
+
}
|
541 |
+
}
|
542 |
+
});
|
543 |
+
|
544 |
+
if (setAddressResult.ok === false) throw setAddressResult.error;
|
545 |
+
expect(setAddressResult.value).toBeDefined();
|
546 |
+
|
547 |
+
const getAddressResult = await ownerClient.invoke({
|
548 |
+
uri: fsUri,
|
549 |
+
method: "getAddress",
|
550 |
+
args: {
|
551 |
+
domain: customTld,
|
552 |
+
resolverAddress,
|
553 |
+
connection: {
|
554 |
+
networkNameOrChainId: network
|
555 |
+
}
|
556 |
+
}
|
557 |
+
});
|
558 |
+
|
559 |
+
if (getAddressResult.ok === false) throw getAddressResult.error;
|
560 |
+
expect(getAddressResult.value).toEqual(anotherOwner);
|
561 |
+
|
562 |
+
const getAddressFromDomainResult = await ownerClient.invoke({
|
563 |
+
uri: fsUri,
|
564 |
+
method: "getAddressFromDomain",
|
565 |
+
args: {
|
566 |
+
domain: customTld,
|
567 |
+
registryAddress,
|
568 |
+
connection: {
|
569 |
+
networkNameOrChainId: network
|
570 |
+
}
|
571 |
+
}
|
572 |
+
});
|
573 |
+
|
574 |
+
if (getAddressFromDomainResult.ok === false) throw getAddressFromDomainResult.error;
|
575 |
+
expect(getAddressFromDomainResult.value).toEqual(anotherOwner);
|
576 |
+
});
|
577 |
+
|
578 |
+
it("should set reverse registry", async () => {
|
579 |
+
const reverseRegistryResult = await ownerClient.invoke({
|
580 |
+
uri: fsUri,
|
581 |
+
method: "reverseRegisterDomain",
|
582 |
+
args: {
|
583 |
+
domain: customTld,
|
584 |
+
reverseRegistryAddress,
|
585 |
+
owner,
|
586 |
+
connection: {
|
587 |
+
networkNameOrChainId: network
|
588 |
+
}
|
589 |
+
}
|
590 |
+
});
|
591 |
+
|
592 |
+
if (reverseRegistryResult.ok === false) throw reverseRegistryResult.error;
|
593 |
+
expect(reverseRegistryResult.value).toBeDefined();
|
594 |
+
});
|
595 |
+
|
596 |
+
it("should fetch name based on address from registry and resolver", async () => {
|
597 |
+
const getNameFromAddressResult = await ownerClient.invoke({
|
598 |
+
uri: fsUri,
|
599 |
+
method: "getNameFromAddress",
|
600 |
+
args: {
|
601 |
+
address: owner,
|
602 |
+
registryAddress,
|
603 |
+
connection: {
|
604 |
+
networkNameOrChainId: network
|
605 |
+
}
|
606 |
+
}
|
607 |
+
});
|
608 |
+
|
609 |
+
if (getNameFromAddressResult.ok === false) throw getNameFromAddressResult.error;
|
610 |
+
expect(getNameFromAddressResult.value).toEqual(customTld);
|
611 |
+
|
612 |
+
const getNameFromReverseResolverResult = await ownerClient.invoke({
|
613 |
+
uri: fsUri,
|
614 |
+
method: "getNameFromReverseResolver",
|
615 |
+
args: {
|
616 |
+
address: owner,
|
617 |
+
resolverAddress,
|
618 |
+
connection: {
|
619 |
+
networkNameOrChainId: network
|
620 |
+
}
|
621 |
+
}
|
622 |
+
});
|
623 |
+
|
624 |
+
if (getNameFromReverseResolverResult.ok === false) throw getNameFromReverseResolverResult.error;
|
625 |
+
expect(getNameFromReverseResolverResult.value).toEqual(customTld);
|
626 |
+
});
|
627 |
+
|
628 |
+
it("should set and get text record from subdomain", async () => {
|
629 |
+
const key = "snapshot";
|
630 |
+
const value = "QmHash";
|
631 |
+
|
632 |
+
const setTextRecordResult = await ownerClient.invoke({
|
633 |
+
uri: fsUri,
|
634 |
+
method: "setTextRecord",
|
635 |
+
args: {
|
636 |
+
domain: customTld,
|
637 |
+
resolverAddress,
|
638 |
+
key,
|
639 |
+
value,
|
640 |
+
connection: {
|
641 |
+
networkNameOrChainId: network
|
642 |
+
}
|
643 |
+
}
|
644 |
+
});
|
645 |
+
|
646 |
+
if (setTextRecordResult.ok === false) throw setTextRecordResult.error;
|
647 |
+
expect(setTextRecordResult.value).toBeDefined();
|
648 |
+
|
649 |
+
const getTextRecordResult = await ownerClient.invoke({
|
650 |
+
uri: fsUri,
|
651 |
+
method: "getTextRecord",
|
652 |
+
args: {
|
653 |
+
domain: customTld,
|
654 |
+
resolverAddress,
|
655 |
+
key,
|
656 |
+
connection: {
|
657 |
+
networkNameOrChainId: network
|
658 |
+
}
|
659 |
+
}
|
660 |
+
});
|
661 |
+
|
662 |
+
if (getTextRecordResult.ok === false) throw getTextRecordResult.error;
|
663 |
+
expect(getTextRecordResult.value).toEqual(value);
|
664 |
+
});
|
665 |
+
|
666 |
+
it("should configure open domain", async () => {
|
667 |
+
const configureOpenDomainResult = await ownerClient.invoke<{
|
668 |
+
fifsRegistrarAddress: string;
|
669 |
+
setOwnerTxReceipt: any;
|
670 |
+
}>({
|
671 |
+
uri: fsUri,
|
672 |
+
method: "configureOpenDomain",
|
673 |
+
args: {
|
674 |
+
tld: openSubdomain,
|
675 |
+
owner,
|
676 |
+
registryAddress,
|
677 |
+
resolverAddress,
|
678 |
+
registrarAddress,
|
679 |
+
connection: {
|
680 |
+
networkNameOrChainId: network
|
681 |
+
}
|
682 |
+
}
|
683 |
+
});
|
684 |
+
|
685 |
+
if (configureOpenDomainResult.ok === false) throw configureOpenDomainResult.error;
|
686 |
+
expect(configureOpenDomainResult.value).toBeDefined();
|
687 |
+
|
688 |
+
const getOwnerResult = await ownerClient.invoke({
|
689 |
+
uri: fsUri,
|
690 |
+
method: "getOwner",
|
691 |
+
args: {
|
692 |
+
domain: openSubdomain,
|
693 |
+
registryAddress,
|
694 |
+
connection: {
|
695 |
+
networkNameOrChainId: network
|
696 |
+
}
|
697 |
+
}
|
698 |
+
});
|
699 |
+
|
700 |
+
if (getOwnerResult.ok === false) throw getOwnerResult.error;
|
701 |
+
expect(getOwnerResult.value).toEqual( configureOpenDomainResult.value.fifsRegistrarAddress);
|
702 |
+
|
703 |
+
customFifsRegistrarAddress = configureOpenDomainResult.value.fifsRegistrarAddress;
|
704 |
+
});
|
705 |
+
|
706 |
+
it("should create subdomain in open domain", async () => {
|
707 |
+
const result = await anotherOwnerClient.invoke({
|
708 |
+
uri: fsUri,
|
709 |
+
method: "createSubdomainInOpenDomain",
|
710 |
+
args: {
|
711 |
+
label: "label",
|
712 |
+
domain: openSubdomain,
|
713 |
+
owner: anotherOwner,
|
714 |
+
fifsRegistrarAddress: customFifsRegistrarAddress,
|
715 |
+
registryAddress,
|
716 |
+
resolverAddress,
|
717 |
+
connection: {
|
718 |
+
networkNameOrChainId: network
|
719 |
+
}
|
720 |
+
}
|
721 |
+
});
|
722 |
+
|
723 |
+
if (result.ok === false) throw result.error;
|
724 |
+
expect(result.value).toBeDefined();
|
725 |
+
});
|
726 |
+
|
727 |
+
it("should create subdomain in open domain and set content hash", async () => {
|
728 |
+
const cid = "0x64EC88CA00B268E5BA1A35678A1B5316D212F4F366B2477232534A8AECA37F3C".toLowerCase();
|
729 |
+
|
730 |
+
const createAndSetResult = await anotherOwnerClient.invoke({
|
731 |
+
uri: fsUri,
|
732 |
+
method: "createSubdomainInOpenDomainAndSetContentHash",
|
733 |
+
args: {
|
734 |
+
cid,
|
735 |
+
label: "label2",
|
736 |
+
domain: openSubdomain,
|
737 |
+
owner: anotherOwner,
|
738 |
+
fifsRegistrarAddress: customFifsRegistrarAddress,
|
739 |
+
registryAddress,
|
740 |
+
resolverAddress,
|
741 |
+
connection: {
|
742 |
+
networkNameOrChainId: network
|
743 |
+
}
|
744 |
+
}
|
745 |
+
});
|
746 |
+
|
747 |
+
if (createAndSetResult.ok === false) throw createAndSetResult.error;
|
748 |
+
expect(createAndSetResult.value).toBeDefined();
|
749 |
+
|
750 |
+
const getResult = await ownerClient.invoke({
|
751 |
+
uri: fsUri,
|
752 |
+
method: "getContentHashFromDomain",
|
753 |
+
args: {
|
754 |
+
domain: "label2." + openSubdomain,
|
755 |
+
registryAddress,
|
756 |
+
connection: {
|
757 |
+
networkNameOrChainId: network
|
758 |
+
}
|
759 |
+
}
|
760 |
+
});
|
761 |
+
|
762 |
+
if (getResult.ok === false) throw getResult.error;
|
763 |
+
expect(getResult.value).toEqual(cid);
|
764 |
+
});
|
765 |
+
});
|
polywrapgpt/ens
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Subproject commit 49331d87f4cdafde395f5073b885764b133994c0
|
polywrapgpt/examples.md
ADDED
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# This is a sample integration of Polywrap. We can see how we can invoke wrappers using the
|
2 |
+
|
3 |
+
This is an example of how you can answer given each input.
|
4 |
+
|
5 |
+
You will get a prompt like the following `Prompt_input-0`:
|
6 |
+
|
7 |
+
`Prompt_input-0`: "I want to register `juan.eth` as a domain and set this as a content hash `Qmasjdhaisud923847923`"
|
8 |
+
|
9 |
+
For this input the steps you have to look at the schema.graphql which is located in `src/schema.graphql` inside the ens repo.
|
10 |
+
|
11 |
+
|
12 |
+
The first part you have to investigate before creating an output for this prompt:
|
13 |
+
|
14 |
+
```ts
|
15 |
+
# These are the inputs needed for executing the invokation
|
16 |
+
registerDomain(
|
17 |
+
domain: String! # This should be equal to "juan.eth"
|
18 |
+
registrarAddress: String!
|
19 |
+
owner: String!
|
20 |
+
connection: Ethereum_Connection #Ignore because it doesnt have an exclamation mark
|
21 |
+
txOptions: TxOptions #Ignore because it doesnt have an exclamation mark
|
22 |
+
): Ethereum_TxResponse!
|
23 |
+
```
|
24 |
+
|
25 |
+
After researching the `schema.graphql` you should then prepare an invokation that looks like the one below with the same structure, but with the mapping of the variables that were researched in the previous step.
|
26 |
+
|
27 |
+
```ts
|
28 |
+
const result = await ownerClient.invoke<string>({
|
29 |
+
uri: fsUri,
|
30 |
+
method: "registerDomain",
|
31 |
+
args: {
|
32 |
+
domain: customTld,
|
33 |
+
owner,
|
34 |
+
registrarAddress,
|
35 |
+
connection: {
|
36 |
+
networkNameOrChainId: network
|
37 |
+
}
|
38 |
+
}
|
39 |
+
});
|
40 |
+
|
41 |
+
```
|
42 |
+
|
43 |
+
The output that we will be looking for:
|
44 |
+
|
45 |
+
|
46 |
+
```ts
|
47 |
+
const result = await ownerClient.invoke<string>({
|
48 |
+
uri: fsUri,
|
49 |
+
method: "registerDomain",
|
50 |
+
args: {
|
51 |
+
domain: "juan.eth",
|
52 |
+
owner,
|
53 |
+
registrarAddress,
|
54 |
+
connection: {
|
55 |
+
networkNameOrChainId: network
|
56 |
+
}
|
57 |
+
}
|
58 |
+
});
|
59 |
+
```
|
polywrapgpt/schema.graphql
ADDED
@@ -0,0 +1,301 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#import { Module, Connection } into Ethereum from "wrap://ipfs/QmS4Z679ZE8WwZSoYB8w9gDSERHAoWG1fX94oqdWpfpDq3"
|
2 |
+
#import { Module } into UTS46 from "wrap://ipfs/QmPL9Njg3rGkpoJyoy8pZ5fTavjvHxNuuuiGRApzyGESZB"
|
3 |
+
#import { Module } into SHA3 from "wrap://ipfs/QmThRxFfr7Hj9Mq6WmcGXjkRrgqMG3oD93SLX27tinQWy5"
|
4 |
+
|
5 |
+
type Module {
|
6 |
+
getResolver(
|
7 |
+
registryAddress: String!
|
8 |
+
domain: String!
|
9 |
+
connection: Ethereum_Connection
|
10 |
+
): String!
|
11 |
+
|
12 |
+
getOwner(
|
13 |
+
domain: String!
|
14 |
+
registryAddress: String!
|
15 |
+
connection: Ethereum_Connection
|
16 |
+
): String!
|
17 |
+
|
18 |
+
checkIfRecordExists(
|
19 |
+
domain: String!
|
20 |
+
registryAddress: String!
|
21 |
+
connection: Ethereum_Connection
|
22 |
+
): Boolean!
|
23 |
+
|
24 |
+
getAddress(
|
25 |
+
domain: String!
|
26 |
+
resolverAddress: String!
|
27 |
+
connection: Ethereum_Connection
|
28 |
+
): String!
|
29 |
+
|
30 |
+
getAddressFromDomain(
|
31 |
+
domain: String!
|
32 |
+
registryAddress: String!
|
33 |
+
connection: Ethereum_Connection
|
34 |
+
): String!
|
35 |
+
|
36 |
+
getContentHash(
|
37 |
+
domain: String!
|
38 |
+
resolverAddress: String!
|
39 |
+
connection: Ethereum_Connection
|
40 |
+
): String!
|
41 |
+
|
42 |
+
getContentHashFromDomain(
|
43 |
+
domain: String!
|
44 |
+
registryAddress: String!
|
45 |
+
connection: Ethereum_Connection
|
46 |
+
): String!
|
47 |
+
|
48 |
+
getExpiryTimes(
|
49 |
+
domain: String!
|
50 |
+
registrarAddress: String!
|
51 |
+
connection: Ethereum_Connection
|
52 |
+
): String!
|
53 |
+
|
54 |
+
getReverseResolver(
|
55 |
+
address: String!
|
56 |
+
registryAddress: String!
|
57 |
+
connection: Ethereum_Connection
|
58 |
+
): String!
|
59 |
+
|
60 |
+
getNameFromReverseResolver(
|
61 |
+
address: String!
|
62 |
+
resolverAddress: String!
|
63 |
+
connection: Ethereum_Connection
|
64 |
+
): String!
|
65 |
+
|
66 |
+
getNameFromAddress(
|
67 |
+
address: String!
|
68 |
+
registryAddress: String!
|
69 |
+
connection: Ethereum_Connection
|
70 |
+
): String!
|
71 |
+
|
72 |
+
getTextRecord(
|
73 |
+
domain: String!
|
74 |
+
resolverAddress: String!
|
75 |
+
key: String!
|
76 |
+
connection: Ethereum_Connection
|
77 |
+
): String!
|
78 |
+
|
79 |
+
setResolver(
|
80 |
+
domain: String!
|
81 |
+
resolverAddress: String!
|
82 |
+
registryAddress: String!
|
83 |
+
connection: Ethereum_Connection
|
84 |
+
txOptions: TxOptions
|
85 |
+
): Ethereum_TxResponse!
|
86 |
+
|
87 |
+
registerDomain(
|
88 |
+
domain: String!
|
89 |
+
registrarAddress: String!
|
90 |
+
owner: String!
|
91 |
+
connection: Ethereum_Connection
|
92 |
+
txOptions: TxOptions
|
93 |
+
): Ethereum_TxResponse!
|
94 |
+
|
95 |
+
reverseRegisterDomain(
|
96 |
+
domain: String!
|
97 |
+
reverseRegistryAddress: String!
|
98 |
+
owner: String!
|
99 |
+
connection: Ethereum_Connection
|
100 |
+
txOptions: TxOptions
|
101 |
+
): Ethereum_TxResponse!
|
102 |
+
|
103 |
+
setName(
|
104 |
+
domain: String!
|
105 |
+
reverseRegistryAddress: String!
|
106 |
+
connection: Ethereum_Connection
|
107 |
+
txOptions: TxOptions
|
108 |
+
): Ethereum_TxResponse!
|
109 |
+
|
110 |
+
setAddress(
|
111 |
+
domain: String!
|
112 |
+
address: String!
|
113 |
+
resolverAddress: String!
|
114 |
+
connection: Ethereum_Connection
|
115 |
+
txOptions: TxOptions
|
116 |
+
): Ethereum_TxResponse!
|
117 |
+
|
118 |
+
setOwner(
|
119 |
+
domain: String!
|
120 |
+
newOwner: String!
|
121 |
+
registryAddress: String!
|
122 |
+
connection: Ethereum_Connection
|
123 |
+
txOptions: TxOptions
|
124 |
+
): Ethereum_TxResponse!
|
125 |
+
|
126 |
+
setSubdomainOwner(
|
127 |
+
subdomain: String!
|
128 |
+
owner: String!
|
129 |
+
registryAddress: String!
|
130 |
+
connection: Ethereum_Connection
|
131 |
+
txOptions: TxOptions
|
132 |
+
): Ethereum_TxResponse!
|
133 |
+
|
134 |
+
setRecord(
|
135 |
+
domain: String!
|
136 |
+
owner: String!
|
137 |
+
resolverAddress: String!
|
138 |
+
ttl: String!
|
139 |
+
registryAddress: String!
|
140 |
+
connection: Ethereum_Connection
|
141 |
+
txOptions: TxOptions
|
142 |
+
): Ethereum_TxResponse!
|
143 |
+
|
144 |
+
setSubdomainRecord(
|
145 |
+
domain: String!
|
146 |
+
label: String!
|
147 |
+
owner: String!
|
148 |
+
resolverAddress: String!
|
149 |
+
ttl: String!
|
150 |
+
registryAddress: String!
|
151 |
+
connection: Ethereum_Connection
|
152 |
+
txOptions: TxOptions
|
153 |
+
): Ethereum_TxResponse!
|
154 |
+
|
155 |
+
registerSubdomainsRecursively(
|
156 |
+
domain: String!
|
157 |
+
owner: String!
|
158 |
+
resolverAddress: String!
|
159 |
+
ttl: String!
|
160 |
+
registryAddress: String!
|
161 |
+
connection: Ethereum_Connection
|
162 |
+
txOptions: TxOptions
|
163 |
+
): [RegistrationResult!]!
|
164 |
+
|
165 |
+
registerDomainAndSubdomainsRecursively(
|
166 |
+
domain: String!
|
167 |
+
owner: String!
|
168 |
+
resolverAddress: String!
|
169 |
+
ttl: String!
|
170 |
+
registrarAddress: String!
|
171 |
+
registryAddress: String!
|
172 |
+
connection: Ethereum_Connection
|
173 |
+
txOptions: TxOptions
|
174 |
+
): [RegistrationResult!]!
|
175 |
+
|
176 |
+
setContentHash(
|
177 |
+
domain: String!
|
178 |
+
cid: String!
|
179 |
+
resolverAddress: String!
|
180 |
+
connection: Ethereum_Connection
|
181 |
+
txOptions: TxOptions
|
182 |
+
): Ethereum_TxResponse!
|
183 |
+
|
184 |
+
setAddressFromDomain(
|
185 |
+
domain: String!
|
186 |
+
address: String!
|
187 |
+
registryAddress: String!
|
188 |
+
connection: Ethereum_Connection
|
189 |
+
txOptions: TxOptions
|
190 |
+
): Ethereum_TxResponse!
|
191 |
+
|
192 |
+
setContentHashFromDomain(
|
193 |
+
domain: String!
|
194 |
+
cid: String!
|
195 |
+
registryAddress: String!
|
196 |
+
connection: Ethereum_Connection
|
197 |
+
txOptions: TxOptions
|
198 |
+
): Ethereum_TxResponse!
|
199 |
+
|
200 |
+
deployFIFSRegistrar(
|
201 |
+
registryAddress: String!
|
202 |
+
tld: String!
|
203 |
+
connection: Ethereum_Connection
|
204 |
+
txOptions: TxOptions
|
205 |
+
): String!
|
206 |
+
|
207 |
+
registerSubnodeOwnerWithFIFSRegistrar(
|
208 |
+
label: String!
|
209 |
+
owner: String!
|
210 |
+
fifsRegistrarAddress: String!
|
211 |
+
connection: Ethereum_Connection
|
212 |
+
txOptions: TxOptions
|
213 |
+
): Ethereum_TxResponse!
|
214 |
+
|
215 |
+
setTextRecord(
|
216 |
+
domain: String!
|
217 |
+
resolverAddress: String!
|
218 |
+
key: String!
|
219 |
+
value: String!
|
220 |
+
connection: Ethereum_Connection
|
221 |
+
txOptions: TxOptions
|
222 |
+
): Ethereum_TxResponse!
|
223 |
+
|
224 |
+
configureOpenDomain(
|
225 |
+
tld: String!
|
226 |
+
owner: String!
|
227 |
+
registryAddress: String!
|
228 |
+
resolverAddress: String!
|
229 |
+
registrarAddress: String!
|
230 |
+
connection: Ethereum_Connection
|
231 |
+
txOptions: TxOptions
|
232 |
+
): ConfigureOpenDomainResponse!
|
233 |
+
|
234 |
+
createSubdomainInOpenDomain(
|
235 |
+
label: String!
|
236 |
+
domain: String!
|
237 |
+
owner: String!
|
238 |
+
fifsRegistrarAddress: String!
|
239 |
+
registryAddress: String!
|
240 |
+
resolverAddress: String!
|
241 |
+
connection: Ethereum_Connection
|
242 |
+
txOptions: TxOptions
|
243 |
+
): CreateSubdomainInOpenDomainResponse!
|
244 |
+
|
245 |
+
createSubdomainInOpenDomainAndSetContentHash(
|
246 |
+
label: String!
|
247 |
+
domain: String!
|
248 |
+
owner: String!
|
249 |
+
fifsRegistrarAddress: String!
|
250 |
+
registryAddress: String!
|
251 |
+
resolverAddress: String!
|
252 |
+
cid: String!
|
253 |
+
connection: Ethereum_Connection
|
254 |
+
txOptions: TxOptions
|
255 |
+
): CreateSubdomainInOpenDomainAndSetContentHashResponse
|
256 |
+
}
|
257 |
+
|
258 |
+
type ConfigureOpenDomainResponse {
|
259 |
+
fifsRegistrarAddress: String!
|
260 |
+
registerOpenDomainTxReceipt: Ethereum_TxResponse!
|
261 |
+
setSubdomainRecordTxReceipt: Ethereum_TxResponse!
|
262 |
+
}
|
263 |
+
|
264 |
+
type CreateSubdomainInOpenDomainResponse {
|
265 |
+
registerSubdomainTxReceipt: Ethereum_TxResponse!
|
266 |
+
setResolverTxReceipt: Ethereum_TxResponse!
|
267 |
+
}
|
268 |
+
|
269 |
+
type CreateSubdomainInOpenDomainAndSetContentHashResponse implements CreateSubdomainInOpenDomainResponse {
|
270 |
+
setContentHashReceiptTx: Ethereum_TxResponse!
|
271 |
+
}
|
272 |
+
|
273 |
+
type RegistrationResult {
|
274 |
+
name: String!
|
275 |
+
didRegister: Boolean!
|
276 |
+
tx: Ethereum_TxResponse
|
277 |
+
}
|
278 |
+
|
279 |
+
type TxOptions {
|
280 |
+
"""Gas supplied for the transaction"""
|
281 |
+
gasLimit: BigInt
|
282 |
+
"""
|
283 |
+
The max total fee to pay per unit of gas.
|
284 |
+
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
|
285 |
+
This property is ignored when gasPrice is not null.
|
286 |
+
"""
|
287 |
+
maxFeePerGas: BigInt
|
288 |
+
"""
|
289 |
+
The gas price paid is baseFeePerGas + maxPriorityFeePerGas.
|
290 |
+
The difference between maxFeePerGas and baseFeePerGas + maxPriorityFeePerGas is “refunded” to the user.
|
291 |
+
This property is ignored when gasPrice is not null.
|
292 |
+
"""
|
293 |
+
maxPriorityFeePerGas: BigInt
|
294 |
+
"""
|
295 |
+
The gas price for legacy transactions.
|
296 |
+
If this property is not null, a legacy transaction will be sent and maxFeePerGas and maxPriorityFeePerGas will be ignored.
|
297 |
+
"""
|
298 |
+
gasPrice: BigInt
|
299 |
+
"""Override default nonce"""
|
300 |
+
nonce: UInt32
|
301 |
+
}
|
requirements.txt
ADDED
File without changes
|