Skip to content

Commit

Permalink
Merge pull request #79 from oceanprotocol/issue-78-payment-token-fix
Browse files Browse the repository at this point in the history
Fixing bug where feeToken is always Ocean
  • Loading branch information
paulo-ocean authored Jan 9, 2025
2 parents dd45fb6 + d982d0b commit 078af56
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 1 deletion.
79 changes: 79 additions & 0 deletions metadata/downloadAssetPaymentUSDC.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"@context": [
"https://w3id.org/did/v1"
],
"id": "",
"nftAddress": "",
"version": "4.1.0",
"chainId": 80001,
"metadata": {
"created": "2021-12-20T14:35:20Z",
"updated": "2021-12-20T14:35:20Z",
"type": "dataset",
"name": "January 2024 NYC MTA Hourly Subway",
"description": "MTA hourly subway data",
"tags": [
"parquet"
],
"author": "FastOpenData",
"license": "https://docs.google.com/document/d/17TuIQgjOkqby8x8jFNF0Rx5rx9ZVJYOK6lwP9oUXjGI/edit?usp=sharing",
"additionalInformation": {
"termsAndConditions": true
}
},
"services": [
{
"id": "ccb398c50d6abd5b456e8d7242bd856a1767a890b537c2f8c10ba8b8a10e6025",
"type": "access",
"files": {
"datatokenAddress": "0x0",
"nftAddress": "0x0",
"files": [
{
"type": "url",
"url": "https://fastopendata.org/mta/raw/hourly_subway/year%3D2024/month%3D01/2024_01.parquet",
"method": "GET"
}
]
},
"datatokenAddress": "",
"serviceEndpoint": "https://v4.provider.oceanprotocol.com",
"timeout": 86400
}
],
"event": {
},
"nft": {
"address": "",
"name": "Ocean Data NFT",
"symbol": "OCEAN-NFT",
"state": 5,
"tokenURI": "",
"owner": "",
"created": ""
},
"purgatory": {
"state": false
},
"datatokens": [
],
"stats": {
"allocated": 0,
"orders": 0,
"price": {
"value": "2",
"tokenAddress": "0xf08A50178dfcDe18524640EA6618a1f965821715",
"tokenSymbol": "USDC"
}
},

"accessDetails": {
"baseToken": {
"address": "0xf08A50178dfcDe18524640EA6618a1f965821715",
"name": "USDC",
"symbol": "USDC",
"decimals": 6
}
}
}

2 changes: 1 addition & 1 deletion src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export async function createAsset(
cap: "100000",
feeAmount: "0",
paymentCollector: await owner.getAddress(),
feeToken: config.oceanTokenAddress,
feeToken: ddo?.stats?.price?.tokenAddress ? ddo.stats.price.tokenAddress : config.oceanTokenAddress,
minter: await owner.getAddress(),
mpFeeAddress: ZERO_ADDRESS,
};
Expand Down

0 comments on commit 078af56

Please sign in to comment.