Skip to content
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

Feature: Streaming Payments #216

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
44c8e0f
Feat: Cancel streams using permissions
iamsamgibbs May 3, 2024
26506d9
Feat: Added isCancelled field to streaming payment model
iamsamgibbs May 8, 2024
c016dc1
Fix: isCancelAction logic in EndTimeSet
iamsamgibbs May 8, 2024
789d8f4
Merge pull request #217 from JoinColony/feat/2215-cancel-streams-usin…
iamsamgibbs May 9, 2024
4235218
Create streaming payment claimed handler
davecreaser May 6, 2024
44ca71b
Add streaming payment claims
davecreaser May 7, 2024
6a05f14
Remove unnecessary streamingPaymentClient
davecreaser May 8, 2024
34d4713
Add timestamp to streaming payment claims
davecreaser May 8, 2024
2cdd24f
Merge pull request #219 from JoinColony/feat/2206-claim-streaming-pay…
davecreaser May 9, 2024
27b2ca0
Feat: create action when creating streaming payment
jakubcolony May 23, 2024
6856896
Feat: Adjust paymentTokenUpdated handler for new contracts version
jakubcolony Jun 6, 2024
c3afd47
Feat: Store stream token address and amount on creation
jakubcolony Jun 6, 2024
d13f90b
Schema update: simplify StreamingPaymentClaim type
jakubcolony Jun 6, 2024
fff089e
feat: handle ClaimWaived event emission
rumzledz Jun 11, 2024
b4682b7
feat: fix contract function params
rumzledz Jun 11, 2024
aea6853
feat: remove comment
rumzledz Jun 11, 2024
cda86c5
feat: write an action for the cancel and waive event
rumzledz Jun 11, 2024
535f021
Use strings to store streaming payments timestamps
davecreaser Jun 14, 2024
7b07034
feat: enable handler for streaming payment actions made via motions
rumzledz Jun 11, 2024
a7b3440
feat: remove redundant ternary
rumzledz Jun 17, 2024
31f4da2
Feat: Handle streaming payment startTimeSet
iamsamgibbs May 8, 2024
62be321
Fix: Update paymentTokenUpdated handler
iamsamgibbs Jun 12, 2024
6ca5a96
Fix: Realign after rebase
iamsamgibbs Jun 20, 2024
9636403
Fix: set startTime to string
iamsamgibbs Jun 20, 2024
5913f9a
Feat: Handle updating limit amount
iamsamgibbs Jun 24, 2024
7d7bdb1
fix: realign after rebase
iamsamgibbs Jun 28, 2024
28a498d
Feat: Remove limitAmount from streamingPaymentMetadata
iamsamgibbs Jul 10, 2024
7a6f2da
Feat: Add editStreamingPaymentMotion multicall handler
iamsamgibbs Jul 17, 2024
f28a302
Feat: Link pendingStreamingPaymentMetadata when a motion is finalized
iamsamgibbs Jul 18, 2024
7ebe3a9
Feat: Refactor editStreamingPayment handlers and ensure colony action…
iamsamgibbs Jul 18, 2024
01b6f83
Feat: Added changelog to streaming payment and streaming payment meta…
iamsamgibbs Jul 22, 2024
fc7f8af
Fix: Store streaming payment changelog on colony action, and use stre…
iamsamgibbs Jul 23, 2024
8b33761
Feat: Handle cancel event when start time is in the future
iamsamgibbs Jul 23, 2024
2ac45e8
Feat: Only update streaming payment metadata changelog if end conditi…
iamsamgibbs Jul 25, 2024
beabed9
Add colonyId to streaming payment model
jakubcolony Sep 17, 2024
c86bb55
Feat: Save streaming payment recipient on the action object
jakubcolony Sep 17, 2024
ff924f6
Fix: Set streaming payment isCancelled property
jakubcolony Sep 23, 2024
0e735b0
Chore: fix rebase issues
jakubcolony Oct 1, 2024
23ec524
Store creatorAddress of a streaming payment
jakubcolony Oct 4, 2024
6852039
Fix: Link stream create action with correct streaming payment
jakubcolony Oct 4, 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
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 @@ -41,3 +41,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 @@ -49,6 +49,8 @@ fragment ColonyMotion on ColonyMotion {
}
isDecision
transactionHash
streamingPaymentId
pendingStreamingPaymentMetadataId
}

fragment VoterRecord on VoterRecord {
Expand Down
Loading