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

Accounting Fixes + Transaction Data #141

Merged

Conversation

Seroxdesign
Copy link
Contributor

@Seroxdesign Seroxdesign commented May 20, 2024

closes: #133
closes: #134

will have to generate and add a new graph api key to the deployment env.

# create one for prod here: https://thegraph.com/studio/
NEXT_PUBLIC_THE_GRAPH_API_KEY=

i fetch all the data in useAccountingV3, prepare it slightly - just basic filtering and structural changes, no data modifications.
then i modify the data and prepare it for display and export in useFormattedDataV3. the prepared form of data matches the V2, so the remaining code in accounting.tsx remains mostly the same.

notes:

  • no straightforward way to determine shares for new memberships
  • no way to test rage quits in v3 (seems like it didn't happen yet)

@Seroxdesign Seroxdesign changed the title Accounting Fixes + Transaction Data [WIP] Accounting Fixes + Transaction Data May 20, 2024
Copy link

vercel bot commented May 23, 2024

@Seroxdesign is attempting to deploy a commit to the Raid Guild Team on Vercel.

To accomplish this, @Seroxdesign needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

@growindiedev growindiedev requested a review from ECWireless May 27, 2024 01:37
Copy link

vercel bot commented Jun 10, 2024

@vidvidvid is attempting to deploy a commit to the Raid Guild Team on Vercel.

To accomplish this, @vidvidvid needs to request access to the Team.

Afterwards, an owner of the Team is required to accept their membership request.

If you're already a member of the respective Vercel Team, make sure that your Personal Vercel Account is connected to your GitHub account.

@vidvidvid vidvidvid force-pushed the 134/get-accounting-data-v3 branch from cb7638b to 213347f Compare June 15, 2024 11:06
Copy link
Contributor

@ECWireless ECWireless left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome to see this working again after a year of no accounting data! I made super minor comments, but overall, I think it's good to merge!

apps/frontend/pages/accounting.tsx Show resolved Hide resolved
apps/frontend/pages/accounting.tsx Show resolved Hide resolved
};

const priceConversion = _.includes(tokenSymbol, 'xdai') ? 1 : undefined;
console.log('priceConversion', priceConversion);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove this log? Also, may be good to add a "TODO" comment above priceConversion as a reminder to get conversions for non-stables later

