Skip to content

Commit

Permalink
SDK Rework + SAM (#206)
Browse files Browse the repository at this point in the history
* SDK Rework + SAM

* Delete stale-wolves-attend.md

* rollback @manypkg/get-packages

* Update .changeset/spicy-eggs-wait.md

* fix bignumber import
  • Loading branch information
PabloSzx authored Mar 31, 2023
1 parent 5524752 commit 5a3b035
Show file tree
Hide file tree
Showing 36 changed files with 7,708 additions and 8,333 deletions.
5 changes: 5 additions & 0 deletions .changeset/cyan-books-care.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soundxyz/sdk': major
---

Major v1 rework stable release
5 changes: 5 additions & 0 deletions .changeset/spicy-eggs-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@soundxyz/sdk': minor
---

SAM + Sound v1.2 support
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
with:
node-version: '^18.7.0'
cache: 'pnpm'
- name: Setup NPM credentials
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install dependencies
run: pnpm install --no-frozen-lockfile
- name: Codegen
Expand Down
36 changes: 18 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,34 +28,34 @@
"test": "pnpm -r --filter=sdk test"
},
"devDependencies": {
"@changesets/apply-release-plan": "^6.1.0",
"@changesets/assemble-release-plan": "^5.2.1",
"@changesets/apply-release-plan": "^6.1.3",
"@changesets/assemble-release-plan": "^5.2.3",
"@changesets/changelog-github": "0.4.8",
"@changesets/cli": "2.26.0",
"@changesets/config": "^2.1.1",
"@changesets/read": "^0.5.7",
"@changesets/cli": "2.26.1",
"@changesets/config": "^2.3.0",
"@changesets/read": "^0.5.9",
"@manypkg/get-packages": "^1.1.3",
"@types/node": "18.11.18",
"@typescript-eslint/eslint-plugin": "^5.36.1",
"@typescript-eslint/parser": "^5.36.1",
"dotenv-vault": "^1.11.2",
"eslint": "^8.23.0",
"eslint-config-prettier": "^8.5.0",
"@types/node": "18.15.11",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"dotenv-vault": "^1.18.0",
"eslint": "^8.37.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-prettier": "^4.2.1",
"husky": "^8.0.0",
"prettier": "^2.7.1",
"husky": "^8.0.3",
"prettier": "^2.8.7",
"pretty-quick": "^3.1.3",
"rimraf": "^4.0.0",
"semver": "^7.3.7",
"typescript": "4.9.4"
"rimraf": "^4.4.1",
"semver": "^7.3.8",
"typescript": "5.0.3"
},
"packageManager": "pnpm@7.26.3",
"packageManager": "pnpm@8.0.0",
"engines": {
"pnpm": ">=7.9.1"
},
"pnpm": {
"patchedDependencies": {
"@graphql-codegen/visitor-plugin-common@2.12.1": "patches/@graphql-codegen__visitor-plugin-common@2.12.1.patch"
"@graphql-codegen/visitor-plugin-common@3.0.2": "patches/@graphql-codegen__visitor-plugin-common@3.0.2.patch"
},
"peerDependencyRules": {
"allowedVersions": {
Expand Down
5 changes: 5 additions & 0 deletions packages/sdk/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ generates:
enumsAsConst: true
skipTypename: true
namingConvention: 'keep'
preResolveTypes: true
onlyOperationTypes: true
avoidOptionals:
field: true
object: false
scalars:
DateTime: 'string'
NonNegativeInt: 'number'
Expand Down
82 changes: 42 additions & 40 deletions packages/sdk/graphql/release.gql
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
query ReleaseInfo($contractAddress: Address!, $editionId: String) {
release: releaseContract(contractAddress: $contractAddress, editionId: $editionId) {
release: releaseFromContract(contractAddress: $contractAddress, editionId: $editionId) {
id
contractAddress
editionId

type

mintStartTime
mintStartTimestamp
webappUri

externalUrl
openseaUrl
layloUrl
marketPlaceUrl

title
behindTheMusic

season

totalRaised
totalRaisedPrimaryUsd
totalRaisedSecondaryUsd

genre {
id
name
Expand All @@ -30,20 +26,32 @@ query ReleaseInfo($contractAddress: Address!, $editionId: String) {
track {
id
duration
normalizedPeaks
revealedAudio {
id
url
audio {
audio128k {
id
url
}
audio192k {
id
url
}
audio256k {
id
url
}
audioOriginal {
id
url
}
}
}

artist {
id

gemCollectionUrl
webappUri
season
soundHandle
spotifyUrl

bannerImage {
id
Expand All @@ -56,26 +64,18 @@ query ReleaseInfo($contractAddress: Address!, $editionId: String) {

description
displayName
email
twitterHandle

avatar {
id
url
}

bannerImage {
id
url
}
}
}

rewards {
id
description
numOfBackers
price
title
}

Expand All @@ -84,26 +84,15 @@ query ReleaseInfo($contractAddress: Address!, $editionId: String) {
url
}

eggGame {
goldenEggImage {
id
winningSerialNum
goldenEggImage {
id
url
}
url
}
}
}

query AudioFromTrack($trackId: UUID!) {
audioFromTrack(trackId: $trackId) {
id
duration
audio {
eggGame {
id
url
winningSerialNum
}
revealTime
}
}

Expand Down Expand Up @@ -135,10 +124,23 @@ query ReleaseShareInfo(
track {
id
duration
normalizedPeaks
revealedAudio {
id
url
audio {
audio128k {
id
url
}
audio192k {
id
url
}
audio256k {
id
url
}
audioOriginal {
id
url
}
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/graphql/token.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
query EditionOwnedTokenIds($input: EditionOwnedTokenIdsInput!) {
editionOwnedTokenIds(input: $input)
}
61 changes: 32 additions & 29 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,52 +39,55 @@
"@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/address": "^5.7.0",
"keccak256": "^1.0.6",
"zod": "^3.18.0"
"zod": "^3.21.4"
},
"devDependencies": {
"@ethersproject/abi": "^5.7.0",
"@ethersproject/bignumber": "^5.7.0",
"@ethersproject/bytes": "^5.7.0",
"@ethersproject/contracts": "^5.7.0",
"@ethersproject/providers": "^5.7.0",
"@ethersproject/providers": "^5.7.2",
"@ethersproject/sha2": "^5.7.0",
"@ethersproject/solidity": "^5.7.0",
"@ethersproject/units": "^5.7.0",
"@ethersproject/wallet": "^5.7.0",
"@graphql-codegen/cli": "^2.11.7",
"@graphql-codegen/core": "^2.6.2",
"@graphql-codegen/typescript": "^2.7.3",
"@graphql-codegen/typescript-document-nodes": "^2.3.3",
"@graphql-codegen/typescript-operations": "^2.5.3",
"@graphql-inspector/cli": "^3.4.0",
"@graphql-inspector/config": "^3.4.0",
"@graphql-tools/utils": "^9.1.3",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.3",
"@nomicfoundation/hardhat-network-helpers": "^1.0.4",
"@nomiclabs/hardhat-ethers": "^2.1.1",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@soundxyz/sound-protocol": "1.3.0",
"@types/chai": "^4.3.3",
"@types/mocha": "^10.0.0",
"@types/node": "18.11.18",
"@graphql-codegen/cli": "^3.2.2",
"@graphql-codegen/core": "^3.1.0",
"@graphql-codegen/typescript": "^3.0.2",
"@graphql-codegen/typescript-document-nodes": "^3.0.2",
"@graphql-codegen/typescript-operations": "^3.0.2",
"@graphql-inspector/cli": "^3.4.9",
"@graphql-inspector/config": "^3.4.3",
"@graphql-tools/utils": "^9.2.1",
"@nomicfoundation/hardhat-chai-matchers": "^1.0.6",
"@nomicfoundation/hardhat-network-helpers": "^1.0.8",
"@nomiclabs/hardhat-ethers": "^2.2.2",
"@nomiclabs/hardhat-waffle": "^2.0.5",
"@soundxyz/sound-protocol": "^1.4.0",
"@soundxyz/sound-protocol-v1-0": "npm:@soundxyz/sound-protocol@1.1.0",
"@soundxyz/sound-protocol-v1-1": "npm:@soundxyz/sound-protocol@1.3.0",
"@types/chai": "^4.3.4",
"@types/mocha": "^10.0.1",
"@types/node": "18.15.11",
"bob-ts": "^4.1.1",
"bob-tsm": "^1.1.2",
"chai": "^4.3.6",
"chai": "^4.3.7",
"changesets-github-release": "^0.1.0",
"dotenv": "^16.0.1",
"esbuild": "^0.17.0",
"ethereum-waffle": "^3.2.0",
"ethers": "^5.7.0",
"dotenv": "^16.0.3",
"esbuild": "^0.17.14",
"ethereum-waffle": "^4.0.10",
"ethers": "^5.7.2",
"graphql": "^16.6.0",
"hardhat": "^2.10.2",
"merkletreejs": "^0.3.0",
"prettier": "^2.7.1",
"hardhat": "^2.13.0",
"merkletreejs": "^0.3.9",
"prettier": "^2.8.7",
"require-env-variable": "^4.0.1",
"ts-node": "^10.9.1",
"tslib": "^2.4.0",
"typescript": "4.9.4"
"tslib": "^2.5.0",
"typescript": "5.0.3"
},
"peerDependencies": {
"@soundxyz/sound-protocol": "*"
"@soundxyz/sound-protocol": "~1.4.0"
},
"publishConfig": {
"access": "public",
Expand Down
Loading

0 comments on commit 5a3b035

Please sign in to comment.