-
Notifications
You must be signed in to change notification settings - Fork 9
Conversation
…turns PortableDid, wip
…using types because we are civilized
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! Note that I don't think there is CI test coverage for this, but looks much nicer to my eyes.
src/client-test.ts
Outdated
|
||
// | ||
console.log('vcJwt', vcJwt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe want to remove the log here
src/client-test.ts
Outdated
} | ||
}) | ||
|
||
await rfq.sign(alice) | ||
|
||
const rasp = await TbdexHttpClient.sendMessage({ message: rfq }) | ||
console.log('send rfq response', JSON.stringify(rasp, null, 2)) | ||
console.log('PFI DID', PFI_DID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove log (unless this is by design)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Good stuff
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noice!
allowlist: JSON.parse(process.env['SEC_ALLOWLISTED_DIDS'] || '[]') | ||
} | ||
|
||
// create ephemeral PFI did if one wasn't provided. Note: this DID and associated keys aren't persisted! | ||
// a new one will be generated every time the process starts. | ||
if (!config.did) { | ||
if (!config.pfiDid) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i was curious about this bit! since pfiDid is always undefined by the time it reaches this line... should we just... create the did?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unless we expect a future state where that isnt true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yea it is a bit wonky. it is now using createOrLoadDid() method for PFI DID the same way we do it for alice and issuer DID. i still left the condition in as a failsafe. could probably be tweaked further in the future
src/example/request-for-quote.ts
Outdated
@@ -58,7 +59,6 @@ await rfq.sign(alice) | |||
|
|||
const resp = await TbdexHttpClient.sendMessage({ message: rfq }) | |||
console.log('send rfq response', JSON.stringify(resp, null, 2)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we dont need this since sendMessage
doesn't return anything to log. it just throws if it fails
src/example/request-for-quote.ts
Outdated
|
||
// Place an order against that quote: | ||
const order = Order.create({ | ||
metadata: { from: alice.did, to: pfiDid, exchangeId: quote.exchangeId }, | ||
}) | ||
await order.sign(alice) | ||
const orderResponse = await TbdexHttpClient.sendMessage({ message: order }) | ||
console.log('sent order!') | ||
console.log('orderResponse', orderResponse) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto, we won't get orderResponse
back from sendMessage
Co-authored-by: nitro-neal <5314059+nitro-neal@users.noreply.github.com> Co-authored-by: kirahsapong <102400653+kirahsapong@users.noreply.github.com>
…l-tbdex-exchange since it was doing the full flow
closes #20