feat(sdk-core): depositToVault with getVaultConfig and Concrete BTC support#9211
feat(sdk-core): depositToVault with getVaultConfig and Concrete BTC support#9211venkateshv1266 wants to merge 2 commits into
Conversation
61f2d24 to
e9261f7
Compare
| */ | ||
| private async depositToConcreteVault(params: DepositToVaultOptions): Promise<ConcreteDepositResult> { | ||
| const sendManyResult = await this.wallet.sendMany({ | ||
| type: 'defi-deposit', |
There was a problem hiding this comment.
can we have common intent type case as I can see most of intent type follow camel case but here we are using Kebab Case ?
There was a problem hiding this comment.
You can see the intentType being followed for other protocols in the same case: https://github.com/BitGo/public-types/blob/cd468bc6db1cf4d47ce69a54100754ea5850c167/src/schema/transactionRequest/intents/defiDepositIntent.ts#L7
There was a problem hiding this comment.
Same in BitGoJS sdk too,
BitGoJS/modules/sdk-core/src/bitgo/wallet/wallet.ts
Lines 4440 to 4469 in 10e5651
There was a problem hiding this comment.
Since we are building a new service, we should align the intent type naming convention with what we follow in WP. The existing intent types use camelCase, so it would be better to keep the same convention here instead of introducing kebab-case.
There was a problem hiding this comment.
In case of morpho, these changes are already done and its live in prod i guess cc: @kamleshmugdiya @hafeezshaik933
|
CI is failing |
OttoAllmendinger
left a comment
There was a problem hiding this comment.
why are we still not using typed routes?
TICKET: DEFI-279
- Add DefiVault class with depositToVault (Morpho + Concrete paths), resumeDeposit, getVaultConfig, getOperation, listOperations - getVaultConfig uses decodeWithCodec(GetVaultResponse) for runtime validation of the defi-service API response - VaultProtocol/GetVaultResponse imported from @bitgo/public-types; removes local VaultProvider/VaultConfig/ConcreteVaultConfig duplicates - Expose wallet.defi getter on Wallet class - Add defiParams to SendManyOptions and BuildParams whitelist - Add DEFI- to commitlint issuePrefixes TICKET: DEFI-279
e9261f7 to
68c4ab7
Compare
Summary
VaultProviderenum (Morpho,ConcreteBtccx) and named result typesConcreteDepositResult/MorphoDepositResult; updateDepositResultunion to use themgetVaultConfigtoDefiVaultandIDefiVault, proxyingGET /api/defi-service/v1/vaults/:iddepositToVault: routesConcreteBtccx→depositToConcreteVault,Morpho→depositToMorphoVault, else throws unsupported provider errordepositToConcreteVault: singlesendManywithtype: 'defi-deposit'anddefiParams; no recipients (WP resolves escrow destination server-side)defiParams: t.unknowntoBuildParamswhitelist and optionaldefiParamstoSendManyOptions; bump@bitgo/public-typesto^6.39.0getVaultConfighappy path + error cases, Concrete dispatch (single sendMany, pendingApproval extraction, passphrase forwarding), Morpho regression guardTest plan
yarn unit-test -- --grep "DefiVault"inmodules/sdk-core: all passingyarn buildinmodules/sdk-core: no TypeScript errorsdepositToVaultwith aconcrete_btccxvault returns{ pendingApprovalId, state }CLOSES TICKET: DEFI-279