-
Notifications
You must be signed in to change notification settings - Fork 258
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #523 from MoralisWeb3/feat/solUtils
feat(sol): sol-utils package
- Loading branch information
Showing
36 changed files
with
661 additions
and
1,193 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,7 @@ | ||
--- | ||
'@moralisweb3/core': major | ||
'@moralisweb3/sol-api': major | ||
'@moralisweb3/sol-utils': major | ||
--- | ||
|
||
Adding solUtils package to codebase. |
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
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,14 @@ | ||
/** | ||
* Note this is just an interface, used in the core config. | ||
* The implementations are located in the @moralisweb3/sol-utils package. | ||
*/ | ||
|
||
export const solNetworkNames = ['mainnet', 'devnet'] as const; | ||
|
||
export type SolNetworkName = typeof solNetworkNames[number]; | ||
|
||
export interface SolNetworkable { | ||
network: SolNetworkName; | ||
} | ||
|
||
export type SolNetworkish = SolNetworkable | string; |
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 +1,2 @@ | ||
export * from './SolNetworkish'; | ||
export * from './EvmChainish'; |
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 @@ | ||
export * from './SolNetwork'; | ||
export * from './SolAddress'; | ||
export * from './SolNative'; | ||
export * from './abstract'; |
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
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
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
Empty file.
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,10 @@ | ||
CHANGELOG.md | ||
|
||
# Output folders | ||
lib/**/* | ||
dist | ||
coverage/ | ||
lib.esm | ||
node_modules | ||
|
||
src/generated |
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 @@ | ||
module.exports = { | ||
...require('../../.prettierrc'), | ||
}; |
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 @@ | ||
# @moralisweb3/sol-utils |
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 @@ | ||
module.exports = { | ||
...require('../../jest.config'), | ||
}; |
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,37 @@ | ||
{ | ||
"name": "@moralisweb3/sol-utils", | ||
"author": "Moralis", | ||
"version": "2.0.0-alpha.2", | ||
"license": "MIT", | ||
"private": false, | ||
"main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"sideEffects": false, | ||
"files": [ | ||
"lib/index.*", | ||
"lib/**/*.d.ts", | ||
"dist" | ||
], | ||
"scripts": { | ||
"test": "yarn jest --runInBand --detectOpenHandles --forceExit --ci", | ||
"test:coverage": "yarn run test --coverage", | ||
"test:watch": "yarn run test --watch", | ||
"format": "prettier . \"**/*.+(js|ts|json)\" --write", | ||
"lint": "eslint . --ext .js,.ts,.tsx,jsx", | ||
"format:check": "prettier . \"**/*.+(js|ts|json)\" --check", | ||
"clean": "rm -rf lib && rm -rf lib.esm && rm -rf tsconfig.tsbuildinfo", | ||
"gen:types": "openapi-typescript https://solana-gateway.moralis.io/api-json/ --output src/generated/types.ts", | ||
"build": "tsc", | ||
"dev": "tsc --watch" | ||
}, | ||
"devDependencies": { | ||
"openapi-typescript": "^5.2.0", | ||
"prettier": "^2.5.1", | ||
"typescript": "^4.5.5" | ||
}, | ||
"dependencies": { | ||
"@ethersproject/bignumber": "^5.6.0", | ||
"@ethersproject/units": "^5.6.0", | ||
"@moralisweb3/core": "^2.0.0-alpha.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,21 @@ | ||
import MoralisCore, { Module, MoralisCoreProvider } from '@moralisweb3/core'; | ||
|
||
export class MoralisSolUtils extends Module { | ||
public static readonly moduleName = 'evmUtils'; | ||
|
||
public static create(core?: MoralisCore): MoralisSolUtils { | ||
return new MoralisSolUtils(core ?? MoralisCoreProvider.getDefault()); | ||
} | ||
|
||
private constructor(core: MoralisCore) { | ||
super(MoralisSolUtils.moduleName, core); | ||
} | ||
|
||
public setup() { | ||
// Nothing | ||
} | ||
|
||
public start() { | ||
// Nothing | ||
} | ||
} |
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
packages/core/src/dataTypes/SolAddress.ts → ...ls/src/dataTypes/SolAddress/SolAddress.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
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 @@ | ||
export * from './SolAddress'; |
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
packages/core/src/dataTypes/SolNative.ts → ...tils/src/dataTypes/SolNative/SolNative.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
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 @@ | ||
export * from './SolNative'; |
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
packages/core/src/dataTypes/SolNetwork.ts → ...ls/src/dataTypes/SolNetwork/SolNetwork.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
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 @@ | ||
export * from './SolNetwork'; |
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 @@ | ||
export * from './SolAddress'; | ||
export * from './SolNetwork'; | ||
export * from './SolNative'; |
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 @@ | ||
export * from './dataTypes'; | ||
export * from './MoralisSolUtils'; |
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,9 @@ | ||
{ | ||
"extends": "../../tsconfig.package.json", | ||
"compilerOptions": { | ||
"outDir": "./lib", | ||
"declarationDir": "./lib/", | ||
"rootDir": "./src" | ||
}, | ||
"include": ["src/**/*", "types/**/*"] | ||
} |
Oops, something went wrong.