Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simulations & wagmi hooks #69

Closed
wants to merge 129 commits into from
Closed
Show file tree
Hide file tree
Changes from 123 commits
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
bed06ff
feat(sdk): add wagmi-based package
Rubilmax Sep 9, 2024
cf2ca37
feat(blue-sdk-viem): make queries ultra fast
Rubilmax Sep 10, 2024
2896005
feat(blue-sdk): add wagmi-like hooks
Rubilmax Sep 11, 2024
f522a2f
Merge branch 'main' into feat/blue-sdk-viem-deployless-reads
Rubilmax Sep 11, 2024
45b7d1c
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 11, 2024
9336c32
fix(lock): update yarn lock
Rubilmax Sep 12, 2024
d7b352b
test(Holding): update backed token tests
Rubilmax Sep 12, 2024
c58e532
feat(types): added DeploylessFetchParameters
Rubilmax Sep 12, 2024
6ce1c54
feat(hooks): add holding & vault
Rubilmax Sep 12, 2024
e983351
feat(hooks): add holdings & vaults
Rubilmax Sep 12, 2024
12acf7d
feat(token): add deployless option
Rubilmax Sep 12, 2024
3ca73b4
feat(hooks): add & refactor everything
Rubilmax Sep 12, 2024
d0e2947
feat(simulation): create sdk
Rubilmax Sep 12, 2024
af852f0
fix(blue-sdk-wagmi): update package json
Rubilmax Sep 12, 2024
e5655b9
Merge branch 'feat/blue-sdk-wagmi-2' of github.com:morpho-org/sdks in…
Rubilmax Sep 12, 2024
a11a7c9
feat(blue-sdk-simulation): added simulation state
Rubilmax Sep 12, 2024
b1883cb
fix(blue-api-sdk): adapt converters to non optional vault market publ…
Rubilmax Sep 12, 2024
d495731
feat(blue-sdk-simulation): created simulation state hook
Rubilmax Sep 15, 2024
b4372bf
feat(blue-sdk-simulation): added todo
Rubilmax Sep 15, 2024
6000359
feat(blue-sdk-viem): make canTransfer undefinedable
Rubilmax Sep 16, 2024
ee46c80
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 16, 2024
8b9ca75
feat(blue-sdk-viem): make canTransfer undefinedable
Rubilmax Sep 16, 2024
52e4bfc
feat(blue-sdk): add VaultUser
Rubilmax Sep 17, 2024
89927ee
feat(wagmi): add vault user hook
Rubilmax Sep 17, 2024
84e9d9a
fix(simulation): simplify parameters types
Rubilmax Sep 17, 2024
8a1f726
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 17, 2024
4d14d9d
fix(package): update dependencies
Rubilmax Sep 17, 2024
b59d89a
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 17, 2024
0678965
fix(package): update dependencies
Rubilmax Sep 17, 2024
c9709b2
Merge branch 'feat/blue-sdk-wagmi-2' of github.com:morpho-org/sdks in…
Rubilmax Sep 17, 2024
42a3acd
fix(package): update dependencies
Rubilmax Sep 17, 2024
2dc16d9
fix(root): update ts sdk
Rubilmax Sep 17, 2024
bc18d6c
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 17, 2024
15ee5d4
fix(root): update biomejs
Rubilmax Sep 17, 2024
5d5f5fb
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 17, 2024
1c31b44
Merge branch 'feat/blue-sdk-wagmi-2' of github.com:morpho-org/sdks in…
Rubilmax Sep 17, 2024
406a596
fix(simulation): make it compile
Rubilmax Sep 17, 2024
188724c
feat(simulation): make simulation great again
Rubilmax Sep 18, 2024
696ad0c
Merge pull request #71 from morpho-org/feat/blue-sdk-wagmi-2
Rubilmax Sep 18, 2024
b9b7433
v1.7.6
Sep 18, 2024
e9a1c44
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 20, 2024
f26f148
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 20, 2024
f48da60
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 20, 2024
631591f
feat(hooks): export hooks
Rubilmax Sep 20, 2024
57cfdb3
Merge branch 'feat/blue-sdk-simulation' of github.com:morpho-org/sdks…
Rubilmax Sep 20, 2024
dd3ba1a
v1.10.1-alpha.0
Sep 20, 2024
822c19f
feat(simulation-state): add query options
Rubilmax Sep 20, 2024
92be525
Merge branch 'feat/blue-sdk-simulation' of github.com:morpho-org/sdks…
Rubilmax Sep 20, 2024
6681280
v1.10.1-alpha.1
Sep 20, 2024
9cb971a
refactor(simulation-state-hook-type): merge intersections
Rubilmax Sep 20, 2024
5e60d19
Merge branch 'feat/blue-sdk-simulation' of github.com:morpho-org/sdks…
Rubilmax Sep 20, 2024
a2b5f9f
Merge branch 'main' into feat/blue-sdk-viem-deployless-reads
oumar-fall Sep 23, 2024
0de4320
clean(blue-sdk): Remove deprecated helpers
oumar-fall Sep 23, 2024
77669f1
Merge pull request #89 from morpho-org/clean/remove-deprecated-helper
Rubilmax Sep 24, 2024
0626535
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 24, 2024
ba65cd5
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 24, 2024
9939b23
fix(release): remove release notes generation
Rubilmax Sep 24, 2024
8a297ab
v1.10.5-alpha.0
Sep 24, 2024
ba50bd4
feat(hooks): add default staleTime
Rubilmax Sep 25, 2024
679934b
Merge branch 'feat/blue-sdk-simulation' of github.com:morpho-org/sdks…
Rubilmax Sep 25, 2024
65ada84
v1.10.5-alpha.1
Sep 25, 2024
2d103cf
Merge pull request #80 from morpho-org/feat/blue-sdk-simulation
Rubilmax Sep 25, 2024
9d974f0
fix(simulation): extract block to consumer
Rubilmax Sep 25, 2024
03c90ee
v1.10.5-alpha.2
Sep 25, 2024
077be0e
fix(simulation): set pending when no block
Rubilmax Sep 25, 2024
08fce7e
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 25, 2024
a16f3d5
v1.10.5-alpha.3
Sep 25, 2024
5f16744
fix(simulation): fetch when block defined
Rubilmax Sep 25, 2024
a02e1fa
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 25, 2024
fe92244
v1.10.5-alpha.4
Sep 25, 2024
5f9ee16
fix(simulation): memoize only simulation state
Rubilmax Sep 25, 2024
17fd9aa
fix(simulation): rerender less
Rubilmax Sep 26, 2024
822aa1a
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 26, 2024
8073d1f
v1.10.5-alpha.5
Sep 26, 2024
1791f09
fix(simulation): use relative imports
Rubilmax Sep 26, 2024
9d6a6e2
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 26, 2024
1f8e6ca
v1.10.5-alpha.6
Sep 26, 2024
2170c27
fix(simulation): combine users
Rubilmax Sep 26, 2024
01370d7
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 26, 2024
6b3887d
v1.10.5-alpha.7
Sep 26, 2024
a69af06
feat(blue-sdk): improve address type
oumar-fall Sep 26, 2024
56c5540
feat(blue-viem-sdk): Add signature utils
oumar-fall Sep 26, 2024
17ca205
fix(blue-sdk-ethers): fix types
oumar-fall Sep 26, 2024
264a595
fix(blue-api-sdk): fix types
oumar-fall Sep 26, 2024
63c500f
fix: fix types
oumar-fall Sep 26, 2024
0808671
feat(blue-sdk-viem): improve structure
oumar-fall Sep 26, 2024
02114eb
clean(blue-sdk-ethers): clean augments
oumar-fall Sep 26, 2024
73c481c
clean: clean code
oumar-fall Sep 26, 2024
5d32b98
feat(blue-api-sdk): Fix types
oumar-fall Sep 26, 2024
32ad3a1
Merge pull request #99 from morpho-org/feat/add-viem-tx-utils
Rubilmax Sep 26, 2024
e4034ac
v1.10.5-alpha.8
Sep 26, 2024
0e5dbaf
feat(blue-sdk-viem): add bundler
Rubilmax Sep 27, 2024
a609208
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 30, 2024
f73a15b
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 30, 2024
3336801
fix(bundler): make package build
Rubilmax Sep 30, 2024
a8ae2fe
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 30, 2024
03abcc6
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 30, 2024
6ee072c
fix(bundler): disable tests
Rubilmax Sep 30, 2024
abe56ee
test(blue-sdk): remove force casting
Rubilmax Sep 30, 2024
9d7572e
Merge pull request #101 from morpho-org/feat/blue-sdk-viem-bundler
Rubilmax Sep 30, 2024
10ca2b9
feat(simulation-state): add errors and fetching states
Rubilmax Sep 30, 2024
4586d52
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 30, 2024
d9f8313
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Sep 30, 2024
cf788aa
v2.0.0-alpha.1
Sep 30, 2024
6b403a8
feat(simulation): add getters
Rubilmax Sep 30, 2024
5e7dcff
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Sep 30, 2024
02d6417
v2.0.0-alpha.2
Sep 30, 2024
6b57f7c
Merge branch 'main' into feat/blue-sdk-viem-deployless-reads
oumar-fall Oct 1, 2024
20ba488
v2.0.0-alpha.3
Oct 1, 2024
290369c
test: move to vitest
Rubilmax Oct 1, 2024
caae8e2
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Oct 1, 2024
d55c3b4
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Oct 1, 2024
251b49d
test(hardhat): revert to it
Rubilmax Oct 1, 2024
ed0fef9
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Oct 1, 2024
c6f0a54
test(liquidation): revert to it
Rubilmax Oct 1, 2024
6551f5f
v2.0.0-alpha.4
Oct 1, 2024
6c5a60e
feat(simulation): add isFetchingAny
Rubilmax Oct 1, 2024
3d81752
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Oct 1, 2024
c09c4cc
v2.0.0-alpha.5
Oct 1, 2024
422f408
build(package): bump wagmi
Rubilmax Oct 2, 2024
2a6fa81
Merge branch 'feat/blue-sdk-viem-deployless-reads' of github.com:morp…
Rubilmax Oct 2, 2024
7b3285d
feat(wagmi): add mergedDeepEqual
Rubilmax Oct 2, 2024
24debc6
v2.0.0-alpha.6
Oct 2, 2024
9e13814
Merge branch 'main' of github.com:morpho-org/sdks into feat/blue-sdk-…
Rubilmax Oct 7, 2024
6c5a7e7
Merge branch 'main' into feat/blue-sdk-viem-deployless-reads
oumar-fall Oct 9, 2024
786fdd8
lint: run linter
oumar-fall Oct 9, 2024
429af37
fix(morpho-ts): adapt new tests to vitest
oumar-fall Oct 9, 2024
e09d3b1
fix(blue-sdk-liquidation): fix types
oumar-fall Oct 9, 2024
e1d9218
Merge branch 'main' into feat/blue-sdk-viem-deployless-reads
oumar-fall Oct 9, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
name:
type: string
required: true
jest:
vitest:
type: boolean
hardhat:
type: boolean
Expand All @@ -26,10 +26,10 @@ jobs:
- run: yarn install --immutable
- run: yarn workspace @morpho-org/${{ inputs.name }} build

