-
Notifications
You must be signed in to change notification settings - Fork 260
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added solana utils module to have shared logic related to solana
- Loading branch information
1 parent
2edb1c1
commit ed75131
Showing
33 changed files
with
128 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './Config'; | ||
export * from './CoreConfig'; | ||
export * from './MoralisConfig'; | ||
export * from './interfaces'; |
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 @@ | ||
/** | ||
* Note this is just an interface, used in the core config. | ||
* The implementations are located in the @moralisweb3/sol-utils package. | ||
*/ | ||
|
||
export interface SolNetworkable { | ||
network: string; | ||
} | ||
|
||
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './SolNetworkish'; |
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,2 @@ | ||
# @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,34 @@ | ||
{ | ||
"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": { | ||
"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/**/*"] | ||
} |