mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
rename Erc20CreateParams to DatatokenCreateParams
This commit is contained in:
parent
29222ca85b
commit
6287005473
@ -97,7 +97,7 @@ import {
|
|||||||
Dispenser,
|
Dispenser,
|
||||||
DispenserCreationParams,
|
DispenserCreationParams,
|
||||||
downloadFile,
|
downloadFile,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
FixedRateExchange,
|
FixedRateExchange,
|
||||||
FreCreationParams,
|
FreCreationParams,
|
||||||
getHash,
|
getHash,
|
||||||
@ -252,7 +252,7 @@ For pool creation, the OCEAN token is used as the base token. The base token can
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -526,7 +526,7 @@ Now let's console log the Consumer balance after order to check everything is wo
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -748,7 +748,7 @@ Lets check that the download URL was successfully received
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { ProviderFees } from '.'
|
import { ProviderFees } from '.'
|
||||||
|
|
||||||
export interface Erc20CreateParams {
|
export interface DatatokenCreateParams {
|
||||||
templateIndex: number
|
templateIndex: number
|
||||||
minter: string
|
minter: string
|
||||||
paymentCollector: string
|
paymentCollector: string
|
||||||
|
@ -5,7 +5,7 @@ import ERC721Factory from '@oceanprotocol/contracts/artifacts/contracts/ERC721Fa
|
|||||||
import { LoggerInstance, generateDtName, estimateGas, ZERO_ADDRESS } from '../../utils'
|
import { LoggerInstance, generateDtName, estimateGas, ZERO_ADDRESS } from '../../utils'
|
||||||
import {
|
import {
|
||||||
FreCreationParams,
|
FreCreationParams,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
PoolCreationParams,
|
PoolCreationParams,
|
||||||
DispenserCreationParams,
|
DispenserCreationParams,
|
||||||
NftCreateData,
|
NftCreateData,
|
||||||
@ -573,7 +573,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async estGasCreateNftWithErc20(
|
public async estGasCreateNftWithErc20(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams
|
ercParams: DatatokenCreateParams
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
return estimateGas(
|
return estimateGas(
|
||||||
@ -596,7 +596,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async createNftWithErc20(
|
public async createNftWithErc20(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams
|
ercParams: DatatokenCreateParams
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
|
|
||||||
@ -630,7 +630,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async estGasCreateNftErc20WithPool(
|
public async estGasCreateNftErc20WithPool(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
poolParams: PoolCreationParams
|
poolParams: PoolCreationParams
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -657,7 +657,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async createNftErc20WithPool(
|
public async createNftErc20WithPool(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
poolParams: PoolCreationParams
|
poolParams: PoolCreationParams
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -693,7 +693,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async estGasCreateNftErc20WithFixedRate(
|
public async estGasCreateNftErc20WithFixedRate(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
freParams: FreCreationParams
|
freParams: FreCreationParams
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -720,7 +720,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async createNftErc20WithFixedRate(
|
public async createNftErc20WithFixedRate(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
freParams: FreCreationParams
|
freParams: FreCreationParams
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -756,7 +756,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async estGasCreateNftErc20WithDispenser(
|
public async estGasCreateNftErc20WithDispenser(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
dispenserParams: DispenserCreationParams
|
dispenserParams: DispenserCreationParams
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -782,7 +782,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
public async createNftErc20WithDispenser(
|
public async createNftErc20WithDispenser(
|
||||||
address: string,
|
address: string,
|
||||||
nftCreateData: NftCreateData,
|
nftCreateData: NftCreateData,
|
||||||
ercParams: Erc20CreateParams,
|
ercParams: DatatokenCreateParams,
|
||||||
dispenserParams: DispenserCreationParams
|
dispenserParams: DispenserCreationParams
|
||||||
): Promise<TransactionReceipt> {
|
): Promise<TransactionReceipt> {
|
||||||
const ercCreateData = this.getErcCreationParams(ercParams)
|
const ercCreateData = this.getErcCreationParams(ercParams)
|
||||||
@ -810,7 +810,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
return trxReceipt
|
return trxReceipt
|
||||||
}
|
}
|
||||||
|
|
||||||
getErcCreationParams(ercParams: Erc20CreateParams): any {
|
getErcCreationParams(ercParams: DatatokenCreateParams): any {
|
||||||
let name: string, symbol: string
|
let name: string, symbol: string
|
||||||
// Generate name & symbol if not present
|
// Generate name & symbol if not present
|
||||||
if (!ercParams.name || !ercParams.symbol) {
|
if (!ercParams.name || !ercParams.symbol) {
|
||||||
|
@ -97,7 +97,7 @@ import {
|
|||||||
Dispenser,
|
Dispenser,
|
||||||
DispenserCreationParams,
|
DispenserCreationParams,
|
||||||
downloadFile,
|
downloadFile,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
FixedRateExchange,
|
FixedRateExchange,
|
||||||
FreCreationParams,
|
FreCreationParams,
|
||||||
getHash,
|
getHash,
|
||||||
@ -252,7 +252,7 @@ describe('Marketplace flow tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -526,7 +526,7 @@ describe('Marketplace flow tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -748,7 +748,7 @@ describe('Marketplace flow tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../src'
|
} from '../../src'
|
||||||
import {
|
import {
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
ComputeJob,
|
ComputeJob,
|
||||||
ComputeAsset,
|
ComputeAsset,
|
||||||
ComputeAlgorithm,
|
ComputeAlgorithm,
|
||||||
@ -232,7 +232,7 @@ async function createAsset(
|
|||||||
transferable: true,
|
transferable: true,
|
||||||
owner: owner
|
owner: owner
|
||||||
}
|
}
|
||||||
const erc20ParamsAsset: Erc20CreateParams = {
|
const erc20ParamsAsset: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
ValidateMetadata,
|
ValidateMetadata,
|
||||||
DDO,
|
DDO,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
PoolCreationParams,
|
PoolCreationParams,
|
||||||
FreCreationParams,
|
FreCreationParams,
|
||||||
DispenserCreationParams
|
DispenserCreationParams
|
||||||
@ -107,7 +107,7 @@ describe('Publish tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -191,7 +191,7 @@ describe('Publish tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
@ -270,7 +270,7 @@ describe('Publish tests', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
|
@ -13,7 +13,7 @@ import {
|
|||||||
downloadFile,
|
downloadFile,
|
||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../src'
|
} from '../../src'
|
||||||
import { ProviderFees, Erc20CreateParams, DDO } from '../../src/@types'
|
import { ProviderFees, DatatokenCreateParams, DDO } from '../../src/@types'
|
||||||
|
|
||||||
describe('Simple Publish & consume test', async () => {
|
describe('Simple Publish & consume test', async () => {
|
||||||
let config: Config
|
let config: Config
|
||||||
@ -86,7 +86,7 @@ describe('Simple Publish & consume test', async () => {
|
|||||||
owner: publisherAccount
|
owner: publisherAccount
|
||||||
}
|
}
|
||||||
|
|
||||||
const erc20Params: Erc20CreateParams = {
|
const erc20Params: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
cap: '100000',
|
cap: '100000',
|
||||||
feeAmount: '0',
|
feeAmount: '0',
|
||||||
|
@ -16,7 +16,7 @@ import {
|
|||||||
import {
|
import {
|
||||||
ProviderFees,
|
ProviderFees,
|
||||||
FreCreationParams,
|
FreCreationParams,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
PoolCreationParams
|
PoolCreationParams
|
||||||
} from '../../../src/@types'
|
} from '../../../src/@types'
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ describe('Nft Factory test', () => {
|
|||||||
owner: factoryOwner
|
owner: factoryOwner
|
||||||
}
|
}
|
||||||
|
|
||||||
const ercParams: Erc20CreateParams = {
|
const ercParams: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
minter: nftOwner,
|
minter: nftOwner,
|
||||||
paymentCollector: user2,
|
paymentCollector: user2,
|
||||||
|
@ -11,7 +11,7 @@ import {
|
|||||||
approve,
|
approve,
|
||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../../src'
|
} from '../../../src'
|
||||||
import { Erc20CreateParams, PoolCreationParams, Operation } from '../../../src/@types'
|
import { DatatokenCreateParams, PoolCreationParams, Operation } from '../../../src/@types'
|
||||||
|
|
||||||
const { keccak256 } = require('@ethersproject/keccak256')
|
const { keccak256 } = require('@ethersproject/keccak256')
|
||||||
|
|
||||||
@ -51,7 +51,7 @@ describe('Router unit test', () => {
|
|||||||
owner: factoryOwner
|
owner: factoryOwner
|
||||||
}
|
}
|
||||||
|
|
||||||
const ERC_PARAMS: Erc20CreateParams = {
|
const ERC_PARAMS: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
minter: factoryOwner,
|
minter: factoryOwner,
|
||||||
paymentCollector: user2,
|
paymentCollector: user2,
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
} from '../../../../src'
|
} from '../../../../src'
|
||||||
import {
|
import {
|
||||||
PoolCreationParams,
|
PoolCreationParams,
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
CurrentFees,
|
CurrentFees,
|
||||||
TokenInOutMarket,
|
TokenInOutMarket,
|
||||||
AmountsInMaxFee,
|
AmountsInMaxFee,
|
||||||
@ -30,7 +30,7 @@ describe('Pool unit test', () => {
|
|||||||
let pool: Pool
|
let pool: Pool
|
||||||
let poolAddress: string
|
let poolAddress: string
|
||||||
let erc20Token: string
|
let erc20Token: string
|
||||||
let ercParams: Erc20CreateParams
|
let ercParams: DatatokenCreateParams
|
||||||
|
|
||||||
const nftData: NftCreateData = {
|
const nftData: NftCreateData = {
|
||||||
name: '72120Bundle',
|
name: '72120Bundle',
|
||||||
|
@ -9,7 +9,7 @@ import {
|
|||||||
Dispenser,
|
Dispenser,
|
||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../../../src/'
|
} from '../../../../src/'
|
||||||
import { Erc20CreateParams } from '../../../../src/@types'
|
import { DatatokenCreateParams } from '../../../../src/@types'
|
||||||
|
|
||||||
describe('Dispenser flow', () => {
|
describe('Dispenser flow', () => {
|
||||||
let factoryOwner: string
|
let factoryOwner: string
|
||||||
@ -30,7 +30,7 @@ describe('Dispenser flow', () => {
|
|||||||
owner: null
|
owner: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const ercParams: Erc20CreateParams = {
|
const ercParams: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
minter: null,
|
minter: null,
|
||||||
paymentCollector: null,
|
paymentCollector: null,
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
balance,
|
balance,
|
||||||
unitsToAmount
|
unitsToAmount
|
||||||
} from '../../../../src'
|
} from '../../../../src'
|
||||||
import { FreCreationParams, Erc20CreateParams } from '../../../../src/@types'
|
import { FreCreationParams, DatatokenCreateParams } from '../../../../src/@types'
|
||||||
|
|
||||||
describe('Fixed Rate unit test', () => {
|
describe('Fixed Rate unit test', () => {
|
||||||
let factoryOwner: string
|
let factoryOwner: string
|
||||||
@ -37,7 +37,7 @@ describe('Fixed Rate unit test', () => {
|
|||||||
owner: null
|
owner: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const ercParams: Erc20CreateParams = {
|
const ercParams: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
minter: null,
|
minter: null,
|
||||||
paymentCollector: null,
|
paymentCollector: null,
|
||||||
|
@ -18,7 +18,7 @@ import {
|
|||||||
ZERO_ADDRESS
|
ZERO_ADDRESS
|
||||||
} from '../../../../src'
|
} from '../../../../src'
|
||||||
import {
|
import {
|
||||||
Erc20CreateParams,
|
DatatokenCreateParams,
|
||||||
PoolCreationParams,
|
PoolCreationParams,
|
||||||
TokenInOutMarket,
|
TokenInOutMarket,
|
||||||
AmountsInMaxFee,
|
AmountsInMaxFee,
|
||||||
@ -52,7 +52,7 @@ describe('SideStaking unit test', () => {
|
|||||||
owner: null
|
owner: null
|
||||||
}
|
}
|
||||||
|
|
||||||
const ercParams: Erc20CreateParams = {
|
const ercParams: DatatokenCreateParams = {
|
||||||
templateIndex: 1,
|
templateIndex: 1,
|
||||||
minter: null,
|
minter: null,
|
||||||
paymentCollector: null,
|
paymentCollector: null,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user