-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* move prev sdk new pkg * prettier write * ethers v5 * fix versions * progress * progress * verbatim * remove hardhat * remove pull-env * fix * fix explicit types * fix isSoundEdition * remove
- Loading branch information
Showing
62 changed files
with
4,546 additions
and
15,842 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@soundxyz/sdk': major | ||
--- | ||
|
||
Major rework Sound.xyz SDK v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,3 +75,5 @@ yarn-error.log | |
!.env.vault | ||
|
||
cache | ||
packages/sdk/src/api/graphql/gql.ts | ||
packages/sdk-viem/src/api/graphql/gql.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
schema: | ||
- ./schema.graphql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License Copyright (c) 2022 Sound.xyz | ||
|
||
Permission is hereby granted, free of | ||
charge, to any person obtaining a copy of this software and associated | ||
documentation files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, copy, modify, merge, | ||
publish, distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to the | ||
following conditions: | ||
|
||
The above copyright notice and this permission notice | ||
(including the next paragraph) shall be included in all copies or substantial | ||
portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF | ||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO | ||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Sound.xyz SDK | ||
|
||
Visit [https://docs.sound.xyz](https://docs.sound.xyz) for more information |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// @ts-check | ||
|
||
import { buildCode } from 'bob-ts' | ||
import { execSync, spawn } from 'child_process' | ||
import { writeFile, readFile, copyFile, mkdir } from 'fs/promises' | ||
|
||
execSync('pnpm graphql-codegen', { | ||
stdio: 'inherit', | ||
}) | ||
|
||
spawn(`pnpm tsc -p tsconfig.build.json`, { | ||
stdio: 'inherit', | ||
shell: true, | ||
}) | ||
|
||
await mkdir('dist').catch(() => null) | ||
|
||
const [pkgString] = await Promise.all([ | ||
readFile('package.json', 'utf-8'), | ||
buildCode({ | ||
entryPoints: ['src'], | ||
clean: true, | ||
format: 'interop', | ||
outDir: 'dist', | ||
target: 'es2019', | ||
sourcemap: false, | ||
}), | ||
copyFile('README.md', 'dist/README.md'), | ||
copyFile('LICENSE', 'dist/LICENSE'), | ||
]) | ||
|
||
/** | ||
* @type {{name: string, version: string, exports: Record<string,{types: string; require: string; import: string} | string>; main: string; module: string; types: string; sideEffects: false; author: string, license: string, dependencies: Record<string,string>; peerDependencies: Record<string,string>} & Record<string, unknown>} | ||
*/ | ||
const { | ||
name, | ||
version, | ||
exports: pkgExports, | ||
main, | ||
module: modulePkg, | ||
types, | ||
sideEffects, | ||
author, | ||
dependencies, | ||
peerDependencies, | ||
license, | ||
scripts, | ||
devDependencies, | ||
publishConfig, | ||
...rest | ||
} = JSON.parse(pkgString) | ||
|
||
const exports = {} | ||
|
||
function cleanDistPrefix( | ||
/** | ||
* @type {string} | ||
*/ | ||
path, | ||
) { | ||
return path.replace('./dist', '.') | ||
} | ||
|
||
for (const [key, value] of Object.entries(pkgExports)) { | ||
if (typeof value === 'string') { | ||
exports[key] = cleanDistPrefix(value) | ||
} else { | ||
exports[key] = { | ||
types: cleanDistPrefix(value.types), | ||
require: cleanDistPrefix(value.require), | ||
import: cleanDistPrefix(value.import), | ||
} | ||
} | ||
} | ||
|
||
await writeFile( | ||
'dist/package.json', | ||
JSON.stringify( | ||
{ | ||
name, | ||
version, | ||
main: cleanDistPrefix(main), | ||
module: cleanDistPrefix(modulePkg), | ||
types: cleanDistPrefix(types), | ||
exports, | ||
sideEffects, | ||
author, | ||
license, | ||
dependencies, | ||
peerDependencies, | ||
...rest, | ||
}, | ||
null, | ||
2, | ||
), | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
schema: '../../schema.graphql' | ||
documents: | ||
- './graphql/**/*.gql' | ||
generates: | ||
./src/api/graphql/gql.ts: | ||
plugins: | ||
- typescript | ||
- typescript-operations | ||
- typescript-document-nodes | ||
config: | ||
useTypeImports: true | ||
enumsAsConst: true | ||
skipTypename: true | ||
namingConvention: 'keep' | ||
preResolveTypes: true | ||
onlyOperationTypes: true | ||
strictScalars: true | ||
avoidOptionals: | ||
field: true | ||
object: false | ||
scalars: | ||
DateTime: 'string' | ||
NonNegativeInt: 'number' | ||
PositiveInt: 'number' | ||
JSON: 'unknown' | ||
Timestamp: 'number' | ||
Void: 'null' | ||
UUID: 'string' | ||
CountryCode: 'string' | ||
NonEmptyString: 'string' | ||
URL: 'string' | ||
EmailAddress: 'string' | ||
Address: 'string' | ||
ENS: 'string' | ||
JWT: 'string' | ||
SemanticVersion: 'string' | ||
documentMode: 'string' | ||
hooks: | ||
afterAllFileWrite: | ||
- pnpm prettier --write |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
query Test { | ||
__typename | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
{ | ||
"name": "@soundxyz/old-sdk", | ||
"private": true, | ||
"version": "3.0.0", | ||
"homepage": "https://docs.sound.xyz", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/soundxyz/sdk", | ||
"directory": "packages/sdk" | ||
}, | ||
"license": "MIT", | ||
"author": "Sound.xyz", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs" | ||
}, | ||
"./*": { | ||
"types": "./dist/*.d.ts", | ||
"require": "./dist/*.js", | ||
"import": "./dist/*.mjs" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "./dist/index.js", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"scripts": { | ||
"prepack": "node build.mjs", | ||
"prepare": "node build.mjs", | ||
"postpublish": "gh-release", | ||
"validate": "graphql-inspector validate \"./graphql/*.gql\" \"./schema.graphql\" --deprecated" | ||
}, | ||
"dependencies": { | ||
"@ethersproject/abstract-provider": "^5.7.0", | ||
"@ethersproject/abstract-signer": "^5.7.0", | ||
"@ethersproject/address": "^5.7.0", | ||
"keccak256": "^1.0.6", | ||
"zod": "^3.22.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.2", | ||
"@ethersproject/sha2": "^5.7.0", | ||
"@ethersproject/solidity": "^5.7.0", | ||
"@ethersproject/units": "^5.7.0", | ||
"@ethersproject/wallet": "^5.7.0", | ||
"@graphql-codegen/cli": "^5.0.0", | ||
"@graphql-codegen/core": "^4.0.0", | ||
"@graphql-codegen/typescript": "^4.0.1", | ||
"@graphql-codegen/typescript-document-nodes": "^4.0.1", | ||
"@graphql-codegen/typescript-operations": "^4.0.1", | ||
"@graphql-inspector/cli": "^4.0.2", | ||
"@graphql-inspector/config": "^4.0.1", | ||
"@graphql-tools/utils": "^10.0.7", | ||
"@soundxyz/sound-protocol": "^1.7.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.8", | ||
"@types/mocha": "^10.0.2", | ||
"@types/node": "20.8.6", | ||
"bob-ts": "^4.1.1", | ||
"bob-tsm": "^1.1.2", | ||
"chai": "^4.3.10", | ||
"changesets-github-release": "^0.1.0", | ||
"dotenv": "^16.3.1", | ||
"esbuild": "^0.19.4", | ||
"ethereum-waffle": "^4.0.10", | ||
"ethers": "^5.7.2", | ||
"graphql": "^16.8.1", | ||
"merkletreejs": "^0.3.10", | ||
"prettier": "^3.0.3", | ||
"require-env-variable": "^4.0.2", | ||
"ts-node": "^10.9.1", | ||
"tslib": "^2.6.2", | ||
"typescript": "5.2.2" | ||
}, | ||
"peerDependencies": { | ||
"@soundxyz/sound-protocol": "~1.7.0" | ||
}, | ||
"publishConfig": { | ||
"access": "public", | ||
"directory": "dist", | ||
"linkDirectory": true | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
export { SoundClient } from './client/main' | ||
|
||
export * as Errors from './errors' | ||
export * from './types' |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.json", | ||
"compilerOptions": { | ||
"rootDir": "./src", | ||
"outDir": "./dist", | ||
"noEmit": false, | ||
"declaration": true, | ||
"emitDeclarationOnly": true | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
schema: './schema.graphql' | ||
schema: '../../schema.graphql' | ||
documents: | ||
- './graphql/**/*.gql' | ||
generates: | ||
|
Oops, something went wrong.