-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fbf823f
commit da2b250
Showing
32 changed files
with
819 additions
and
376 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
// @ts-check | ||
|
||
import { defineKind } from '@agoric/vat-data'; | ||
import { defineDurableKind, provideKindHandle } from '@agoric/vat-data'; | ||
|
||
/** | ||
* @template {AssetKind} K | ||
* @param {MapStore<string,any>} issuerBaggage | ||
* @param {string} allegedName | ||
* @param {Brand<K>} brand | ||
* @param {() => Brand<K>} getBrand must not be called before the issuerKit is | ||
* created | ||
* @returns {() => Payment<K>} | ||
*/ | ||
export const definePaymentKind = (allegedName, brand) => { | ||
const makePayment = defineKind(`${allegedName} payment`, () => ({}), { | ||
getAllegedBrand: () => brand, | ||
export const defineDurablePaymentKind = ( | ||
issuerBaggage, | ||
allegedName, | ||
getBrand, | ||
) => { | ||
const paymentKindHandle = provideKindHandle( | ||
issuerBaggage, | ||
`${allegedName} payment`, | ||
); | ||
const makePayment = defineDurableKind(paymentKindHandle, () => ({}), { | ||
getAllegedBrand: getBrand, | ||
}); | ||
return makePayment; | ||
}; | ||
harden(definePaymentKind); | ||
harden(defineDurablePaymentKind); |
Oops, something went wrong.