Skip to content

Commit 5f806b4

Browse files
author
Emanuel Muroni
authored
Merge pull request #395 from 0xPolygonID/develop
Intermediate release with Amoy network support
2 parents c374ec4 + a133c1d commit 5f806b4

File tree

183 files changed

+9319
-2136
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

183 files changed

+9319
-2136
lines changed

.github/workflows/polygonid_flutter_sdk.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup Flutter SDK
2222
uses: subosito/flutter-action@v2
2323
with:
24-
flutter-version: '3.10.4'
24+
flutter-version: '3.19.3'
2525
channel: 'stable'
2626
cache: true
2727
# instead of "channel: stable", you could be more precise by specifying the exact version of Flutter you're using:
@@ -37,6 +37,10 @@ jobs:
3737
env:
3838
ENV_POLYGON_MUMBAI: ${{ secrets.ENV_POLYGON_MUMBAI }}
3939
ENV_POLYGON_MAINNET: ${{ secrets.ENV_POLYGON_MUMBAI }}
40+
DEFAULT_ENV: ${{ secrets.DEFAULT_ENV }}
41+
STACKTRACE_ENCRYPTION_KEY: ${{ secrets.STACKTRACE_ENCRYPTION }}
42+
PINATA_GATEWAY: ${{ secrets.PINATA_GATEWAY }}
43+
PINATA_GATEWAY_TOKEN: ${{ secrets.PINATA_GATEWAY_TOKEN }}
4044
run: cd example&&flutter clean&&flutter pub get&&dart run build_runner build --delete-conflicting-outputs
4145

4246
- name: Format
@@ -72,7 +76,7 @@ jobs:
7276
- name: Setup Flutter SDK
7377
uses: subosito/flutter-action@v2
7478
with:
75-
flutter-version: '3.10.4'
79+
flutter-version: '3.19.3'
7680
channel: 'stable'
7781
cache: true
7882
# instead of "channel: stable", you could be more precise by specifying the exact version of Flutter you're using:

