Skip to content

Commit

Permalink
Fix cow sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Wixzi committed Mar 29, 2023
1 parent a17a2c6 commit c70f56b
Show file tree
Hide file tree
Showing 4 changed files with 5,323 additions and 8,700 deletions.
22 changes: 10 additions & 12 deletions bin/cow-app-data.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { CowSdk, AppDataDoc, IpfsHashInfo } from '@cowprotocol/cow-sdk'
import { CowSdk, IpfsHashInfo, LatestAppDataDocVersion } from '@cowprotocol/cow-sdk'
import { writeFile } from 'fs/promises'
import { hideBin } from 'yargs/helpers'
import yargs from 'yargs'
import { hideBin } from 'yargs/helpers'

export interface GnosisProtocolMetadata {
ipfsHashInfo: IpfsHashInfo
content: AppDataDoc
content: LatestAppDataDocVersion
}

const argv = yargs(hideBin(process.argv))
Expand Down Expand Up @@ -50,17 +50,15 @@ export async function getOrderMetadata({
},
})

const content = await cowSdkInstance.metadataApi.generateAppDataDoc(
{
referrer: {
const content = await cowSdkInstance.metadataApi.generateAppDataDoc({
appDataParams: { appCode },
metadataParams: {
referrerParams: {
address: dxdaoTreasuryAddress[chainId],
version: '0.1.0',
},
},
{
appCode,
}
)
})

const ipfsHashInfo = (await cowSdkInstance.metadataApi.calculateAppDataHash(content)) as IpfsHashInfo
await cowSdkInstance.metadataApi.uploadMetadataDocToIpfs(content)

Expand All @@ -71,7 +69,7 @@ export async function getOrderMetadata({
}

export async function main() {
const pinataApiKey = argv['pinata-api-key']
const pinataApiKey = 'pinata-api-key'
const pinataApiSecret = argv['pinata-api-secret']
const chainIds = [1, 100]
const promises = await chainIds.map(async (chainId) => ({
Expand Down
Loading

0 comments on commit c70f56b

Please sign in to comment.