-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat!: store both recurring/one-time grants & spents; add state
#379
Conversation
Update storage data structure to version: 2
Extension builds preview
|
state
, version
state
, version
state
This comment was marked as outdated.
This comment was marked as outdated.
@raducristianpopa @dianafulga In open outgoingPayment, we actually get |
From what I know, we shouldn't compute anything on our side, it Should come from the API. Wait until it's implemented. |
It appears it was decided in interledger/open-payments#469 that they'd return spent amount only instead of balance (see edit in issue description). So, now it's upto us how to use it. We already have what amount is approved in grant. Now, we can either subtract it on each storage, or only when we need the balance. I think we don't need to know balance to know if we can make a payment (like before each payment or after, to reach the |
state
state
state
state
…tization-extension into storage-migration-1
Context
Closes #376
Changes proposed in this pull request
interval
andapprovedAmount
as separate keys in grants, store them asamount: WalletAmount
(but within the grant)GrantDetails.type = "recurring" | "one-time"
to make it easier for TypeScript to discriminate between two.Storage.version
to help with migrations, keep migrations indexed by this sequential version number.Storage.state
. This is also a precursor to Handle scenarios when budget exceeded #144 (out_of_funds
state)Storage.hasHostPermissions
withStorage.state = "missing_host_permissions"
Also includes some parts of #144 (setting the first available grant, but without
switchGrant
) and #272.