-
Notifications
You must be signed in to change notification settings - Fork 1
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
75edef9
commit 5f9334d
Showing
4 changed files
with
24 additions
and
46 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 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,47 +1,26 @@ | ||
import { ContractEvent } from '~types'; | ||
import { | ||
addStakedExpenditureParamsToDB, | ||
getStakedExpenditureClient, | ||
} from '~utils'; | ||
|
||
export default async (event: ContractEvent): Promise<void> => { | ||
console.log(event.args); | ||
// const { colonyAddress, blockNumber } = event; | ||
// const { streamingPaymentId } = event.args; | ||
// const convertedNativeId = toNumber(streamingPaymentId); | ||
// if (!colonyAddress) { | ||
// return; | ||
// } | ||
// const streamingPaymentsClient = await getStreamingPaymentsClient( | ||
// colonyAddress, | ||
// ); | ||
// if (!streamingPaymentsClient) { | ||
// return; | ||
// } | ||
// const streamingPayment = await streamingPaymentsClient.getStreamingPayment( | ||
// streamingPaymentId, | ||
// { blockTag: blockNumber }, | ||
// ); | ||
// if (!streamingPayment) { | ||
// return; | ||
// } | ||
// const { | ||
// recipient: recipientAddress, | ||
// domainId, | ||
// startTime, | ||
// endTime, | ||
// interval, | ||
// } = streamingPayment; | ||
// const databaseId = getExpenditureDatabaseId(colonyAddress, convertedNativeId); | ||
// verbose(`Streaming payment with ID ${databaseId} created`); | ||
// await mutate< | ||
// CreateStreamingPaymentMutation, | ||
// CreateStreamingPaymentMutationVariables | ||
// >(CreateStreamingPaymentDocument, { | ||
// input: { | ||
// id: databaseId, | ||
// nativeId: convertedNativeId, | ||
// recipientAddress, | ||
// nativeDomainId: toNumber(domainId), | ||
// startTime: toNumber(startTime), | ||
// endTime: toNumber(endTime), | ||
// interval: interval.toString(), | ||
// }, | ||
// }); | ||
const { colonyAddress } = event; | ||
|
||
if (!colonyAddress) { | ||
return; | ||
} | ||
|
||
const stakedExpenditureClient = await getStakedExpenditureClient( | ||
colonyAddress, | ||
); | ||
|
||
if (!stakedExpenditureClient) { | ||
return; | ||
} | ||
|
||
await addStakedExpenditureParamsToDB( | ||
stakedExpenditureClient?.address, | ||
colonyAddress, | ||
); | ||
}; |
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