-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* - Added metamask snap as a new NX package with cosmjs helpers for use with other cosmos based libraries including @sei-js - Refactored helper functions in /core * Finished MM snap and merged in main branch * Added a separate babel build process for helper functions in metamask snap and removed helper functions from /core * Added eslint directive for nodejs env * Converted files to .ts * Adjusted testMatch in snap config * Added allowjs option for jest tests to snap tests * Added chrome webdriver to action * Added webdriver to coverage action * Set max workers to 1
- Loading branch information
1 parent
15f0a37
commit 387cb59
Showing
41 changed files
with
9,635 additions
and
3,014 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 @@ | ||
--- | ||
'@sei-js/core': minor | ||
--- | ||
|
||
Added helpful functions to wrap metamask snaps and use them as inputs to SeiWalletProvider |
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
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 |
---|---|---|
|
@@ -2,3 +2,4 @@ | |
|
||
/dist | ||
/coverage | ||
|
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,48 +1,48 @@ | ||
{ | ||
"name": "sei-js", | ||
"version": "1.1.5", | ||
"license": "MIT", | ||
"scripts": { | ||
"build:all": "nx run-many --target=build", | ||
"build:since": "nx affected --target=build", | ||
"lint:all": "nx run-many --target=lint", | ||
"lint:since": "nx affected --target=lint", | ||
"test:all": "nx run-many --target=test", | ||
"test:since": "nx affected --target=test", | ||
"test:coverage": "nx affected:test --all --coverage --skip-nx-cache", | ||
"release": "yarn build:all && changeset publish", | ||
"release:internal": "yarn build:all && yarn changeset && yarn changeset version --snapshot internal && yarn changeset publish --no-git-tag --snapshot --tag internal", | ||
"postrelease": "git push --follow-tags" | ||
}, | ||
"private": true, | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.0" | ||
}, | ||
"devDependencies": { | ||
"@nrwl/eslint-plugin-nx": "15.5.1", | ||
"@nrwl/nx-cloud": "latest", | ||
"@nrwl/workspace": "15.5.1", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "20.8.2", | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"eslint": "^8.33.0", | ||
"eslint-config-prettier": "8.1.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-jsx-a11y": "6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "7.31.11", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "28.1.1", | ||
"nx": "15.5.1", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "29.1.1", | ||
"ts-node": "10.9.1", | ||
"typescript": "~4.8.4" | ||
}, | ||
"workspaces": [ | ||
"packages/*" | ||
] | ||
"name": "sei-js", | ||
"version": "1.1.5", | ||
"private": true, | ||
"license": "MIT", | ||
"workspaces": [ | ||
"packages/*" | ||
], | ||
"scripts": { | ||
"build:all": "nx run-many --target=build", | ||
"build:since": "nx affected --target=build", | ||
"lint:all": "nx run-many --target=lint", | ||
"lint:since": "nx affected --target=lint", | ||
"release": "yarn build:all && changeset publish", | ||
"postrelease": "git push --follow-tags", | ||
"release:internal": "yarn build:all && yarn changeset && yarn changeset version --snapshot internal && yarn changeset publish --no-git-tag --snapshot --tag internal", | ||
"test:all": "nx run-many --target=test", | ||
"test:coverage": "nx affected:test --all --coverage --skip-nx-cache", | ||
"test:since": "nx affected --target=test" | ||
}, | ||
"dependencies": { | ||
"@changesets/cli": "^2.26.0" | ||
}, | ||
"devDependencies": { | ||
"@nrwl/eslint-plugin-nx": "15.5.1", | ||
"@nrwl/nx-cloud": "latest", | ||
"@nrwl/workspace": "15.5.1", | ||
"@types/jest": "^29.5.5", | ||
"@types/node": "20.8.2", | ||
"@typescript-eslint/eslint-plugin": "^5.50.0", | ||
"@typescript-eslint/parser": "^5.50.0", | ||
"eslint": "^8.33.0", | ||
"eslint-config-prettier": "8.1.0", | ||
"eslint-plugin-import": "2.26.0", | ||
"eslint-plugin-jsx-a11y": "6.6.1", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"eslint-plugin-react": "7.31.11", | ||
"eslint-plugin-react-hooks": "4.6.0", | ||
"jest": "29.7.0", | ||
"jest-environment-jsdom": "28.1.1", | ||
"nx": "15.5.1", | ||
"prettier": "^2.6.2", | ||
"rimraf": "^3.0.2", | ||
"ts-jest": "29.1.1", | ||
"ts-node": "10.9.1", | ||
"typescript": "~4.8.4" | ||
} | ||
} |
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,33 +1,41 @@ | ||
{ | ||
"name": "@sei-js/core", | ||
"version": "3.1.1", | ||
"version": "0.0.0-internal-20231129052901", | ||
"private": false, | ||
"description": "TypeScript library for front end integrations with Sei", | ||
"keywords": [ | ||
"sei", | ||
"javascript", | ||
"typescript" | ||
], | ||
"homepage": "https://github.com/sei-protocol/sei-js#readme", | ||
"repository": "[email protected]:sei-protocol/sei-js.git", | ||
"license": "MIT", | ||
"sideEffects": false, | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"browser": { | ||
"import": "./dist/esm/index-browser.js", | ||
"require": "./dist/cjs/index-browser.js" | ||
}, | ||
"types": "./dist/types/index.d.ts" | ||
} | ||
}, | ||
"main": "./dist/cjs/index.js", | ||
"module": "./dist/esm/index.js", | ||
"browser": "./dist/esm/index-browser.js", | ||
"sideEffects": false, | ||
"types": "./dist/types/index.d.ts", | ||
"scripts": { | ||
"prebuild": "rimraf dist", | ||
"build": "yarn build:types && yarn build:cjs && yarn build:esm && yarn build:prettier", | ||
"build:types": "tsc --project tsconfig.declarations.json", | ||
"build:cjs": "BABEL_ENV=cjs babel src --out-dir dist/cjs --extensions '.js,.jsx,.ts,.tsx' --source-maps --copy-files --no-copy-ignored", | ||
"build:esm": "BABEL_ENV=esm babel src --out-dir dist/esm --extensions '.js,.jsx,.ts,.tsx' --source-maps --copy-files --no-copy-ignored", | ||
"build:prettier": "prettier --write 'dist/**/*.js'", | ||
"build:types": "tsc --project tsconfig.declarations.json", | ||
"test": "jest" | ||
}, | ||
"homepage": "https://github.com/sei-protocol/sei-js#readme", | ||
"keywords": [ | ||
"sei", | ||
"javascript", | ||
"typescript" | ||
], | ||
"repository": "[email protected]:sei-protocol/sei-js.git", | ||
"license": "MIT", | ||
"private": false, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"dependencies": { | ||
"@cosmjs/amino": "^0.29.5", | ||
"@cosmjs/cosmwasm-stargate": "^0.29.5", | ||
|
@@ -58,15 +66,7 @@ | |
"@types/elliptic": "^6.4.14", | ||
"@types/sha.js": "^2.4.1" | ||
}, | ||
"exports": { | ||
".": { | ||
"import": "./dist/esm/index.js", | ||
"require": "./dist/cjs/index.js", | ||
"browser": { | ||
"import": "./dist/esm/index-browser.js", | ||
"require": "./dist/cjs/index-browser.js" | ||
}, | ||
"types": "./dist/types/index.d.ts" | ||
} | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
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
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,2 +1,4 @@ | ||
export { verifyArbitrary } from './signing'; | ||
export { isValidSeiAddress } from './address'; | ||
export { verifyArbitrary, makeADR36AminoSignDoc } from './signing'; | ||
export { toBech32 } from './bech32'; | ||
export { isValidSeiAddress, compressedPubKeyToAddress } from './address'; | ||
export { serializeAminoSignDoc, serializeDirectSignDoc } from './serialize'; |
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,18 @@ | ||
import { StdSignDoc } from '@cosmjs/amino'; | ||
import { serializeSignDoc } from '@cosmjs/amino/build/signdoc'; | ||
import { SignDoc } from 'cosmjs-types/cosmos/tx/v1beta1/tx'; | ||
|
||
export function serializeDirectSignDoc(signDoc: SignDoc) { | ||
return SignDoc.encode( | ||
SignDoc.fromPartial({ | ||
accountNumber: signDoc.accountNumber.toString(), | ||
authInfoBytes: signDoc.authInfoBytes, | ||
bodyBytes: signDoc.bodyBytes, | ||
chainId: signDoc.chainId | ||
}) | ||
).finish(); | ||
} | ||
|
||
export function serializeAminoSignDoc(signDoc: StdSignDoc) { | ||
return serializeSignDoc(signDoc); | ||
} |
Oops, something went wrong.