jest:
vitest:
runs-on: ubuntu-latest

if: ${{ inputs.jest == true }}
if: ${{ inputs.vitest == true }}
steps:
- uses: actions/checkout@v4

Expand All @@ -39,7 +39,7 @@ jobs:
cache: yarn

- run: yarn install --immutable
- run: yarn workspace @morpho-org/${{ inputs.name }} jest --passWithNoTests
- run: yarn workspace @morpho-org/${{ inputs.name }} vitest --passWithNoTests

hardhat:
runs-on: ubuntu-latest
Expand Down
25 changes: 17 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,39 @@ jobs:
matrix:
package:
- name: morpho-ts
jest: true
vitest: true
hardhat: false
- name: morpho-test
jest: false
vitest: false
hardhat: false
- name: blue-api-sdk
jest: false
vitest: false
hardhat: false
- name: blue-sdk
jest: true
vitest: true
hardhat: true
- name: blue-sdk-ethers
jest: true
vitest: true
hardhat: true
- name: blue-sdk-viem
jest: false
vitest: false
hardhat: true
- name: blue-sdk-wagmi
vitest: true
hardhat: false
- name: blue-sdk-viem-simulation
vitest: true
hardhat: false
- name: blue-sdk-viem-bundler
vitest: false
hardhat: false
- name: blue-sdk-ethers-liquidation
jest: false
vitest: false
hardhat: true

