11---
22title : getIApp
33description :
4- Retrieve all protected data for a specific owner or schema with the getIApp
5- method in iExec DataProtector . Easily access encrypted data and metadata ,
4+ Retrieve all iApps for a specific owner or filter by creation date with the getIApp
5+ method in iExec iApp Generator SDK . Easily access iApp metadata and information ,
66 sorted by creation date.
77---
88
99# getIApp
1010
11- This method allows the user to retrieve all protected data for a given owner,
12- data schema, or both.
11+ This method allows the user to retrieve all iApps for a given owner or filter by creation timestamp.
1312
1413Results are ordered by ` creationTimestamp ` desc.
1514
1615::: tip
1716
18- A data schema is the metadata describing the contents of the protected data
19- object. The schema is returned as part of the [ protectData] ( protectData.md )
20- method invocation.
17+ An iApp is a confidential computing application that runs in secure TEE environments.
18+ The method returns iApp metadata including name, address, owner, and creation timestamp.
2119
2220:::
2321
@@ -29,113 +27,67 @@ import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
2927const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
3028const dataProtectorCore = new IExecIApp (web3Provider );
3129// ---cut---
32- const listProtectedData = await dataProtectorCore .getIApp ({
30+ const listIApps = await dataProtectorCore .getIApp ({
3331 owner: ' 0xa0c15e...' ,
34- requiredSchema: {
35- email: ' string ' ,
36- } ,
32+ createdAfterTimestamp: 1640995200 ,
33+ page: 1 ,
34+ pageSize: 20 ,
3735});
3836```
3937
4038## Parameters
4139
4240``` ts twoslash
43- import { type GetProtectedDataParams } from ' @mage-sombre/iapp' ;
41+ import { type GetIAppParams } from ' @mage-sombre/iapp' ;
4442```
4543
46- ### protectedDataAddress <OptionalBadge />
44+ ### iapp <OptionalBadge />
4745
4846** Type:** ` AddressOrENS `
4947
50- Returns the protected data associated with this address.
51- Returns an empty array if the protected data is not found.
52-
53- ``` ts twoslash
54- import { IExecIApp , getWeb3Provider } from ' @mage-sombre/iapp' ;
55-
56- const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
57- const dataProtectorCore = new IExecIApp (web3Provider );
58- // ---cut---
59- const oneProtectedData = await dataProtectorCore .getIApp ({
60- protectedDataAddress: ' 0x123abc...' , // [!code focus]
61- });
62- ```
63-
64- ### requiredSchema <OptionalBadge />
65-
66- ** Type:** ` SearchableDataSchema `
67-
68- Provides a list of protected data objects matching this schema.
69-
70- <!-- prettier-ignore-start -->
71- ``` ts twoslash
72- import { IExecIApp , getWeb3Provider } from ' @mage-sombre/iapp' ;
73-
74- const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
75- const dataProtectorCore = new IExecIApp (web3Provider );
76- // ---cut---
77- const listProtectedData = await dataProtectorCore .getIApp ({
78- requiredSchema: { // [!code focus]
79- email: ' string' , // [!code focus]
80- }, // [!code focus]
81- });
82- ```
83- <!-- prettier-ignore-end -->
84-
85- It's also possible to provide a list of accepted types for one schema field:
48+ Returns the iApp associated with this address.
49+ Returns an empty array if the iApp is not found.
8650
87- <!-- prettier-ignore-start -->
8851``` ts twoslash
8952import { IExecIApp , getWeb3Provider } from ' @mage-sombre/iapp' ;
9053
9154const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
9255const dataProtectorCore = new IExecIApp (web3Provider );
9356// ---cut---
94- const listProtectedData = await dataProtectorCore .getIApp ({
95- requiredSchema: { // [!code focus]
96- picture: [' image/png' , ' image/jpeg' ], // [!code focus]
97- }, // [!code focus]
57+ const oneIApp = await dataProtectorCore .getIApp ({
58+ iapp: ' 0x123abc...' , // [!code focus]
9859});
9960```
100- <!-- prettier-ignore-end -->
101-
102- Available types are listed
103- [ here] ( /references/dataProtector/dataProtectorCore/protectData#schema ) .
10461
10562### owner <OptionalBadge />
10663
10764** Type:** ` AddressOrENS `
10865
109- Provides a list of protected data objects owned by the user with this ETH
110- address.
66+ Returns all iApps owned by this address.
11167
11268``` ts twoslash
11369import { IExecIApp , getWeb3Provider } from ' @mage-sombre/iapp' ;
11470
11571const web3Provider = getWeb3Provider (' PRIVATE_KEY' );
11672const dataProtectorCore = new IExecIApp (web3Provider );
11773// ---cut---
118- const listProtectedData = await dataProtectorCore .getIApp ({
74+ const iAppsByOwner = await dataProtectorCore .getIApp ({
11975 owner: ' 0xa0c15e...' , // [!code focus]
12076});
121- ```
122-
12377### createdAfterTimestamp < OptionalBadge / >
12478
12579** Type :** ` number `
12680
127- Provides a list of protected data objects created after this timestamp value.
128- The provided value should be in seconds.
81+ Returns all iApps created after this timestamp (Unix timestamp in seconds ).
12982
13083` ` ` ts twoslash
13184import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
13285
13386const web3Provider = getWeb3Provider('PRIVATE_KEY');
13487const dataProtectorCore = new IExecIApp(web3Provider);
13588// ---cut---
136- const listProtectedData = await dataProtectorCore .getIApp ({
137- owner: ' 0xa0c15e...' ,
138- createdAfterTimestamp: 1710257612 , // March 12, 2024 15:33:32 GMT // [!code focus]
89+ const recentIApps = await dataProtectorCore.getIApp({
90+ createdAfterTimestamp: 1640995200, // [!code focus]
13991});
14092` ` `
14193
@@ -144,54 +96,76 @@ const listProtectedData = await dataProtectorCore.getIApp({
14496** Type :** ` number `
14597** Default :** ` 0 `
14698
147- Specifies the results page to return. Pages are indexed starting at page 0. If
148- using this field you may also specify a ` pageSize ` to control the size of the
149- results.
99+ Specifies the page number of the result set to return . Pages are zero - based indexed .
150100
151101` ` ` ts twoslash
152102import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
153103
154104const web3Provider = getWeb3Provider('PRIVATE_KEY');
155105const dataProtectorCore = new IExecIApp(web3Provider);
156106// ---cut---
157- const listProtectedData = await dataProtectorCore .getIApp ({
158- owner: ' 0xa0c15e...' ,
159- createdAfterTimestamp: 1710257612 , // March 12, 2024 15:33:32 GMT
107+ const iAppsPage = await dataProtectorCore.getIApp({
160108 page: 1, // [!code focus]
109+ pageSize: 20,
161110});
162111` ` `
163112
164113### pageSize < OptionalBadge / >
165114
166115** Type :** ` number `
167- ** Default:** ` 1000 `
168- ** Range:** ` [10...1000] `
116+ ** Default :** ` 20 `
169117
170- Specifies the number of records in each page of the result set. This is used in
171- conjunction with the optional ` page ` parameter to constrain the size of the
172- result.
118+ Specifies the number of records to include in each page of the result set .
173119
174120` ` ` ts twoslash
175121import { IExecIApp, getWeb3Provider } from '@mage-sombre/iapp';
176122
177123const web3Provider = getWeb3Provider('PRIVATE_KEY');
178124const dataProtectorCore = new IExecIApp(web3Provider);
179125// ---cut---
180- const listProtectedData = await dataProtectorCore .getIApp ({
181- owner: ' 0xa0c15e...' ,
182- createdAfterTimestamp: 1710257612 , // March 12, 2024 15:33:32 GMT
126+ const iAppsPage = await dataProtectorCore.getIApp({
183127 page: 1,
184- pageSize: 100 , // [!code focus]
128+ pageSize: 50 , // [!code focus]
185129});
186130` ` `
187131
188132## Return Value
189133
190134` ` ` ts twoslash
191- import { type ProtectedData } from ' @mage-sombre/iapp' ;
135+ import { type IApp } from '@mage-sombre/iapp';
192136` ` `
193137
194- See [ ` ProtectedData ` ] ( /references/iapp-generator/sdk/types#protecteddata )
138+ The method returns an array of ` IApp ` objects containing the following fields :
139+
140+ ### name
141+
142+ ` string `
143+
144+ The name of the iApp .
145+
146+ ### address
147+
148+ ` Address `
149+
150+ The Ethereum address of the iApp .
151+
152+ ### owner
153+
154+ ` Address `
155+
156+ The Ethereum address of the iApp owner .
157+
158+ ### creationTimestamp
159+
160+ ` number `
161+
162+ The Unix timestamp (in seconds ) when the iApp was created .
163+
164+ ### multiaddr
165+
166+ ` string ` (optional )
167+
168+ The multiaddress for P2P communication with the iApp .
195169
196170< script setup >
197171import OptionalBadge from ' @/components/OptionalBadge.vue'
0 commit comments