Skip to content

Commit

Permalink
feat: try zerodev as a localaccount2
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizgar91 committed Apr 22, 2024
1 parent c54b387 commit 491b2a9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 27 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nevermined-io/sdk",
"version": "3.0.0-rc12",
"version": "3.0.0-rc13",
"description": "Javascript SDK for connecting with Nevermined Data Platform ",
"main": "./dist/node/sdk.js",
"typings": "./dist/node/sdk.d.ts",
Expand Down
55 changes: 29 additions & 26 deletions src/keeper/contracts/ContractBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ export abstract class ContractBase extends Instantiable {
params,
params.progress,
)
} else if (from.getType() === 'json-rpc') {
} else if (from.getType() === 'json-rpc' || from.getType() === 'zerodev') {
this.logger.debug(`Blockchain Send using JSON-RPC account to ${functionName}`)
return await this.localAccountSend(
functionName,
Expand All @@ -147,31 +147,34 @@ export abstract class ContractBase extends Instantiable {
params,
params.progress,
)
} else if (from.getType() === 'zerodev') {
this.logger.debug(`Blockchain Send using ZeroDev account`)
// TODO: Enable ZeroDev & Session Key Provider setup
// if (params.zeroDevSigner) {
// const paramsFixed = { ...params, signer: undefined }
// const contract = this.contract.connect(params.zeroDevSigner as any)
// return await this.internalSendZeroDev(
// name,
// from,
// args,
// paramsFixed,
// contract,
// params.progress,
// )
// } else if (params.sessionKeyProvider) {
// const paramsFixed = { ...params, signer: undefined }
// return await this.internalSendSessionKeyProvider(
// name,
// from,
// args,
// paramsFixed,
// params.progress,
// )
// }
} else {
}
// else if (from.getType() === 'zerodev') {
// this.logger.debug(`Blockchain Send using ZeroDev account`)

// TODO: Enable ZeroDev & Session Key Provider setup
// if (params.zeroDevSigner) {
// const paramsFixed = { ...params, signer: undefined }
// const contract = this.contract.connect(params.zeroDevSigner as any)
// return await this.internalSendZeroDev(
// name,
// from,
// args,
// paramsFixed,
// contract,
// params.progress,
// )
// } else if (params.sessionKeyProvider) {
// const paramsFixed = { ...params, signer: undefined }
// return await this.internalSendSessionKeyProvider(
// name,
// from,
// args,
// paramsFixed,
// params.progress,
// )
// }
// }
else {
throw new KeeperError(`Account not supported`)
}
}
Expand Down

0 comments on commit 491b2a9

Please sign in to comment.