Skip to content
This repository has been archived by the owner on Dec 12, 2024. It is now read-only.

Commit

Permalink
feat: use did:dht (#147)
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwlee authored May 8, 2024
1 parent 17e7d29 commit 66cacf5
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/features/tbdex/tbdex_providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final offeringsProvider =
try {
final country = ref.read(countryProvider);
final pfi = Config.getPfi(country);
final offerings = await TbdexHttpClient.getOfferings(pfi?.didUri ?? '');
final offerings = await TbdexHttpClient.listOfferings(pfi?.didUri ?? '');
return offerings;
} on Exception catch (e) {
throw Exception('Failed to load offerings: $e');
Expand Down
2 changes: 1 addition & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Future<BearerDid> getOrCreateDid(FlutterSecureStorage storage) async {
return BearerDid.import(portableDid);
}

final did = await DidJwk.create();
final did = await DidDht.create(publish: true);
final portableDid = await did.export();
final portableDidJson = jsonEncode(portableDid.map);

Expand Down
32 changes: 28 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.18.1"
iregexp:
dependency: transitive
description:
name: iregexp
sha256: "143859dcaeecf6f683102786762d70a47ef8441a0d2287a158172d32d38799cf"
url: "https://pub.dev"
source: hosted
version: "0.1.2"
js:
dependency: transitive
description:
Expand All @@ -317,6 +325,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "4.9.0"
json_path:
dependency: transitive
description:
name: json_path
sha256: "149d32ceb7dc22422ea6d09e401fd688f54e1343bc9ff8c3cb1900ca3b1ad8b1"
url: "https://pub.dev"
source: hosted
version: "0.7.1"
json_schema:
dependency: "direct dev"
description:
Expand Down Expand Up @@ -389,6 +405,14 @@ packages:
url: "https://pub.dev"
source: hosted
version: "0.8.0"
maybe_just_nothing:
dependency: transitive
description:
name: maybe_just_nothing
sha256: "0c06326e26d08f6ed43247404376366dc4d756cef23a4f1db765f546224c35e0"
url: "https://pub.dev"
source: hosted
version: "0.5.3"
meta:
dependency: transitive
description:
Expand Down Expand Up @@ -497,10 +521,10 @@ packages:
dependency: transitive
description:
name: pointycastle
sha256: "79fbafed02cfdbe85ef3fd06c7f4bc2cbcba0177e61b765264853d4253b21744"
sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe"
url: "https://pub.dev"
source: hosted
version: "3.9.0"
version: "3.9.1"
qr:
dependency: transitive
description:
Expand Down Expand Up @@ -663,7 +687,7 @@ packages:
description:
path: "."
ref: main
resolved-ref: "498defebbbf444eac4ba501c94cfd5c7cfe61e95"
resolved-ref: "16c13c9485059fb5bf5eb21a06c684138e37b2d5"
url: "https://github.com/TBD54566975/tbdex-dart.git"
source: git
version: "1.0.0"
Expand Down Expand Up @@ -808,7 +832,7 @@ packages:
description:
path: "packages/web5"
ref: main
resolved-ref: "1bc969484bf7613840f921231176adf43a5f0d2c"
resolved-ref: "721fe2329d45eb19446f372e0f350185271f72ae"
url: "https://github.com/TBD54566975/web5-dart.git"
source: git
version: "0.1.0"
Expand Down
2 changes: 1 addition & 1 deletion test/features/account/account_did_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:web5/web5.dart';
import '../../helpers/widget_helpers.dart';

void main() async {
final did = await DidJwk.create();
final did = await DidDht.create();

group('AccountDidPage', () {
testWidgets('should show the DID', (tester) async {
Expand Down
2 changes: 1 addition & 1 deletion test/features/idv/idv_service_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void main() {
test('should get IDV request', () async {
final uri = Uri.parse('http://idv.com');
final uri2 = Uri.parse('response_uri');
final bearerDid = await DidJwk.create();
final bearerDid = await DidDht.create(publish: true);
final jwtClaims = JwtClaims(
iss: 'did:example:123',
aud: 'clientId',
Expand Down
2 changes: 1 addition & 1 deletion test/features/payment/review_payment_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void main() async {
final rfqJson = jsonDecode(rfqString);
final rfq = Rfq.fromJson(rfqJson);

final did = await DidJwk.create();
final did = await DidDht.create();

Widget reviewPaymentPageTestWidget({List<Override> overrides = const []}) =>
WidgetHelpers.testableWidget(
Expand Down
2 changes: 1 addition & 1 deletion test/features/send/send_did_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:web5/web5.dart';
import '../../helpers/widget_helpers.dart';

void main() async {
final did = await DidJwk.create();
final did = await DidDht.create();

group('SendDidPage', () {
testWidgets('should show QR Code CTA', (tester) async {
Expand Down
2 changes: 1 addition & 1 deletion test/features/send/send_page_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import 'package:web5/web5.dart';
import '../../helpers/widget_helpers.dart';

void main() async {
final did = await DidJwk.create();
final did = await DidDht.create();

group('SendPage', () {
testWidgets('should show Number Pad', (tester) async {
Expand Down

0 comments on commit 66cacf5

Please sign in to comment.