Spaces:
Runtime error

File size: 1,799 Bytes
3c4778e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# This is a sample integration of Polywrap. We can see how we can invoke wrappers using the 

This is an example of how you can answer given each input.

You will get a prompt like the following `Prompt_input-0`:

`Prompt_input-0`: "I want to register `juan.eth` as a domain and set this as a content hash `Qmasjdhaisud923847923`"

For this input the steps you have to look at the schema.graphql which is located in `src/schema.graphql` inside the ens repo.
 

The first part you have to investigate before creating an output for this prompt:

```ts
# These are the inputs needed for executing the invokation
registerDomain(
    domain: String! # This should be equal to "juan.eth"
    registrarAddress: String!
    owner: String!
    connection: Ethereum_Connection  #Ignore because it doesnt have an exclamation mark
    txOptions: TxOptions #Ignore because it doesnt have an exclamation mark
  ): Ethereum_TxResponse!
```

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.

```ts
    const result = await ownerClient.invoke<string>({
        uri: fsUri,
        method: "registerDomain",
        args: {
          domain: customTld,
          owner,
          registrarAddress,
          connection: {
            networkNameOrChainId: network
          }
        }
      });
  
```

The output that we will be looking for:


```ts
    const result = await ownerClient.invoke<string>({
        uri: fsUri,
        method: "registerDomain",
        args: {
          domain: "juan.eth",
          owner,
          registrarAddress,
          connection: {
            networkNameOrChainId: network
          }
        }
      });
```