Skip to content

Commit

Permalink
feat: return tx hash
Browse files Browse the repository at this point in the history
  • Loading branch information
eruizgar91 committed Jan 7, 2025
1 parent e0fec0c commit f1f65a9
Show file tree
Hide file tree
Showing 3 changed files with 1,243 additions and 13 deletions.
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,13 @@
"@nestjs/typeorm": "^10.0.2",
"@nevermined-io/argo-workflows-api": "^0.1.3",
"@nevermined-io/passport-nevermined": "^0.3.0",
"@nevermined-io/sdk": "3.0.32",
"@nevermined-io/sdk": "3.0.46-rc0",
"@sideway/address": "^5.0.0",
"@sideway/formula": "^3.0.1",
"@sideway/pinpoint": "^2.0.0",
"@types/multer": "^1.4.11",
"@types/node-rsa": "^1.1.4",
"@uiw/react-md-editor": "^4.0.4",
"aws-sdk": "^2.1611.0",
"axios": "^1.6.8",
"cache-manager": "^5.5.2",
Expand All @@ -53,6 +54,7 @@
"cli-color": "^2.0.4",
"dotenv": "^16.4.5",
"eciesjs": "^0.4.6",
"ethers": "^6.12.1",
"fetch-blob": "^4.0.0",
"form-data": "^4.0.0",
"formdata-polyfill": "^4.0.10",
Expand All @@ -75,8 +77,7 @@
"swagger-ui-express": "^5.0.0",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.5",
"ethers": "^6.12.1"
"typescript": "^5.4.5"
},
"peerDependencies": {
"viem": "2.9.31"
Expand Down Expand Up @@ -114,9 +115,9 @@
"prettier": "^3.2.5",
"prettier-package-json": "^2.8.0",
"supertest": "^7.0.0",
"tslib": "^2.6.2",
"ts-jest": "^29.1.2",
"ts-node-dev": "^2.0.0",
"tslib": "^2.6.2",
"tslint-config-prettier": "^1.18.0",
"tslint-to-eslint-config": "^2.14.3",
"uuid": "^9.0.1"
Expand Down
7 changes: 5 additions & 2 deletions src/access/access.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,15 @@ export class AccessController {

const plugin = nevermined.assets.servicePlugin[template]

let txs = {}

try {
Logger.debug(
`[${did.getDid()}] Fulfilling transfer NFT with agreement ${transferData.agreementId}`,
)

await plugin.process(params, this.nvmService.nodeAccount)
const result = await plugin.process(params, this.nvmService.nodeAccount)
txs = result || {}
Logger.debug(`NFT Transferred to ${transferData.nftReceiver}`)
} catch (e) {
Logger.error(`Failed to transfer NFT ${e}`)
Expand All @@ -251,7 +254,7 @@ export class AccessController {
price: (Number(assetPrice) / 100).toString(),
currency: 'USDC',
paymentType: 'Crypto',
txHash: '0x0',
txHash: txs.toString(),
metadata: '',
}

Expand Down
Loading

0 comments on commit f1f65a9

Please # to comment.