uses: ./.github/workflows/package.yml
with:
name: ${{ matrix.package.name }}
jest: ${{ matrix.package.jest }}
vitest: ${{ matrix.package.vitest }}
hardhat: ${{ matrix.package.hardhat }}
secrets: inherit
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"recommendations": [
"arcanis.vscode-zipfs",
"arcanis.vscode-zipfs"
]
}
2 changes: 1 addition & 1 deletion .yarn/sdks/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typescript",
"version": "5.5.4-sdk",
"version": "5.6.2-sdk",
"main": "./lib/typescript.js",
"type": "commonjs",
"bin": {
Expand Down
3 changes: 3 additions & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ packageExtensions:
"@nomicfoundation/ethereumjs-util": "*"
"@nomicfoundation/ethereumjs-vm": "*"
fs-extra: "*"
wagmi@*:
dependencies:
"@tanstack/query-core": "*"
3 changes: 2 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"recommended": false,
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error"
"noUnusedVariables": "error",
"useExhaustiveDependencies": "error"
},
"style": {
"useBlockStatements": "off"
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "node_modules/@lerna-lite/cli/schemas/lerna-schema.json",
"version": "1.11.2",
"version": "2.0.0-alpha.6",
"npmClient": "yarn",
"useWorkspaces": true
}
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "@morpho-org/sdks",
"version": "1.0.0",
"version": "0.0.0",
"description": "Collection of SDKs to interact with Morpho",
"repository": "git@github.com:morpho-org/sdks.git",
"author": "Morpho Association <contact@morpho.org>",
"license": "MIT",
"type": "module",
"private": true,
"engines": {
"node": ">=18"
Expand All @@ -16,14 +17,16 @@
"scripts": {
"postinstall": "husky install",
"lint": "biome check",
"test": "vitest",
"publish": "lerna publish from-git"
},
"devDependencies": {
"@biomejs/biome": "^1.8.3",
"@lerna-lite/cli": "3.9.1",
"@lerna-lite/publish": "3.8.0",
"@biomejs/biome": "1.8.3",
"@lerna-lite/cli": "^3.9.1",
"@lerna-lite/publish": "^3.8.0",
"@lerna-lite/version": "^3.7.1",
"husky": "^9.0.11",
"typescript": "^5.4.5"
"typescript": "^5.6.2",
"vitest": "^2.1.1"
}
}
176 changes: 0 additions & 176 deletions packages/blue-api-sdk/CHANGELOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions packages/blue-api-sdk/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ const config: CodegenConfig = {
},
HexString: {
input: "string",
output: "string",
output: "`0x${string}`",
},
Address: {
input: "string",
output: "string",
output: "@morpho-org/blue-sdk#Address",
},
MarketId: {
input: "string",
Expand Down
4 changes: 2 additions & 2 deletions packages/blue-api-sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@morpho-org/blue-api-sdk",
"version": "1.11.2",
"version": "2.0.0-alpha.6",
"author": "Morpho Association <contact@morpho.org>",
"main": "src/index.ts",
"files": [
Expand All @@ -23,7 +23,7 @@
"@morpho-org/morpho-ts": "workspace:^",
"graphql": "^16.8.1",
"graphql-tag": "^2.12.6",
"typescript": "^5.4.5"
"typescript": "^5.6.2"
},
"peerDependencies": {
"@morpho-org/blue-sdk": "workspace:^",
Expand Down
7 changes: 4 additions & 3 deletions packages/blue-api-sdk/src/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,10 @@ export class BlueSdkConverter {
validAt: dto.pendingSupplyCapValidAt ?? 0n,
},
removableAt: dto.removableAt,
publicAllocatorConfig: flowCaps
? this.getVaultMarketPublicAllocatorConfig(vault, flowCaps)
: undefined,
publicAllocatorConfig: this.getVaultMarketPublicAllocatorConfig(
vault,
flowCaps ?? { ...dto, maxIn: 0n, maxOut: 0n },
),
});
}

Expand Down
Loading