Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions as/cNFT/assembly/models/persistent_nft_contract_metadata.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {storage, u128} from 'near-sdk-as'
import { storage} from 'near-sdk-as'
import { ONE_NEAR } from '../../../utils'
import { AccountId } from '../types'

Expand All @@ -12,6 +12,7 @@ const NFT_NAME = 'Nft'
/** @hidden */
const NFT_SYMBOL = 'NFT'


@nearBindgen
export class NFTContractMetadata {

Expand All @@ -35,18 +36,6 @@ export class NFTContractMetadata {

/** Base64-encoded sha256 hash of JSON from reference field. Required if `reference` is included. */
reference_hash: string

/** Base64-encoded string of packages script of the contract if there is any */
packages_script: string

/** Base64-encoded string of the render script of the contract if there is any */
render_script: string

/** Base64-encoded string of CSS styles of the contract if there is any */
style_css: string

/** Base64-encoded string of Parameters of the contract if there is any */
parameters: string
}

@nearBindgen
Expand All @@ -73,11 +62,22 @@ export class NFTContractExtra {
/** Amount of royalty, in percentage, that is set on each minted token. */
mint_royalty_amount: u32

/** Base64-encoded string of packages script of the contract if there is any */
packages_script: string

/** Base64-encoded string of the render script of the contract if there is any */
render_script: string

/** Base64-encoded string of CSS styles of the contract if there is any */
style_css: string

/** Base64-encoded string of Parameters of the contract if there is any */
parameters: string

/** Minimum amount of a bid that can be placed to a token in contract */
min_bid_amount: string
}


/**
* @hidden
*/
Expand All @@ -89,11 +89,7 @@ export function defaultNFTContractMetadata(): NFTContractMetadata {
icon: '',
base_uri: '',
reference: '',
reference_hash: '',
packages_script: '',
render_script: '',
style_css: '',
parameters: '',
reference_hash: ''
}
}

Expand All @@ -110,6 +106,10 @@ export function defaultNFTContractExtra(): NFTContractExtra {
mint_payee_id: '',
mint_royalty_id: '',
mint_royalty_amount: 0,
packages_script: '',
render_script: '',
style_css: '',
parameters: '',
min_bid_amount: '0'
}
}
Expand Down
10 changes: 5 additions & 5 deletions near-workspaces/utils/dummyData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@ export const CONTRACT_METADATA = {
icon: '',
base_uri: 'https://picsum.photos',
reference: '',
reference_hash: '',
packages_script: '',
render_script: '',
style_css: '',
parameters: '',
reference_hash: ''
}

export const CONTRACT_EXTRA = {
Expand All @@ -46,6 +42,10 @@ export const CONTRACT_EXTRA = {
mint_payee_id: 'jenny.test.near',
mint_royalty_id: 'jenny.test.near',
mint_royalty_amount: 10,
packages_script: '',
render_script: randomString(200),
style_css: randomString(50),
parameters: '',
min_bid_amount: '0',
}

Expand Down
10 changes: 5 additions & 5 deletions tests/cNFT.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ const CONTRACT_METADATA = {
base_uri: 'https://picsum.photos',
reference: '',
reference_hash: '',
packages_script: '',
render_script: '',
style_css: '',
parameters: '',
}
const CONTRACT_EXTRA = {
mint_price: CONTRACT_MINT_PRICE,
Expand All @@ -151,6 +147,10 @@ const CONTRACT_EXTRA = {
mint_payee_id: 'jenny.test.near',
mint_royalty_id: 'jenny.test.near',
mint_royalty_amount: 10,
packages_script: '',
render_script: '',
style_css: '',
parameters: '',
min_bid_amount: MINIMUM_BID_PRICE
}

Expand Down Expand Up @@ -199,7 +199,7 @@ async function test() {
*/
await jennyUseContract.init({
args: {
owner_id: "jenny.test.near",
owner_id: 'jenny.test.near',
contract_metadata: CONTRACT_METADATA,
contract_extra: CONTRACT_EXTRA,
},
Expand Down