Skip to content

Feature: Streaming Payments #216

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

Draft
wants to merge 48 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
ea42ae2
Feat: Cancel streams using permissions
iamsamgibbs May 3, 2024
a9d56fe
Feat: Added isCancelled field to streaming payment model
iamsamgibbs May 8, 2024
830f005
Fix: isCancelAction logic in EndTimeSet
iamsamgibbs May 8, 2024
fee4ece
Merge pull request #217 from JoinColony/feat/2215-cancel-streams-usin…
iamsamgibbs May 9, 2024
850cfce
Create streaming payment claimed handler
davecreaser May 6, 2024
aa64bd9
Add streaming payment claims
davecreaser May 7, 2024
8f8b5f8
Remove unnecessary streamingPaymentClient
davecreaser May 8, 2024
05a6259
Add timestamp to streaming payment claims
davecreaser May 8, 2024
cc56a8c
Merge pull request #219 from JoinColony/feat/2206-claim-streaming-pay…
davecreaser May 9, 2024
1c73bbb
Feat: create action when creating streaming payment
jakubcolony May 23, 2024
680dd42
Feat: Adjust paymentTokenUpdated handler for new contracts version
jakubcolony Jun 6, 2024
39f6830
Feat: Store stream token address and amount on creation
jakubcolony Jun 6, 2024
3ad249e
Schema update: simplify StreamingPaymentClaim type
jakubcolony Jun 6, 2024
741070f
feat: handle ClaimWaived event emission
rumzledz Jun 11, 2024
9154ba9
feat: fix contract function params
rumzledz Jun 11, 2024
dbbc685
feat: remove comment
rumzledz Jun 11, 2024
1625629
feat: write an action for the cancel and waive event
rumzledz Jun 11, 2024
cac98d5
Use strings to store streaming payments timestamps
davecreaser Jun 14, 2024
74cd5ea
feat: enable handler for streaming payment actions made via motions
rumzledz Jun 11, 2024
b66f691
feat: remove redundant ternary
rumzledz Jun 17, 2024
724165a
Feat: Handle streaming payment startTimeSet
iamsamgibbs May 8, 2024
c2f0812
Fix: Update paymentTokenUpdated handler
iamsamgibbs Jun 12, 2024
f8f72fa
Fix: Realign after rebase
iamsamgibbs Jun 20, 2024
5adc85a
Fix: set startTime to string
iamsamgibbs Jun 20, 2024
e69b0c0
Feat: Handle updating limit amount
iamsamgibbs Jun 24, 2024
280f50f
fix: realign after rebase
iamsamgibbs Jun 28, 2024
b769ab6
Feat: Remove limitAmount from streamingPaymentMetadata
iamsamgibbs Jul 10, 2024
a4a42b5
Feat: Add editStreamingPaymentMotion multicall handler
iamsamgibbs Jul 17, 2024
e07f830
Feat: Link pendingStreamingPaymentMetadata when a motion is finalized
iamsamgibbs Jul 18, 2024
c4309dd
Feat: Refactor editStreamingPayment handlers and ensure colony action…
iamsamgibbs Jul 18, 2024
d77877d
Feat: Added changelog to streaming payment and streaming payment meta…
iamsamgibbs Jul 22, 2024
3e6ad79
Fix: Store streaming payment changelog on colony action, and use stre…
iamsamgibbs Jul 23, 2024
330693e
Feat: Handle cancel event when start time is in the future
iamsamgibbs Jul 23, 2024
8cfa0c5
Feat: Only update streaming payment metadata changelog if end conditi…
iamsamgibbs Jul 25, 2024
a00b4a3
Add colonyId to streaming payment model
jakubcolony Sep 17, 2024
e3c3ece
Feat: Save streaming payment recipient on the action object
jakubcolony Sep 17, 2024
c418cf6
Fix: Set streaming payment isCancelled property
jakubcolony Sep 23, 2024
f7c8396
Chore: fix rebase issues
jakubcolony Oct 1, 2024
ab9ce64
Store creatorAddress of a streaming payment
jakubcolony Oct 4, 2024
3eb1842
Fix: Link stream create action with correct streaming payment
jakubcolony Oct 4, 2024
6d6d3c0
Chore: update generated.ts after rebase
jakubcolony Nov 6, 2024
055283e
Feat: Use block timestamp as streaming payment createdAt date
jakubcolony Nov 6, 2024
d8f4322
Chore: update generated GraphQL types
jakubcolony Jan 16, 2025
1bd8828
Merge pull request #217 from JoinColony/feat/2215-cancel-streams-usin…
iamsamgibbs May 9, 2024
133ef63
Merge pull request #219 from JoinColony/feat/2206-claim-streaming-pay…
davecreaser May 9, 2024
030397b
Feat: add create stream motion handler
jakubcolony Jan 30, 2025
90ac24c
Handle pending streaming payments created by motions
jakubcolony Apr 1, 2025
97bca4c
Link pending streaming payment metadata
jakubcolony Apr 1, 2025
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
11 changes: 11 additions & 0 deletions src/eventListeners/extension/streamingPayments.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { Extension, getExtensionHash } from '@colony/colony-js';
import {
handlePaymentTokenUpdated,
handleStreamingPaymentClaimed,
handleStreamingPaymentClaimWaived,
handleStreamingPaymentCreated,
} from '~handlers';
import {
handleStreamingPaymentStartTimeSet,
handleStreamingPaymentEndTimeSet,
} from '~handlers/expenditures/index';

import { ContractEventsSignatures } from '~types';
import { output } from '~utils';
Expand All @@ -28,6 +34,11 @@ export const setupListenersForStreamingPayments = (
[ContractEventsSignatures.StreamingPaymentCreated]:
handleStreamingPaymentCreated,
[ContractEventsSignatures.PaymentTokenUpdated]: handlePaymentTokenUpdated,
[ContractEventsSignatures.StartTimeSet]: handleStreamingPaymentStartTimeSet,
[ContractEventsSignatures.EndTimeSet]: handleStreamingPaymentEndTimeSet,
[ContractEventsSignatures.StreamingPaymentClaimed]:
handleStreamingPaymentClaimed,
[ContractEventsSignatures.ClaimWaived]: handleStreamingPaymentClaimWaived,
};

Object.entries(eventHandlers).forEach(([eventSignature, handler]) =>
Expand Down
33 changes: 33 additions & 0 deletions src/graphql/fragments/expenditures.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,36 @@ fragment ExpenditureSlot on ExpenditureSlot {
networkFee
}
}

fragment StreamingPayment on StreamingPayment {
id
startTime
endTime
tokenAddress
amount
interval
metadata {
...StreamingPaymentMetadata
}
claims {
amount
timestamp
}
}

fragment StreamingPaymentMetadata on StreamingPaymentMetadata {
id
endCondition
changelog {
transactionHash
oldEndCondition
newEndCondition
}
}

fragment StreamingPaymentChanges on StreamingPaymentChanges {
startTime
endTime
interval
amount
}
2 changes: 2 additions & 0 deletions src/graphql/fragments/motions.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ fragment ColonyMotion on ColonyMotion {
isDecision
transactionHash
expenditureId
streamingPaymentId
pendingStreamingPaymentMetadataId
}

fragment VoterRecord on VoterRecord {
Expand Down
Loading