libs/dm-hooks/src/useFormattedDataV3.ts Outdated Show resolved Hide resolved
libs/dm-hooks/src/useAccountingV3.ts Outdated Show resolved Hide resolved
libs/dm-hooks/src/useAccountingV3.ts Outdated Show resolved Hide resolved
@vidvidvid vidvidvid requested a review from ECWireless June 25, 2024 14:58
libs/dm-hooks/src/useFormattedDataV3.ts Outdated Show resolved Hide resolved
@ECWireless ECWireless merged commit 6c9954c into feat/upgrade-accounting-page-for-moloch-v3 Jun 26, 2024
1 check failed
@ECWireless ECWireless deleted the 134/get-accounting-data-v3 branch June 26, 2024 12:40
@ECWireless ECWireless changed the title [WIP] Accounting Fixes + Transaction Data Accounting Fixes + Transaction Data Jun 26, 2024
ECWireless added a commit that referenced this pull request Jul 29, 2024
* Add v2 and v3 panels for each tab (#131)

Co-authored-by: growindiedev <[email protected]>

* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------

Co-authored-by: ECWireless <[email protected]>

* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------

Co-authored-by: vidvidvid <[email protected]>

* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>
ECWireless added a commit that referenced this pull request Jul 29, 2024
* Add v2 and v3 panels for each tab (#131)



* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------



* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------



* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>
ECWireless added a commit that referenced this pull request Aug 11, 2024
* Upgrade accounting page for moloch v3 (#149)

* Add v2 and v3 panels for each tab (#131)

Co-authored-by: growindiedev <[email protected]>

* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------

Co-authored-by: ECWireless <[email protected]>

* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------

Co-authored-by: vidvidvid <[email protected]>

* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>

* Add invoices table and allow for Optimism chain invoices (#147)

* Add invoices table

* Remove unused remote schemas

* Add Optimism to escrow network config

* Prompt user to switch chain if unsupported

* Add warnings for Optimism and Mainnet chains

* Prevent RIP escrow on Optimism

* Ensure that user is always on the right chain

* Restrict to native USDC on Optimism

* Add insert invoice to Hasura functionality

* Add created_at and updated_at columns

* Ensure create escrow link allows chain selection

* Add chain ID to escrow confirmation

* Render chain ID name to raid and escrow pages

* Format amounts with correct decimals

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>
ECWireless added a commit that referenced this pull request Aug 12, 2024
* Upgrade accounting page for moloch v3 (#149)

* Add v2 and v3 panels for each tab (#131)

Co-authored-by: growindiedev <[email protected]>

* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------

Co-authored-by: ECWireless <[email protected]>

* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------

Co-authored-by: vidvidvid <[email protected]>

* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>

* Add invoices table and allow for Optimism chain invoices (#147)

* Add invoices table

* Remove unused remote schemas

* Add Optimism to escrow network config

* Prompt user to switch chain if unsupported

* Add warnings for Optimism and Mainnet chains

* Prevent RIP escrow on Optimism

* Ensure that user is always on the right chain

* Restrict to native USDC on Optimism

* Add insert invoice to Hasura functionality

* Add created_at and updated_at columns

* Ensure create escrow link allows chain selection

* Add chain ID to escrow confirmation

* Render chain ID name to raid and escrow pages

* Format amounts with correct decimals

* Allow member access to invoice table (#152)

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>
ECWireless added a commit that referenced this pull request Aug 16, 2024
* Upgrade accounting page for moloch v3 (#149)

* Add v2 and v3 panels for each tab (#131)

Co-authored-by: growindiedev <[email protected]>

* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------

Co-authored-by: ECWireless <[email protected]>

* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------

Co-authored-by: vidvidvid <[email protected]>

* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>

* Add invoices table and allow for Optimism chain invoices (#147)

* Add invoices table

* Remove unused remote schemas

* Add Optimism to escrow network config

* Prompt user to switch chain if unsupported

* Add warnings for Optimism and Mainnet chains

* Prevent RIP escrow on Optimism

* Ensure that user is always on the right chain

* Restrict to native USDC on Optimism

* Add insert invoice to Hasura functionality

* Add created_at and updated_at columns

* Ensure create escrow link allows chain selection

* Add chain ID to escrow confirmation

* Render chain ID name to raid and escrow pages

* Format amounts with correct decimals

* Allow member access to invoice table (#152)

* Update smart invoice subgraph versions (#154)

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>
ECWireless added a commit that referenced this pull request Nov 22, 2024
* Upgrade accounting page for moloch v3 (#149)

* Add v2 and v3 panels for each tab (#131)

Co-authored-by: growindiedev <[email protected]>

* PR for #132 (#138)

* organise memos in one hook

* split useAccounting into useAccountingV2 & useAccountingV3

* Remove useAccounting hook

---------

Co-authored-by: ECWireless <[email protected]>

* needs clean up

* cleaned up useAccountingV3

* [WIP] Accounting Fixes + Transaction Data  (#141)

* fix issue

* fetch tx data

* proposal data

* wip

* wip2

* fetch all transactions

* use bigint for calculating sum of in/out flows

* transactions

* cache results

* display member & proposal & proposal link

* fix proposals

* fix type

* cleanup

* set balancesWithPricesV3 data for csv export

fix

* add elapsed days and ragequit shares

* add in/out/balance USD

* rename

* fix types

* token symbol value

---------

Co-authored-by: vidvidvid <[email protected]>

* render v3 spoils in spoils table  (#148)

* remove V2 data from accounting and fixed type and export errors

* fetch smartInvoices and add query to fecth raids

* create formatSpoils function and raids query mvp

* unsuccessful attempt to fetch raids in useAccountingV3

* fetch invoice and raids and map them together using formatSpoils

* render formatted spoils in spoilsTable

* clean up useAccountingV3 & useFormattedDataV3

* cleanup accounting.tsx

* change file names for useFormattedData to useFormattedAccountingV3

* Minor tweaks

---------

Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: vidvidvid <[email protected]>

* Add invoices table and allow for Optimism chain invoices (#147)

* Add invoices table

* Remove unused remote schemas

* Add Optimism to escrow network config

* Prompt user to switch chain if unsupported

* Add warnings for Optimism and Mainnet chains

* Prevent RIP escrow on Optimism

* Ensure that user is always on the right chain

* Restrict to native USDC on Optimism

* Add insert invoice to Hasura functionality

* Add created_at and updated_at columns

* Ensure create escrow link allows chain selection

* Add chain ID to escrow confirmation

* Render chain ID name to raid and escrow pages

* Format amounts with correct decimals

* Allow member access to invoice table (#152)

* Update smart invoice subgraph versions (#154)

* fix member reload

* fix user card content overflow

* set up migration & textarea

* display description instead of introduction

* reuse Description component

* cleanup

* Upgrade smart invoice optimism subgraph to v0.0.3 (#161)

* Upgrade smart invoice optimism subgraph to v0.0.3

* Update how escrows are fetched in accounting page

---------

Co-authored-by: ECWireless <[email protected]>
Co-authored-by: growindiedev <[email protected]>
Co-authored-by: Abhishek Ranjan <[email protected]>
Co-authored-by: Sero <[email protected]>
Co-authored-by: ECWireless <[email protected]>
Co-authored-by: Sayo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants