Skip to content

Commit

Permalink
copied polytoneProxies formula to wallet category
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahSaso committed Jun 2, 2024
1 parent f9428cf commit 14052db
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/data/formulas/wallet/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export * as bank from './bank'
export * as daos from './daos'
export * as nft from './nft'
export * as polytone from './polytone'
export * as proposals from './proposals'
export * as tokens from './tokens'
export * as valence from './valence'
Expand Down
20 changes: 20 additions & 0 deletions src/data/formulas/wallet/polytone.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { WalletFormula } from '@/core'

// Map polytone note contract to the proxy contract for this account.
export const proxies: WalletFormula<Record<string, string>> = {
compute: async ({ walletAddress, getTransformationMatches }) => {
const notesWithRemoteAddress =
(await getTransformationMatches(
undefined,
`remoteAddress:${walletAddress}`
)) ?? []

return notesWithRemoteAddress.reduce(
(acc, { contractAddress, value }) => ({
...acc,
[contractAddress]: value as string,
}),
{} as Record<string, string>
)
},
}

0 comments on commit 14052db

Please sign in to comment.