AUTH.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ This document provides an explanation on how to authenticate with the Polygon ID
2121
blockchain: "polygon",
2222
network: "mumbai",
2323
web3Url: "https://polygon-mumbai.infura.io/v3/",
24-
web3RdpUrl: "wss://polygon-mumbai.infura.io/v3/",
2524
web3ApiKey: "YOUR_API_KEY"
2625
idStateContract: 0x134B1BE34911E39A8397ec6289782989729807a4),
2726
```

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 2.3.0
2+
- New operators for circuit V3 beta 1
3+
- On-chain credential fetch
4+
- Credential proposal objects
5+
- Added support to Polygon Amoy testnet
6+
- Updated environment object
7+
- Update core libraries
8+
19
## 2.2.9
210
- Multiple circuits download and circuit V3 support
311
- Credential rawValue field on the claimDTO and claimEntity

README.md

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
# Polygon ID Flutter SDK
66

7-
[![pub package](https://img.shields.io/badge/pub-2.2.9-blueviolet)](https://pub.dev/packages/polygonid_flutter_sdk)
7+
[![pub package](https://img.shields.io/badge/pub-2.3.0-blueviolet)](https://pub.dev/packages/polygonid_flutter_sdk)
88
[![build](https://github.com/iden3/polygonid-flutter-sdk/workflows/polygonid_flutter_sdk/badge.svg)](https://github.com/iden3/polygonid-flutter-sdk/actions?query=workflow%3Apolygonid_flutter_sdk)
99
[![codecov](https://codecov.io/gh/iden3/polygonid-flutter-sdk/branch/develop/graph/badge.svg?token=0SI0XWGXKL)](https://codecov.io/gh/iden3/polygonid-flutter-sdk)
1010
[![license](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](https://github.com/iden3/polygonid-flutter-sdk/blob/master/LICENSE-APACHE)
@@ -56,16 +56,22 @@ import 'package:flutter/material.dart';
5656
import 'package:polygonid_flutter_sdk/sdk/polygon_id_sdk.dart';
5757
5858
Future<void> main() async {
59-
await PolygonIdSdk.init(env: EnvEntity(
60-
blockchain: 'polygon',
61-
network: 'mumbai',
62-
web3Url: 'https://polygon-mumbai.infura.io/v3/',
63-
web3RdpUrl: 'wss://polygon-mumbai.infura.io/v3/',
64-
web3ApiKey: 'YOUR-INFURA-API-KEY',
65-
idStateContract: '0x134B1BE34911E39A8397ec6289782989729807a4',
59+
await PolygonIdSdk.init(
60+
env: EnvEntity.v1(
6661
pushUrl: 'https://push-staging.polygonid.com/api/v1',
67-
ipfsUrl: "https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001",
68-
));
62+
ipfsUrl:
63+
"https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001",
64+
chainConfigs: {
65+
"80002": ChainConfigEntity(
66+
blockchain: 'polygon',
67+
network: 'amoy',
68+
rpcUrl: 'https://rpc-amoy.polygon.technology/',
69+
stateContractAddr: '0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124',
70+
)
71+
},
72+
didMethods: [],
73+
),
74+
);
6975
runApp(const App());
7076
}
7177
```
@@ -90,9 +96,8 @@ You can either set the environment during initialization (with `env` parameter)
9096
The environment object is [EnvEntity](lib/common/domain/entities/env_entity.dart) with:
9197
```
9298
final String blockchain; # The name of the blockchain (eg: polygon)
93-
final String network; # The network of the blockchain (eg: mumbai)
94-
final String web3Url; # URL of the blockchain (eg: https://polygon-mumbai.infura.io/v3/)
95-
final String web3RdpUrl; # RDP URL (eg: wss://polygon-mumbai.infura.io/v3/)
99+
final String network; # The network of the blockchain (eg: amoy)
100+
final String web3Url; # URL of the blockchain (eg: https://polygon-amoy.infura.io/v3/)
96101
final String web3ApiKey; # The API key of the web3 URL service (eg: YOUR-INFURA-API-KEY)
97102
final String idStateContract; # The ID state contract (eg: 0x134B1BE34911E39A8397ec6289782989729807a4)
98103
final String pushUrl; # The push notification URL (eg: https://push-staging.polygonid.com/api/v1)
@@ -101,15 +106,14 @@ The environment object is [EnvEntity](lib/common/domain/entities/env_entity.dart
101106

102107
### Supported Environments
103108

104-
| Environment | Polygon Mumbai | Polygon Main |
105-
|----------------|:------------------------------------------:|:-------------:|
106-
| blockchain | polygon | polygon |
107-
| network | mumbai | main |
108-
| web3Url | https://polygon-mumbai.infura.io/v3/ | https://polygon-mainnet.infura.io/v3/ |
109-
| web3RdpUrl | wss://polygon-mumbai.infura.io/v3/ | wss://polygon-mainnet.infura.io/v3/ |
110-
| idStateContract | 0x134B1BE34911E39A8397ec6289782989729807a4 | 0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D |
111-
| pushUrl | https://push-staging.polygonid.com/api/v1 | https://push-staging.polygonid.com/api/v1 |
112-
| ipfsUrl | https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001 | https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001 |
109+
| Environment | Polygon Amoy | Polygon Main |
110+
|----------------|:--------------------------------------------------------------------------:|:-------------:|
111+
| blockchain | polygon | polygon |
112+
| network | amoy | main |
113+
| web3Url | https://polygon-amoy.infura.io/v3/ | https://polygon-mainnet.infura.io/v3/ |
114+
| idStateContract | 0x1a4cC30f2aA0377b0c3bc9848766D90cb4404124 | 0x624ce98D2d27b20b8f8d521723Df8fC4db71D79D |
115+
| pushUrl | https://push-staging.polygonid.com/api/v1 | https://push-staging.polygonid.com/api/v1 |
116+
| ipfsUrl | https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001 | https://[YOUR-IPFS-API-KEY]:[YOUR-IPFS-API-KEY-SECRET]@ipfs.infura.io:5001 |
113117

114118
If you want to deploy your own State Contract, please check the [contract documentation](https://docs.iden3.io/contracts/state/).
115119

android/sdk.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ext {
2-
sdkVersion = '2.2.9'
2+
sdkVersion = '2.3.0'
33
}

android/src/main/jniLibs/arm64-v8a/libpolygonid.h

Lines changed: 49 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ extern "C" {
9393
#endif
9494

9595
extern GoUint8 PLGNAuthV2InputsMarshal(char** jsonResponse, char* in, PLGNStatus** status);
96+
97+
// Deprecated: Use PLGNNewGenesisID instead. It supports environment
98+
// configuration, giving the ability to register custom DID methods.
99+
//
96100
extern GoUint8 PLGNCalculateGenesisID(char** jsonResponse, char* in, PLGNStatus** status);
101+
extern GoUint8 PLGNNewGenesisID(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
97102
extern GoUint8 PLGNCreateClaim(char** jsonResponse, char* in, PLGNStatus** status);
98103

99104
// PLGNIDToInt returns the ID as a big int string
@@ -110,13 +115,9 @@ extern GoUint8 PLGNProfileID(char** jsonResponse, char* in, PLGNStatus** status)
110115
// Additional configuration may be required for Reverse Hash Service
111116
// revocation validation. In other case cfg may be nil.
112117
//
113-
// Sample configuration:
118+
// The configuration example may be found in the [README.md] file.
114119
//
115-
// {
116-
// "ethereumUrl": "http://localhost:8545",
117-
// "stateContractAddr": "0xEA9aF2088B4a9770fC32A12fD42E61BDD317E655",
118-
// "reverseHashServiceUrl": "http://localhost:8003"
119-
// }
120+
// [README.md]: https://github.com/0xPolygonID/c-polygonid/blob/main/README.md#configuration
120121
//
121122
extern GoUint8 PLGNAtomicQuerySigV2Inputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
122123

@@ -134,13 +135,9 @@ extern GoUint8 PLGNSigV2Inputs(char** jsonResponse, char* in, PLGNStatus** statu
134135
// Additional configuration may be required for Reverse Hash Service
135136
// revocation validation. In other case cfg may be nil.
136137
//
137-
// Sample configuration:
138+
// The configuration example may be found in the [README.md] file.
138139
//
139-
// {
140-
// "ethereumUrl": "http://localhost:8545",
141-
// "stateContractAddr": "0xEA9aF2088B4a9770fC32A12fD42E61BDD317E655",
142-
// "reverseHashServiceUrl": "http://localhost:8003"
143-
// }
140+
// [README.md]: https://github.com/0xPolygonID/c-polygonid/blob/main/README.md#configuration
144141
//
145142
extern GoUint8 PLGNAtomicQueryMtpV2Inputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
146143

@@ -158,13 +155,9 @@ extern GoUint8 PLGNMtpV2Inputs(char** jsonResponse, char* in, PLGNStatus** statu
158155
// Additional configuration may be required for Reverse Hash Service
159156
// revocation validation. In other case cfg may be nil.
160157
//
161-
// Sample configuration:
158+
// The configuration example may be found in the [README.md] file.
162159
//
163-
// {
164-
// "ethereumUrl": "http://localhost:8545",
165-
// "stateContractAddr": "0xEA9aF2088B4a9770fC32A12fD42E61BDD317E655",
166-
// "reverseHashServiceUrl": "http://localhost:8003"
167-
// }
160+
// [README.md]: https://github.com/0xPolygonID/c-polygonid/blob/main/README.md#configuration
168161
//
169162
extern GoUint8 PLGNAtomicQuerySigV2OnChainInputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
170163

@@ -174,13 +167,9 @@ extern GoUint8 PLGNAtomicQuerySigV2OnChainInputs(char** jsonResponse, char* in,
174167
// Additional configuration may be required for Reverse Hash Service
175168
// revocation validation. In other case cfg may be nil.
176169
//
177-
// Sample configuration:
170+
// The configuration example may be found in the [README.md] file.
178171
//
179-
// {
180-
// "ethereumUrl": "http://localhost:8545",
181-
// "stateContractAddr": "0xEA9aF2088B4a9770fC32A12fD42E61BDD317E655",
182-
// "reverseHashServiceUrl": "http://localhost:8003"
183-
// }
172+
// [README.md]: https://github.com/0xPolygonID/c-polygonid/blob/main/README.md#configuration
184173
//
185174
extern GoUint8 PLGNAtomicQueryMtpV2OnChainInputs(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
186175

@@ -197,6 +186,42 @@ extern void PLGNFreeStatus(PLGNStatus* status);
197186
extern GoUint8 PLGNCleanCache(PLGNStatus** status);
198187
extern GoUint8 PLGNCacheCredentials(char* in, char* cfg, PLGNStatus** status);
199188

189+
// PLGNW3CCredentialFromOnchainHex returns a verifiable credential from an onchain data hex string.
190+
//
191+
// Sample input:
192+
//
193+
// {
194+
// "issuerDID": "did:polygonid:polygon:mumbai:2qCU58EJgrEMJvPfhUCnFCwuKQTkX8VmJX2sJCH6C8",
195+
// "hexdata": "0x0...",
196+
// "version": "0.0.1"
197+
// }
198+
//
199+
// The configuration example may be found in the [README.md] file.
200+
//
201+
// [README.md]: https://github.com/0xPolygonID/c-polygonid/blob/main/README.md#configuration
202+
//
203+
extern GoUint8 PLGNW3CCredentialFromOnchainHex(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
204+
205+
// PLGNDescribeID parses ID and return it in different representations.
206+
// Request example:
207+
//
208+
// {"id":"31Akw5AB2xBrwqmbDUA2XoSGCfTepz52q9jmFE4mXA"}
209+
//
210+
// {"idAsInt":"24460059377712687587111979692736628604804094576108957842967948238113620738"}
211+
//
212+
// There is possible to pass both id & idAsInt fields in the request. But if the
213+
// resulted ID would not be equal, error returns.
214+
//
215+
// Response example:
216+
//
217+
// {
218+
// "did": "did:polygonid:linea:testnet:31Akw5AB2xBrwqmbDUA2XoSGCfTepz52q9jmFE4mXA",
219+
// "id": "31Akw5AB2xBrwqmbDUA2XoSGCfTepz52q9jmFE4mXA",
220+
// "idAsInt": "24460059377712687587111979692736628604804094576108957842967948238113620738",
221+
// }
222+
//
223+
extern GoUint8 PLGNDescribeID(char** jsonResponse, char* in, char* cfg, PLGNStatus** status);
224+
200225
#ifdef __cplusplus
201226
}
202227
#endif

0 commit comments

Comments
 (0)