Skip to content

Commit 48d3208

Browse files
authored
Merge pull request #161 from onflow/nialexsan/use-cdc
use scripts directly
2 parents 0e8d630 + cdbdf48 commit 48d3208

47 files changed

Lines changed: 15788 additions & 50610 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ lerna-debug.log*
3333
# emulator datastore
3434
flowdb
3535
coverage.json
36+
37+
keys

build.cjs

Lines changed: 0 additions & 20 deletions
This file was deleted.

cadence/__test__/src/nftcatalog.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,9 @@ export const sendAdminProxyCapability = async (ownerAccount) => {
8484
return sendTransaction({ name, args, signers });
8585
}
8686

87-
export const proposeNFTToCatalog = async (account, collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, privatePathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, privateLinkedTypeIdentifier, privateLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message) => {
87+
export const proposeNFTToCatalog = async (account, collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message) => {
8888
const name = 'propose_nft_to_catalog';
89-
const args = [collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, privatePathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, privateLinkedTypeIdentifier, privateLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message];
89+
const args = [collectionIdentifier, contractName, contractAddress, nftTypeIdentifier, storagePathIdentifier, publicPathIdentifier, publicLinkedTypeIdentifier, publicLinkedTypeRestrictions, collectionName, collectionDescription, externalURL, squareURL, squareMediaType, bannerURL, bannerMediaType, socials, message];
9090
const signers = [account];
9191

9292
return sendTransaction({ name, args, signers });

cadence/__test__/test/nftcatalog.test.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -804,11 +804,8 @@ const proposeNFTToCatalogWithData = async (
804804
nftTypeIdentifier,
805805
struct.NFTCollectionData.storagePath.identifier,
806806
struct.NFTCollectionData.publicPath.identifier,
807-
struct.NFTCollectionData.privatePath.identifier,
808807
struct.NFTCollectionData.publicLinkedType.type.type.typeID,
809808
buildRestrictions(struct.NFTCollectionData.publicLinkedType.type),
810-
struct.NFTCollectionData.privateLinkedType.type.type.typeID,
811-
buildRestrictions(struct.NFTCollectionData.privateLinkedType.type),
812809
struct.NFTCollectionDisplay.collectionName,
813810
struct.NFTCollectionDisplay.collectionDescription,
814811
struct.ExternalURL.externalURL,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import "MetadataViews"
2+
3+
/*
4+
Script to check for the implementation of all recommended MetadataViews.
5+
*/
6+
access(all) fun main(ownerAddress: Address, collectionPublicPath: String): {String: Bool} {
7+
let owner = getAccount(ownerAddress)
8+
return {
9+
"MetadataViews": owner.getCapability<&AnyResource{MetadataViews.ResolverCollection}>(PublicPath(identifier: collectionPublicPath)!).check(),
10+
"AnyResource": owner.getCapability<&AnyResource>(PublicPath(identifier: collectionPublicPath)!).check()
11+
}
12+
}

cadence/scripts/gen_tx.cdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import "TransactionGeneration"
2+
access(all) fun main(tx: String, collectionIdentifier: String, vaultIdentifier: String, merchantAddress: String) : String {
3+
return TransactionGeneration.getTx(tx: tx, params: {
4+
"collectionIdentifier": collectionIdentifier,
5+
"vaultIdentifier": vaultIdentifier,
6+
"merchantAddress": merchantAddress
7+
})!
8+
}

cadence/scripts/get_nft_and_views_in_account.cdc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ access(all) struct NFT {
2727
access(all) let externalURL: String
2828
access(all) let storagePath: StoragePath
2929
access(all) let publicPath: PublicPath
30-
access(all) let privatePath: PrivatePath
3130
access(all) let publicLinkedType: Type
32-
access(all) let privateLinkedType: Type
3331
access(all) let collectionName: String
3432
access(all) let collectionDescription: String
3533
access(all) let collectionSquareImage: String
@@ -46,9 +44,7 @@ access(all) struct NFT {
4644
externalURL: String,
4745
storagePath: StoragePath,
4846
publicPath: PublicPath,
49-
privatePath: PrivatePath,
5047
publicLinkedType: Type,
51-
privateLinkedType: Type,
5248
collectionName: String,
5349
collectionDescription: String,
5450
collectionSquareImage: String,
@@ -64,9 +60,7 @@ access(all) struct NFT {
6460
self.externalURL = externalURL
6561
self.storagePath = storagePath
6662
self.publicPath = publicPath
67-
self.privatePath = privatePath
6863
self.publicLinkedType = publicLinkedType
69-
self.privateLinkedType = privateLinkedType
7064
self.collectionName = collectionName
7165
self.collectionDescription = collectionDescription
7266
self.collectionSquareImage = collectionSquareImage

cadence/scripts/get_nft_in_account_from_path.cdc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,16 @@ access(all) struct ExternalURLView {
3131
access(all) struct NFTCollectionDataView {
3232
access(all) let storagePath : StoragePath
3333
access(all) let publicPath : PublicPath
34-
access(all) let privatePath: PrivatePath
3534
access(all) let publicLinkedType: Type
36-
access(all) let privateLinkedType: Type
3735

3836
init (
3937
storagePath : StoragePath,
4038
publicPath : PublicPath,
41-
privatePath : PrivatePath,
4239
publicLinkedType : Type,
43-
privateLinkedType : Type,
4440
) {
4541
self.storagePath = storagePath
4642
self.publicPath = publicPath
47-
self.privatePath = privatePath
4843
self.publicLinkedType = publicLinkedType
49-
self.privateLinkedType = privateLinkedType
5044
}
5145
}
5246

cadence/scripts/get_nfts_in_account.cdc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ access(all) struct NFT {
2727
externalURL: String,
2828
storagePath: StoragePath,
2929
publicPath: PublicPath,
30-
privatePath: PrivatePath,
3130
publicLinkedType: Type,
32-
privateLinkedType: Type,
3331
collectionName: String,
3432
collectionDescription: String,
3533
collectionSquareImage: String,
@@ -44,9 +42,7 @@ access(all) struct NFT {
4442
self.externalURL = externalURL
4543
self.storagePath = storagePath
4644
self.publicPath = publicPath
47-
self.privatePath = privatePath
4845
self.publicLinkedType = publicLinkedType
49-
self.privateLinkedType = privateLinkedType
5046
self.collectionName = collectionName
5147
self.collectionDescription = collectionDescription
5248
self.collectionSquareImage = collectionSquareImage
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import "TransactionGeneration"
2+
access(all) fun main() : [String] {
3+
return TransactionGeneration.getSupportedScripts()
4+
}

0 commit comments

Comments
 (0)