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

VC workflow with Kotlin Code snippets #1173

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ca553cf
first few codesnippets
blackgirlbytes Jan 29, 2024
639c7d4
verifying code snippet
blackgirlbytes Jan 29, 2024
869afed
return value of parsed vc
blackgirlbytes Jan 29, 2024
540f8e5
Merge branch 'main' into kotlin-vc-workflow
angiejones Jan 30, 2024
1b99630
just import all the credential model to reduce imports
blackgirlbytes Jan 30, 2024
8ed008f
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Jan 30, 2024
61e7e5e
satisfies presentation def
blackgirlbytes Jan 30, 2024
3c1fa51
create presentation result
blackgirlbytes Jan 30, 2024
67b6e00
kotlin results are json
blackgirlbytes Jan 30, 2024
a61872d
formatting
blackgirlbytes Jan 30, 2024
d2569c8
removing unnecessary repo
blackgirlbytes Jan 31, 2024
a499cc7
updating to newer version of sdk
blackgirlbytes Jan 31, 2024
2097bfb
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Jan 31, 2024
eac7682
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 1, 2024
1d35ead
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 1, 2024
ed2fb1a
shnip code snippets
blackgirlbytes Feb 1, 2024
510c115
note about undefined result
blackgirlbytes Feb 1, 2024
66ac322
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 1, 2024
20a46fd
create did key shnip
blackgirlbytes Feb 2, 2024
310939a
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 2, 2024
4c4f16e
more js code shnips
blackgirlbytes Feb 2, 2024
e1a9863
all js shnips are tested
blackgirlbytes Feb 2, 2024
15e9c85
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 2, 2024
e87b251
kotlin shnips complete
blackgirlbytes Feb 4, 2024
16731ef
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 4, 2024
df0a506
no more inline shnips
blackgirlbytes Feb 5, 2024
564a585
shnip presentation def
blackgirlbytes Feb 5, 2024
d1ffa1b
verifiable presentation
blackgirlbytes Feb 5, 2024
757c9b9
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 5, 2024
780f634
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 5, 2024
3f06b96
switching content
blackgirlbytes Feb 5, 2024
87c3bca
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 5, 2024
31d9c1a
updating to maven links
blackgirlbytes Feb 5, 2024
ebcf181
another language link
blackgirlbytes Feb 5, 2024
890b84e
separate imports so I can test snippets better
blackgirlbytes Feb 5, 2024
90e3604
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 5, 2024
8d7c16a
Merge branch 'main' into kotlin-vc-workflow
blackgirlbytes Feb 6, 2024
e1e4e79
Kotlin: PFI Allowlist (#1208)
angiejones Feb 6, 2024
897b9fe
Added Kotlin Shnips for PEX (#1199)
blackgirlbytes Feb 6, 2024
0f73914
Removing sidebar link to JS API Guide (#1211)
angiejones Feb 6, 2024
cd81cf0
Issue #1197 - Update to locked tbdex-kt:0.9.0-beta off former SNAPSHOT
ALRubinger Feb 6, 2024
c8e1db2
add replyTo option for RFQs (#1207)
acekyd Feb 7, 2024
e22524c
note about undefined result
blackgirlbytes Feb 1, 2024
d246bd1
kotlin shnips complete
blackgirlbytes Feb 4, 2024
00d5db7
switching content
blackgirlbytes Feb 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"start:widget": "pnpm --filter web5-quickstart-widgets start",
"build": "pnpm run shnip && pnpm --filter site run build",
"clear": "pnpm --filter site run clear",
"test": "pnpm run shnip && pnpm vitest run --config vite.config.ts --no-threads && pnpm test:browser && pnpm test:kotlin",
"test": "pnpm run shnip && pnpm vitest run --config vite.config.ts --no-threads && pnpm test:kotlin && pnpm test:browser",
"test:watch": "pnpm run shnip && pnpm vitest --config vite.config.ts --watch",
"test:browser": "pnpm -r test:browser",
"test:versions": "node check-versions.js",
Expand Down
16 changes: 13 additions & 3 deletions site/docs/tbdex/wallet/allowlist-pfis.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
---
title: Allowlisting PFIs
hide_title: true
sidebar_position: 4
---

import isPFIJs from '!!raw-loader!@site/snippets/testsuite-javascript/__tests__/tbdex/wallet/isPFIJs.snippet.js'
import isPFIKt from '!!raw-loader!@site/snippets/testsuite-kotlin/src/test/kotlin/docs/tbdex/wallet/isPFIKt.snippet.kt'

<LanguageSwitcher languages="JavaScript, Kotlin" />

# Allowlisting PFIs

While tbDEX is a permissionless network where any PFI can participate, you may want to curate your own list of PFIs in which you engage with. We refer to this as **allowlisting**.
Expand All @@ -18,9 +25,12 @@ Consider factors like transaction fees, currency pairs offered, and reputation.

To determine if a PFI is part of the tbDEX network, you can check their [DID document](/docs/web5/learn/did_document) for the `PFI` service type:

```js
const isPFI = pfiDid.document.service.some(service => service.type === 'PFI');
```
<Shnip
snippets={[
{ snippetContent: isPFIJs, language: 'JavaScript' },
{ snippetContent: isPFIKt, language: 'Kotlin' },
]}
/>


## Verify PFI Credentials
Expand Down
11 changes: 7 additions & 4 deletions site/docs/tbdex/wallet/send-rfq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ After your customer selects an Offering, the next step is to send a **Request fo
The Offering provided an estimate, but the Quote will provide a formal offer based on the financial transaction the customer is requesting as well as the payment methods provided.

## Create the RFQ
An RFQ is a structured tbDEX message that specifies the details of the transaction your customer wishes to make.
An RFQ is a structured tbDEX message that specifies the details of the transaction your customer wishes to make.
It includes information about the Offering, payment methods, and any required [verifiable credentials (VCs)](/docs/tbdex/wallet/managing-credentials).

To create the message, call `Rfq.create()` passing `metadata` and `data`:
Expand Down Expand Up @@ -58,7 +58,7 @@ const rfq = Rfq.create({
kind: 'BTC_WALLET_ADDRESS', // The method of payment
paymentDetails: {
btcAddress: BTC_ADDRESS // Customer's BTC wallet address
}
}
},
payoutMethod: {
kind: 'DEBIT_CARD', // The method for receiving payout
Expand All @@ -84,10 +84,13 @@ await rfq.sign(customer); // Customer's PortableDid
```

## Send RFQ to PFI
Use `TbdexHttpClient` to send the RFQ to the PFI:
Use `TbdexHttpClient` to send the RFQ to the PFI. With an optional `replyTo` property containing a valid URI where new messages from the PFI will be sent:

```js
const rfqResponse = await TbdexHttpClient.sendMessage({ message: rfq });
const rfqResponse = await TbdexHttpClient.sendMessage({
message: rfq,
replyTo: 'https://tbdex.io/callback'
});
```

The response contains a `status`, where success would be `202`:
Expand Down
10 changes: 0 additions & 10 deletions site/docs/web5/api_guide.mdx

This file was deleted.

Loading