mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
pass tslint
This commit is contained in:
parent
eef46c7a1c
commit
f14ca2b0a5
6
package-lock.json
generated
6
package-lock.json
generated
@ -130,6 +130,12 @@
|
||||
"integrity": "sha512-qQMIZNwEgL6W93e3ryUVELgRxDO1WzaN7Dj2Kvhjkk/miwXmZXRFyf2p3fh0UESKwHiFGK6re3YA55fO43Dvnw==",
|
||||
"requires": {
|
||||
"node-fetch": "^2.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"node-fetch": {
|
||||
"version": "2.3.0",
|
||||
"bundled": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"@types/bn.js": {
|
||||
|
@ -93,44 +93,44 @@ export default class Ocean {
|
||||
} as Event,
|
||||
]
|
||||
|
||||
const mapParameterValueToName = (name) => {
|
||||
const mapParameterValueToName = (name) => {
|
||||
|
||||
switch (name) {
|
||||
case "price":
|
||||
return metadata.base.price
|
||||
case "assetId":
|
||||
return "0x" + id
|
||||
case "documentKeyId":
|
||||
return "0x1234"
|
||||
switch (name) {
|
||||
case "price":
|
||||
return metadata.base.price
|
||||
case "assetId":
|
||||
return "0x" + id
|
||||
case "documentKeyId":
|
||||
return "0x1234"
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
const parameters: Parameter[] = condition.methodReflection.inputs.map((input: InputType) => {
|
||||
return {
|
||||
name: input.name,
|
||||
type: input.type,
|
||||
value: mapParameterValueToName(input.name),
|
||||
} as Parameter
|
||||
})
|
||||
|
||||
// Logger.log(`${condition.methodReflection.contractName}.${condition.methodReflection.methodName}`,
|
||||
// JSON.stringify(parameters, null, 2))
|
||||
|
||||
const parameters: Parameter[] = condition.methodReflection.inputs.map((input: InputType) => {
|
||||
return {
|
||||
name: input.name,
|
||||
type: input.type,
|
||||
value: mapParameterValueToName(input.name),
|
||||
} as Parameter
|
||||
contractName: condition.methodReflection.contractName,
|
||||
methodName: condition.methodReflection.methodName,
|
||||
timeout: condition.timeout,
|
||||
index,
|
||||
conditionKey: condition.condtionKey,
|
||||
parameters,
|
||||
events,
|
||||
dependencies: condition.dependencies,
|
||||
dependencyTimeoutFlags: condition.dependencyTimeoutFlags,
|
||||
isTerminalCondition: condition.isTerminalCondition,
|
||||
} as DDOCondition
|
||||
})
|
||||
|
||||
// Logger.log(`${condition.methodReflection.contractName}.${condition.methodReflection.methodName}`,
|
||||
// JSON.stringify(parameters, null, 2))
|
||||
|
||||
return {
|
||||
contractName: condition.methodReflection.contractName,
|
||||
methodName: condition.methodReflection.methodName,
|
||||
timeout: condition.timeout,
|
||||
index,
|
||||
conditionKey: condition.condtionKey,
|
||||
parameters,
|
||||
events,
|
||||
dependencies: condition.dependencies,
|
||||
dependencyTimeoutFlags: condition.dependencyTimeoutFlags,
|
||||
isTerminalCondition: condition.isTerminalCondition,
|
||||
} as DDOCondition
|
||||
})
|
||||
const serviceEndpoint = aquarius.getServiceEndpoint(did)
|
||||
|
||||
// create ddo itself
|
||||
|
Loading…
Reference in New Issue
Block a user