diff --git a/cmd/seeder/main.go b/cmd/seeder/main.go index 3b31c9d..bcf5c3e 100644 --- a/cmd/seeder/main.go +++ b/cmd/seeder/main.go @@ -1,15 +1,21 @@ package main import ( + "encoding/json" "fmt" + "golang.org/x/text/language" "log" "os" "os/exec" "path" "path/filepath" + "regexp" "strings" + "time" + flixv11 "flix-indexer/flix/v1_1" "github.com/go-git/go-git/v5" + "golang.org/x/text/cases" ) type Repository struct { @@ -96,44 +102,93 @@ func flixGenerate(projectPath, sourceFilePath string) (string, error) { ) cmd.Dir = projectPath - output, err := cmd.CombinedOutput() + rawTemplate, err := cmd.CombinedOutput() if err != nil { - return "", fmt.Errorf("failed to run flow-cli: %v, output: %s", err, output) + return "", fmt.Errorf("failed to run flow-cli: %v, rawTemplate: %s", err, rawTemplate) } - return string(output), nil + template, err := flixv11.NewFromJson(rawTemplate) + if err != nil { + return "", fmt.Errorf("failed to parse template from json: %s", err) + } + + existingTitle := template.GetMessage("title", "en-US") + if existingTitle == "" { + template.SetMessage("title", "en-US", humanizeFileName(sourceFilePath)) + } + + updatedRawTemplate, err := json.MarshalIndent(template, "", "\t") + if err != nil { + return "", fmt.Errorf("failed to marshal template to json: %s", err) + } + + return string(updatedRawTemplate), nil +} + +func humanizeFileName(filePath string) string { + rawFileName := path.Base(filePath) + rawFileName = strings.ReplaceAll(rawFileName, ".cdc", "") + rawFileName = string(regexp.MustCompile("[_-]").ReplaceAll([]byte(rawFileName), []byte(" "))) + rawFileName = cases.Title(language.English, cases.Compact).String(rawFileName) + return rawFileName } -func processRepositories(repos []Repository) { +func runEmulator(projectPath string) (*exec.Cmd, error) { + cmd := exec.Command("flow", "emulator") + cmd.Dir = projectPath + cmd.Stdout = os.Stdout + + err := cmd.Start() + if err != nil { + return cmd, err + } + + return cmd, nil +} + +func processRepositories(repos []Repository) error { for _, repo := range repos { repoName := filepath.Base(repo.GitUrl) - tempDir := filepath.Join("temp", repoName) + repoDir := filepath.Join("temp", repoName) + + emulatorCmd, err := runEmulator(repoDir) + if err != nil { + return err + } + // Wait for emulator to start up + time.Sleep(time.Second) - if _, err := os.Stat(tempDir); os.IsNotExist(err) { - fmt.Printf("Cloning %s into %s...\n", repo.GitUrl, tempDir) - err := cloneRepository(repo.GitUrl, tempDir) + if _, err := os.Stat(repoDir); os.IsNotExist(err) { + fmt.Printf("Cloning %s into %s...\n", repo.GitUrl, repoDir) + err := cloneRepository(repo.GitUrl, repoDir) if err != nil { log.Fatalf("Failed to clone repository: %v\n", err) } } for _, interactionPath := range repo.InteractionPaths { - files, err := findFiles(tempDir, interactionPath) + files, err := findFiles(repoDir, interactionPath) if err != nil { log.Fatalf("Failed to find files: %v\n", err) } for _, file := range files { if strings.HasSuffix(file, ".cdc") { - processCadenceFile(tempDir, file) + processCadenceFile(repoDir, file) } } } if cleanupTempFolders { - cleanupDirectory(tempDir) + cleanupDirectory(repoDir) + } + + err = emulatorCmd.Process.Kill() + if err != nil { + return err } } + return nil } func cloneRepository(gitUrl, targetDir string) error { @@ -162,5 +217,8 @@ func cleanupDirectory(directory string) { } func main() { - processRepositories(repos) + err := processRepositories(repos) + if err != nil { + panic(err) + } } diff --git a/flix/v1_1/indexer.go b/flix/v1_1/indexer.go index 3f0409e..721ae43 100644 --- a/flix/v1_1/indexer.go +++ b/flix/v1_1/indexer.go @@ -7,14 +7,14 @@ import ( ) type TemplateIndexer struct { - store []Template + store []*Template } const templatesDirPath = "./templates/" func NewIndexer() *TemplateIndexer { return &TemplateIndexer{ - store: make([]Template, 0), + store: make([]*Template, 0), } } @@ -62,18 +62,18 @@ func (i *TemplateIndexer) SeedFromFs() error { return nil } -func (i *TemplateIndexer) add(template Template) { +func (i *TemplateIndexer) add(template *Template) { i.store = append(i.store, template) } -func (i *TemplateIndexer) List() []Template { +func (i *TemplateIndexer) List() []*Template { return i.store } func (i *TemplateIndexer) GetByID(id string) *Template { for _, template := range i.store { - if template.ID() == id { - return &template + if template.Id == id { + return template } } return nil @@ -86,7 +86,7 @@ func (i *TemplateIndexer) GetBySource(cadenceSource []byte) (*Template, error) { return nil, err } if isMatch { - return &template, nil + return template, nil } } return nil, nil diff --git a/flix/v1_1/template.go b/flix/v1_1/template.go index c4168dc..5390376 100644 --- a/flix/v1_1/template.go +++ b/flix/v1_1/template.go @@ -11,65 +11,142 @@ import ( ) type Template struct { - astHash []byte - raw []byte - parsed parsedTemplate + FType string `json:"f_type"` + FVersion string `json:"f_version"` + Id string `json:"id"` + Data data `json:"data"` } -type parsedTemplate struct { - FType string `json:"f_type"` - FVersion string `json:"f_version"` - Id string `json:"id"` - Data parsedData `json:"data"` +type message struct { + Key string `json:"key"` + I18n []i18n `json:"i18n"` } -type parsedData struct { - Type string `json:"type"` - Cadence parsedCadence `json:"cadence"` +type i18n struct { + Tag string `json:"tag"` + Translation string `json:"translation"` } -type parsedCadence struct { - Body string `json:"body"` +type data struct { + Type string `json:"type"` + Interface string `json:"interface"` + Cadence cadence `json:"cadence"` + Parameters []parameter `json:"parameters"` + Dependencies []dependencies `json:"dependencies"` + Messages []message `json:"messages"` } -func NewFromJson(rawJson []byte) (Template, error) { - var parsed parsedTemplate +type dependencies struct { + Contracts []contractDependency `json:"contracts"` +} + +type contractDependency struct { + Contracts string `json:"contract"` + Networks []contractNetwork `json:"networks"` +} + +type contractNetwork struct { + Network string `json:"network"` + Address string `json:"address"` + DependencyPinBlockHeight int `json:"dependency_pin_block_height"` + DependencyPin dependencyPin `json:"dependency_pin"` +} + +type dependencyPin struct { + Pin string `json:"pin"` + PinSelf string `json:"pin_self"` + PinContractName string `json:"pin_contract_name"` + PinContractAddress string `json:"pin_contract_address"` + Imports []dependencyPin `json:"imports"` +} + +type parameter struct { + Label string `json:"label"` + Index int `json:"index"` + Type string `json:"type"` + Messages []message `json:"messages"` +} + +type cadence struct { + Body string `json:"body"` + NetworkPins []networkPin `json:"network_pins"` +} + +type networkPin struct { + Network string `json:"network"` + PinSelf string `json:"pin_self"` +} + +func NewFromJson(rawJson []byte) (*Template, error) { + var parsed Template err := json.Unmarshal(rawJson, &parsed) if err != nil { - return Template{}, err + return nil, err } if parsed.FVersion != "1.1.0" { - return Template{}, fmt.Errorf("unsupported f_version '%s'", parsed.FVersion) + return nil, fmt.Errorf("unsupported f_version '%s'", parsed.FVersion) } - astHash, err := cadenceAstHash([]byte(parsed.Data.Cadence.Body)) + return &parsed, nil +} + +func (t *Template) CadenceAstHash() ([]byte, error) { + astHash, err := cadenceAstHash([]byte(t.Data.Cadence.Body)) if err != nil { - return Template{}, err + return nil, err } - - return Template{ - astHash: astHash, - raw: rawJson, - parsed: parsed, - }, nil + return astHash, nil } -func (t Template) ID() string { - return t.parsed.Id +func (t *Template) MatchesSource(source []byte) (bool, error) { + astHash1, err := cadenceAstHash(source) + if err != nil { + return false, err + } + + astHash2, err := t.CadenceAstHash() + if err != nil { + return false, err + } + + return bytes.Equal(astHash1, astHash2), nil } -func (t Template) MarshalJSON() ([]byte, error) { - return t.raw, nil +func (t *Template) GetMessage(key, tag string) string { + for _, msg := range t.Messages { + if msg.Key == key { + for _, msgI18n := range msg.I18n { + if msgI18n.Tag == tag { + return msgI18n.Translation + } + } + } + } + return "" } -func (t Template) MatchesSource(source []byte) (bool, error) { - astHash, err := cadenceAstHash(source) - if err != nil { - return false, err +func (t *Template) SetMessage(key, tag, translation string) { + for _, msg := range t.Messages { + if msg.Key == key { + for _, msgI18n := range msg.I18n { + if msgI18n.Tag == tag { + msgI18n.Translation = translation + return + } + } + } } - return bytes.Equal(t.astHash, astHash), nil + t.Messages = append(t.Messages, message{ + Key: key, + I18n: []i18n{ + { + Tag: tag, + Translation: translation, + }, + }, + }) } func cadenceAstHash(source []byte) ([]byte, error) { diff --git a/go.mod b/go.mod index 4fe0438..ad348cf 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/go-git/go-git/v5 v5.12.0 github.com/onflow/cadence v1.0.0-preview.52 github.com/turbolent/prettier v0.0.0-20220320183459-661cc755135d + golang.org/x/text v0.14.0 ) require ( diff --git a/server/http.go b/server/http.go index ad89a57..1575351 100644 --- a/server/http.go +++ b/server/http.go @@ -16,7 +16,7 @@ type HttpServer struct { } type ListResponse struct { - Data []v11.Template `json:"data"` + Data []*v11.Template `json:"data"` } func (s *HttpServer) Setup() { @@ -25,7 +25,7 @@ func (s *HttpServer) Setup() { w.Header().Set("Access-Control-Allow-Origin", "*") response := ListResponse{ - Data: []v11.Template{}, + Data: []*v11.Template{}, } cadenceBase64 := r.URL.Query().Get("cadence_base64") @@ -44,7 +44,7 @@ func (s *HttpServer) Setup() { } if match != nil { - response.Data = []v11.Template{*match} + response.Data = []*v11.Template{match} } } else { diff --git a/templates/flow-nft/destroy_nft.template.json b/templates/flow-nft/destroy_nft.template.json index ec62f03..6787b0c 100644 --- a/templates/flow-nft/destroy_nft.template.json +++ b/templates/flow-nft/destroy_nft.template.json @@ -1,316 +1,345 @@ - { - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "d1eb0f04b0816460d9c8e1f70e92a731809baeddf13b509de7ce97f790fed504", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction withdraws an NFT from the signers collection and destroys it\n\nimport \"NonFungibleToken\"\nimport \"MetadataViews\"\nimport \"ExampleNFT\"\n\ntransaction(id: UInt64) {\n\n /// Reference that will be used for the owner's collection\n let collectionRef: auth(NonFungibleToken.Withdraw) \u0026ExampleNFT.Collection\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n \n // borrow a reference to the owner's collection\n self.collectionRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026ExampleNFT.Collection\u003e(\n from: collectionData.storagePath\n ) ?? panic(\"Account does not store an object at the specified path\")\n\n }\n\n execute {\n\n // withdraw the NFT from the owner's collection\n let nft \u003c- self.collectionRef.withdraw(withdrawID: id)\n\n destroy nft\n }\n\n post {\n !self.collectionRef.getIDs().contains(id): \"The NFT with the specified ID should have been deleted\"\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "97b53bfa72c5228865fdad626c7ff66ab82a556234a4934952712dffb752052e" + "f_type": "InteractionTemplate", + "f_version": "1.1.0", + "id": "9ea2cd84afb07be8adfd3324e49e754cf244071ef00733168bfd8d7cb3a2f3f9", + "data": { + "type": "transaction", + "interface": "", + "cadence": { + "body": "/// This transaction withdraws an NFT from the signers collection and destroys it\n\nimport \"NonFungibleToken\"\nimport \"MetadataViews\"\nimport \"ExampleNFT\"\n\ntransaction(id: UInt64) {\n\n /// Reference that will be used for the owner's collection\n let collectionRef: auth(NonFungibleToken.Withdraw) \u0026ExampleNFT.Collection\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n \n // borrow a reference to the owner's collection\n self.collectionRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026ExampleNFT.Collection\u003e(\n from: collectionData.storagePath\n ) ?? panic(\"Account does not store an object at the specified path\")\n\n }\n\n execute {\n\n // withdraw the NFT from the owner's collection\n let nft \u003c- self.collectionRef.withdraw(withdrawID: id)\n\n destroy nft\n }\n\n post {\n !self.collectionRef.getIDs().contains(id): \"The NFT with the specified ID should have been deleted\"\n }\n}\n", + "network_pins": [ + { + "network": "emulator", + "pin_self": "97b53bfa72c5228865fdad626c7ff66ab82a556234a4934952712dffb752052e" + } + ] + }, + "parameters": [ + { + "label": "id", + "index": 0, + "type": "UInt64", + "messages": [] + } + ], + "dependencies": [ + { + "contracts": [ + { + "contract": "NonFungibleToken", + "networks": [ + { + "network": "mainnet", + "address": "0x1d7e57aa55817448", + "dependency_pin_block_height": 86281908, + "dependency_pin": { + "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", + "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [] + } + ] } + }, + { + "network": "testnet", + "address": "0x631e88ae7f1d7c20", + "dependency_pin_block_height": 215280755, + "dependency_pin": { + "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", + "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [] + } + ] + } + }, + { + "network": "emulator", + "address": "0xf8d6e0586b0a20c7", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", + "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] + } + ] + } + }, + { + "network": "testing", + "address": "0000000000000007", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "", + "pin_self": "", + "pin_contract_name": "", + "pin_contract_address": "", + "imports": null + } + } ] - }, - "dependencies": [ - { - "contracts": [ + } + ] + }, + { + "contracts": [ + { + "contract": "MetadataViews", + "networks": [ + { + "network": "mainnet", + "address": "0x1d7e57aa55817448", + "dependency_pin_block_height": 86281917, + "dependency_pin": { + "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", + "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", + "pin_contract_name": "MetadataViews", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [ { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158712, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083680, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] + "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", + "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", + "pin_contract_name": "FungibleToken", + "pin_contract_address": "0xf233dcee88fe0abe", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [] + }, + { + "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", + "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", + "pin_contract_name": "Burner", + "pin_contract_address": "0xf233dcee88fe0abe", + "imports": [] + } + ] + }, + { + "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", + "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [] + } + ] + }, + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x1d7e57aa55817448", + "imports": [] } - ] - }, - { - "contracts": [ + ] + } + }, + { + "network": "testnet", + "address": "0x631e88ae7f1d7c20", + "dependency_pin_block_height": 215280761, + "dependency_pin": { + "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", + "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", + "pin_contract_name": "MetadataViews", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [ { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158714, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083686, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] + "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", + "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", + "pin_contract_name": "FungibleToken", + "pin_contract_address": "0x9a0766d93b6608b7", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [] + }, + { + "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", + "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", + "pin_contract_name": "Burner", + "pin_contract_address": "0x9a0766d93b6608b7", + "imports": [] + } + ] + }, + { + "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", + "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [] + } + ] + }, + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0x631e88ae7f1d7c20", + "imports": [] } - ] - }, - { - "contracts": [ + ] + } + }, + { + "network": "emulator", + "address": "0xf8d6e0586b0a20c7", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", + "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", + "pin_contract_name": "MetadataViews", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [ { - "contract": "ExampleNFT", - "networks": [ - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ExampleNFT", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - } - ] + "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", + "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", + "pin_contract_name": "FungibleToken", + "pin_contract_address": "0xee82856bf20e2aa6", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] + }, + { + "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", + "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", + "pin_contract_name": "Burner", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] + } + ] + }, + { + "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", + "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", + "pin_contract_name": "NonFungibleToken", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [ + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] + } + ] + }, + { + "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", + "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", + "pin_contract_name": "ViewResolver", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] } - ] - } - ], - "parameters": [ - { - "label": "id", - "index": 0, - "type": "UInt64", - "messages": [] - } + ] + } + }, + { + "network": "testing", + "address": "0000000000000007", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "", + "pin_self": "", + "pin_contract_name": "", + "pin_contract_address": "", + "imports": null + } + } + ] + } + ] + }, + { + "contracts": [ + { + "contract": "ExampleNFT", + "networks": [ + { + "network": "emulator", + "address": "0xf8d6e0586b0a20c7", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", + "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", + "pin_contract_name": "ExampleNFT", + "pin_contract_address": "0xf8d6e0586b0a20c7", + "imports": [] + } + }, + { + "network": "testing", + "address": "0000000000000007", + "dependency_pin_block_height": 0, + "dependency_pin": { + "pin": "", + "pin_self": "", + "pin_contract_name": "", + "pin_contract_address": "", + "imports": null + } + } + ] + } ] + } + ] + }, + "messages": [ + { + "key": "title", + "i18n": [ + { + "tag": "en-US", + "translation": "Destroy Nft" + } + ] } + ] } - diff --git a/templates/flow-nft/generic_transfer_with_address.template.json b/templates/flow-nft/generic_transfer_with_address.template.json index d52c493..572fdc7 100644 --- a/templates/flow-nft/generic_transfer_with_address.template.json +++ b/templates/flow-nft/generic_transfer_with_address.template.json @@ -1,335 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "a7282db3c1269c824ca451d2da97078eb3c6ca4e87c9b238ac44cefd72276088", - "data": { - "type": "transaction", - "interface": "", - "messages": [ - { - "key": "title", - "i18n": [ - { - "tag": "en-US", - "translation": "Generic NFT Transfer with Contract Address and Name" - } - ] - }, - { - "key": "description", - "i18n": [ - { - "tag": "en-US", - "translation": "Transfer any Non-Fungible Token by providing the contract address and name" - } - ] - } - ], - "cadence": { - "body": "import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the contract address and name\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any contract address and name\n/// This lets you choose the token you want to send because\n/// the transaction gets the metadata from the provided contract.\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of token to transfer\n/// @param contractAddress: The address of the contract that defines the token being transferred\n/// @param contractName: The name of the contract that defines the token being transferred. Ex: \"ExampleNFT\"\n///\n/// This transaction only works with NFTs that have the type name \"NFT\"\n/// A different transaction is required for NFTs with a different type name\n///\ntransaction(to: Address, id: UInt64, contractAddress: Address, contractName: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n // NFTCollectionData struct to get paths from\n let collectionData: MetadataViews.NFTCollectionData\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n self.collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: self.collectionData.storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n\n // Get the string representation of the address without the 0x\n var addressString = contractAddress.toString()\n if addressString.length == 18 {\n addressString = addressString.slice(from: 2, upTo: 18)\n }\n let typeString: String = \"A.\".concat(addressString).concat(\".\").concat(contractName).concat(\".NFT\")\n let type = CompositeType(typeString)\n assert(\n type != nil,\n message: \"Could not create a type out of the contract name and address!\"\n )\n\n assert(\n self.tempNFT.getType() == type!,\n message: \"The NFT that was withdrawn to transfer is not the type that was requested!\"\n )\n }\n\n execute {\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(self.collectionData.publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}", - "network_pins": [ - { - "network": "emulator", - "pin_self": "175bffa4b8f519ef4446291ce719a0aed96f115719f6ec6d6b76dbfa6233296b" - }, - { - "network": "mainnet", - "pin_self": "a92d40a71eb121a4f7d9b9b308ebb6072977793ac02764734147a146500a2325" - }, - { - "network": "testnet", - "pin_self": "784d22faf0f045a1b35cfa75cd6380a9d6bac48539872286588157529733a0ec" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158716, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083688, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158716, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083693, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "to", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "id", - "index": 1, - "type": "UInt64", - "messages": [] - }, - { - "label": "contractAddress", - "index": 2, - "type": "Address", - "messages": [] - }, - { - "label": "contractName", - "index": 3, - "type": "String", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"a7282db3c1269c824ca451d2da97078eb3c6ca4e87c9b238ac44cefd72276088","data":{"type":"transaction","interface":"","cadence":{"body":"import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the contract address and name\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any contract address and name\n/// This lets you choose the token you want to send because\n/// the transaction gets the metadata from the provided contract.\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of token to transfer\n/// @param contractAddress: The address of the contract that defines the token being transferred\n/// @param contractName: The name of the contract that defines the token being transferred. Ex: \"ExampleNFT\"\n///\n/// This transaction only works with NFTs that have the type name \"NFT\"\n/// A different transaction is required for NFTs with a different type name\n///\ntransaction(to: Address, id: UInt64, contractAddress: Address, contractName: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n // NFTCollectionData struct to get paths from\n let collectionData: MetadataViews.NFTCollectionData\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n self.collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: self.collectionData.storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n\n // Get the string representation of the address without the 0x\n var addressString = contractAddress.toString()\n if addressString.length == 18 {\n addressString = addressString.slice(from: 2, upTo: 18)\n }\n let typeString: String = \"A.\".concat(addressString).concat(\".\").concat(contractName).concat(\".NFT\")\n let type = CompositeType(typeString)\n assert(\n type != nil,\n message: \"Could not create a type out of the contract name and address!\"\n )\n\n assert(\n self.tempNFT.getType() == type!,\n message: \"The NFT that was withdrawn to transfer is not the type that was requested!\"\n )\n }\n\n execute {\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(self.collectionData.publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}","network_pins":[{"network":"emulator","pin_self":"175bffa4b8f519ef4446291ce719a0aed96f115719f6ec6d6b76dbfa6233296b"},{"network":"mainnet","pin_self":"a92d40a71eb121a4f7d9b9b308ebb6072977793ac02764734147a146500a2325"},{"network":"testnet","pin_self":"784d22faf0f045a1b35cfa75cd6380a9d6bac48539872286588157529733a0ec"}]},"parameters":[{"label":"to","index":0,"type":"Address","messages":[]},{"label":"id","index":1,"type":"UInt64","messages":[]},{"label":"contractAddress","index":2,"type":"Address","messages":[]},{"label":"contractName","index":3,"type":"String","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281918,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280768,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281925,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280768,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Generic Transfer With Address"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/generic_transfer_with_address_and_type.template.json b/templates/flow-nft/generic_transfer_with_address_and_type.template.json index a406213..95cf58e 100644 --- a/templates/flow-nft/generic_transfer_with_address_and_type.template.json +++ b/templates/flow-nft/generic_transfer_with_address_and_type.template.json @@ -1,341 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "645f1a5c3c677710684a9001e07554f0ed8d366919110b5f3bfc78c615367d54", - "data": { - "type": "transaction", - "interface": "", - "messages": [ - { - "key": "title", - "i18n": [ - { - "tag": "en-US", - "translation": "Generic NFT Transfer with Contract Address and Name" - } - ] - }, - { - "key": "description", - "i18n": [ - { - "tag": "en-US", - "translation": "Transfer any Non-Fungible Token by providing the contract address and name and type name" - } - ] - } - ], - "cadence": { - "body": "import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the contract address and name and type name\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any contract address and name and NFT type name\n/// This lets you choose the token you want to send because\n/// the transaction gets the metadata from the provided contract.\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of token to transfer\n/// @param contractAddress: The address of the contract that defines the token being transferred\n/// @param contractName: The name of the contract that defines the token being transferred. Ex: \"ExampleNFT\"\n/// @param nftTypeName: The type name of the NFT that the user wants to transfer\n/// Ex: \"NFT\"\n///\ntransaction(to: Address, id: UInt64, contractAddress: Address, contractName: String, nftTypeName: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n // NFTCollectionData struct to get paths from\n let collectionData: MetadataViews.NFTCollectionData\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n self.collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: self.collectionData.storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n\n // Get the string representation of the address without the 0x\n var addressString = contractAddress.toString()\n if addressString.length == 18 {\n addressString = addressString.slice(from: 2, upTo: 18)\n }\n let typeString: String = \"A.\".concat(addressString).concat(\".\").concat(contractName).concat(\".\").concat(nftTypeName)\n let type = CompositeType(typeString)\n assert(\n type != nil,\n message: \"Could not create a type out of the contract name and address!\"\n )\n\n assert(\n self.tempNFT.getType() == type!,\n message: \"The NFT that was withdrawn to transfer is not the type that was requested!\"\n )\n }\n\n execute {\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(self.collectionData.publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}", - "network_pins": [ - { - "network": "testnet", - "pin_self": "53616e614df69697976014be31d6800a9d42285af030125b62e9d152e90410f1" - }, - { - "network": "emulator", - "pin_self": "a7109ef302ef379ff7e3fc70cf91d388d4132e5b5a56dd5637ea7b75c9eec6e7" - }, - { - "network": "mainnet", - "pin_self": "8fa4b378859b621c464d73e73b04676103c499fcaafc99e77c2c7c5ad58947b1" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083696, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158725, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158725, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083703, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "to", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "id", - "index": 1, - "type": "UInt64", - "messages": [] - }, - { - "label": "contractAddress", - "index": 2, - "type": "Address", - "messages": [] - }, - { - "label": "contractName", - "index": 3, - "type": "String", - "messages": [] - }, - { - "label": "nftTypeName", - "index": 4, - "type": "String", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"5237ca28beb6a11993f013cdfcd69d1db4e1066e40d7502e412c5d7002b1cb66","data":{"type":"transaction","interface":"","cadence":{"body":"import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the contract address and name and type name\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any contract address and name and NFT type name\n/// This lets you choose the token you want to send because\n/// the transaction gets the metadata from the provided contract.\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of token to transfer\n/// @param contractAddress: The address of the contract that defines the token being transferred\n/// @param contractName: The name of the contract that defines the token being transferred. Ex: \"ExampleNFT\"\n/// @param nftTypeName: The type name of the NFT that the user wants to transfer\n/// Ex: \"NFT\"\n///\ntransaction(to: Address, id: UInt64, contractAddress: Address, contractName: String, nftTypeName: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n // NFTCollectionData struct to get paths from\n let collectionData: MetadataViews.NFTCollectionData\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n self.collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: self.collectionData.storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n\n // Get the string representation of the address without the 0x\n var addressString = contractAddress.toString()\n if addressString.length == 18 {\n addressString = addressString.slice(from: 2, upTo: 18)\n }\n let typeString: String = \"A.\".concat(addressString).concat(\".\").concat(contractName).concat(\".\").concat(nftTypeName)\n let type = CompositeType(typeString)\n assert(\n type != nil,\n message: \"Could not create a type out of the contract name and address!\"\n )\n\n assert(\n self.tempNFT.getType() == type!,\n message: \"The NFT that was withdrawn to transfer is not the type that was requested!\"\n )\n }\n\n execute {\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(self.collectionData.publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}","network_pins":[{"network":"emulator","pin_self":"a7109ef302ef379ff7e3fc70cf91d388d4132e5b5a56dd5637ea7b75c9eec6e7"},{"network":"mainnet","pin_self":"8fa4b378859b621c464d73e73b04676103c499fcaafc99e77c2c7c5ad58947b1"},{"network":"testnet","pin_self":"53616e614df69697976014be31d6800a9d42285af030125b62e9d152e90410f1"}]},"parameters":[{"label":"to","index":0,"type":"Address","messages":[]},{"label":"id","index":1,"type":"UInt64","messages":[]},{"label":"contractAddress","index":2,"type":"Address","messages":[]},{"label":"contractName","index":3,"type":"String","messages":[]},{"label":"nftTypeName","index":4,"type":"String","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281926,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280777,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281926,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280784,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Generic Transfer With Address And Type"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/generic_transfer_with_paths.template.json b/templates/flow-nft/generic_transfer_with_paths.template.json index 3cdea36..71297b3 100644 --- a/templates/flow-nft/generic_transfer_with_paths.template.json +++ b/templates/flow-nft/generic_transfer_with_paths.template.json @@ -1,150 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "bd5854cfdd3ed2e23d696ce68a22dc4b3de57d5b2ef73cb1436350811d910791", - "data": { - "type": "transaction", - "interface": "", - "messages": [ - { - "key": "title", - "i18n": [ - { - "tag": "en-US", - "translation": "Generic NFT Transfer with Paths" - } - ] - }, - { - "key": "description", - "i18n": [ - { - "tag": "en-US", - "translation": "Transfer any Non-Fungible Token by providing the paths for the source Collection and destination Collection" - } - ] - } - ], - "cadence": { - "body": "import \"NonFungibleToken\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Paths\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the paths for the source Collection and destination Collection\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any storage path and receiver path instead of just the default.\n/// This lets you choose the token you want to send as well the capability you want to send it to.\n///\n/// Any token path can be passed as an argument here, so wallets should\n/// should check argument values to make sure the intended token path is passed in\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of the token to transfer\n/// @param senderPathIdentifier: The string identifier of the storage path\n/// where the token should be withdrawn from\n/// @param receiverPathIdentifier: The string identifier of the public path\n/// where the token should be deposited to\n///\ntransaction(to: Address, id: UInt64, senderPathIdentifier: String, receiverPathIdentifier: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n let storagePath = StoragePath(identifier: senderPathIdentifier)\n ?? panic(\"Could not construct a storage path from the provided path identifier string\")\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n }\n\n execute {\n let publicPath = PublicPath(identifier: receiverPathIdentifier)\n ?? panic(\"Could not construct a public path from the provided path identifier string\")\n\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}", - "network_pins": [ - { - "network": "testnet", - "pin_self": "cf9cd9e7e9399935b88bcde1c7283605da74eec147f5d63256a4340d61b742ff" - }, - { - "network": "emulator", - "pin_self": "0597c2f82b9b96626fb73309fec873e7c5ae34564a5501da40237a4a2e4257b0" - }, - { - "network": "mainnet", - "pin_self": "6887607d32c1001210bffaa7fc985385e64b50d1c3da9df939429e884e47ba24" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158730, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083706, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "to", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "id", - "index": 1, - "type": "UInt64", - "messages": [] - }, - { - "label": "senderPathIdentifier", - "index": 2, - "type": "String", - "messages": [] - }, - { - "label": "receiverPathIdentifier", - "index": 3, - "type": "String", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"bd5854cfdd3ed2e23d696ce68a22dc4b3de57d5b2ef73cb1436350811d910791","data":{"type":"transaction","interface":"","cadence":{"body":"import \"NonFungibleToken\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic NFT Transfer with Paths\",\n\tdescription: \"Transfer any Non-Fungible Token by providing the paths for the source Collection and destination Collection\",\n\tlanguage: \"en-US\",\n)\n\n/// Can pass in any storage path and receiver path instead of just the default.\n/// This lets you choose the token you want to send as well the capability you want to send it to.\n///\n/// Any token path can be passed as an argument here, so wallets should\n/// should check argument values to make sure the intended token path is passed in\n///\n/// @param to: The address to transfer the token to\n/// @param id: The id of the token to transfer\n/// @param senderPathIdentifier: The string identifier of the storage path\n/// where the token should be withdrawn from\n/// @param receiverPathIdentifier: The string identifier of the public path\n/// where the token should be deposited to\n///\ntransaction(to: Address, id: UInt64, senderPathIdentifier: String, receiverPathIdentifier: String) {\n\n // The NFT resource to be transferred\n let tempNFT: @{NonFungibleToken.NFT}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n let storagePath = StoragePath(identifier: senderPathIdentifier)\n ?? panic(\"Could not construct a storage path from the provided path identifier string\")\n\n // borrow a reference to the signer's NFT collection\n let withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: storagePath\n ) ?? panic(\"Account does not store a collection object at the specified path\")\n\n self.tempNFT \u003c- withdrawRef.withdraw(withdrawID: id)\n }\n\n execute {\n let publicPath = PublicPath(identifier: receiverPathIdentifier)\n ?? panic(\"Could not construct a public path from the provided path identifier string\")\n\n // get the recipients public account object\n let recipient = getAccount(to)\n\n // borrow a public reference to the receivers collection\n let receiverRef = recipient.capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(publicPath)\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n // Deposit the NFT to the receiver\n receiverRef.deposit(token: \u003c-self.tempNFT)\n }\n}","network_pins":[{"network":"emulator","pin_self":"0597c2f82b9b96626fb73309fec873e7c5ae34564a5501da40237a4a2e4257b0"},{"network":"mainnet","pin_self":"6887607d32c1001210bffaa7fc985385e64b50d1c3da9df939429e884e47ba24"},{"network":"testnet","pin_self":"cf9cd9e7e9399935b88bcde1c7283605da74eec147f5d63256a4340d61b742ff"}]},"parameters":[{"label":"to","index":0,"type":"Address","messages":[]},{"label":"id","index":1,"type":"UInt64","messages":[]},{"label":"senderPathIdentifier","index":2,"type":"String","messages":[]},{"label":"receiverPathIdentifier","index":3,"type":"String","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281936,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280789,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Generic Transfer With Paths"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/mint_nft.template.json b/templates/flow-nft/mint_nft.template.json index 1e09e0f..6fa92f5 100644 --- a/templates/flow-nft/mint_nft.template.json +++ b/templates/flow-nft/mint_nft.template.json @@ -1,447 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "6bab29b375d2bf7f880c5f1aa9e0fce7de9f0e892ae2a86a023511bac0158dab", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This script uses the NFTMinter resource to mint a new NFT\n/// It must be run with the account that has the minter resource\n/// stored in /storage/NFTMinter\n///\n/// The royalty arguments indicies must be aligned\n\nimport \"NonFungibleToken\"\nimport \"ExampleNFT\"\nimport \"MetadataViews\"\nimport \"FungibleToken\"\n\ntransaction(\n recipient: Address,\n name: String,\n description: String,\n thumbnail: String,\n cuts: [UFix64],\n royaltyDescriptions: [String],\n royaltyBeneficiaries: [Address]\n) {\n\n /// local variable for storing the minter reference\n let minter: \u0026ExampleNFT.NFTMinter\n\n /// Reference to the receiver's collection\n let recipientCollectionRef: \u0026{NonFungibleToken.Receiver}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n \n // borrow a reference to the NFTMinter resource in storage\n self.minter = signer.storage.borrow\u003c\u0026ExampleNFT.NFTMinter\u003e(from: ExampleNFT.MinterStoragePath)\n ?? panic(\"Account does not store an object at the specified path\")\n\n // Borrow the recipient's public NFT collection reference\n self.recipientCollectionRef = getAccount(recipient).capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(\n collectionData.publicPath\n ) ?? panic(\"Could not get receiver reference to the NFT Collection\")\n }\n\n pre {\n cuts.length == royaltyDescriptions.length \u0026\u0026 cuts.length == royaltyBeneficiaries.length: \"Array length should be equal for royalty related details\"\n }\n\n execute {\n\n // Create the royalty details\n var count = 0\n var royalties: [MetadataViews.Royalty] = []\n while royaltyBeneficiaries.length \u003e count {\n let beneficiary = royaltyBeneficiaries[count]\n let beneficiaryCapability = getAccount(beneficiary).capabilities.get\u003c\u0026{FungibleToken.Receiver}\u003e(\n MetadataViews.getRoyaltyReceiverPublicPath()\n )\n\n if !beneficiaryCapability.check() {\n panic(\"Beneficiary does not have Receiver configured at RoyaltyReceiverPublicPath\")\n }\n\n royalties.append(\n MetadataViews.Royalty(\n receiver: beneficiaryCapability,\n cut: cuts[count],\n description: royaltyDescriptions[count]\n )\n )\n count = count + 1\n }\n\n\n // Mint the NFT and deposit it to the recipient's collection\n let mintedNFT \u003c- self.minter.mintNFT(\n name: name,\n description: description,\n thumbnail: thumbnail,\n royalties: royalties\n )\n self.recipientCollectionRef.deposit(token: \u003c-mintedNFT)\n }\n\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "ddcfc8acd1a81baa0768bb3d47ad2866a8a2d8df4af9b6564b14e5cdb657bedb" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158730, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083710, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "ExampleNFT", - "networks": [ - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ExampleNFT", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158730, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083715, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "FungibleToken", - "networks": [ - { - "network": "emulator", - "address": "0xee82856bf20e2aa6", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "mainnet", - "address": "0xf233dcee88fe0abe", - "dependency_pin_block_height": 86158730, - "dependency_pin": { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x9a0766d93b6608b7", - "dependency_pin_block_height": 215083718, - "dependency_pin": { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000002", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "recipient", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "name", - "index": 1, - "type": "String", - "messages": [] - }, - { - "label": "description", - "index": 2, - "type": "String", - "messages": [] - }, - { - "label": "thumbnail", - "index": 3, - "type": "String", - "messages": [] - }, - { - "label": "cuts", - "index": 4, - "type": "[UFix64]", - "messages": [] - }, - { - "label": "royaltyDescriptions", - "index": 5, - "type": "[String]", - "messages": [] - }, - { - "label": "royaltyBeneficiaries", - "index": 6, - "type": "[Address]", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"39158f94ae51b61e798943be407b61558fe095fb21c38ceee0b20d356160f786","data":{"type":"transaction","interface":"","cadence":{"body":"/// This script uses the NFTMinter resource to mint a new NFT\n/// It must be run with the account that has the minter resource\n/// stored in /storage/NFTMinter\n///\n/// The royalty arguments indicies must be aligned\n\nimport \"NonFungibleToken\"\nimport \"ExampleNFT\"\nimport \"MetadataViews\"\nimport \"FungibleToken\"\n\ntransaction(\n recipient: Address,\n name: String,\n description: String,\n thumbnail: String,\n cuts: [UFix64],\n royaltyDescriptions: [String],\n royaltyBeneficiaries: [Address]\n) {\n\n /// local variable for storing the minter reference\n let minter: \u0026ExampleNFT.NFTMinter\n\n /// Reference to the receiver's collection\n let recipientCollectionRef: \u0026{NonFungibleToken.Receiver}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n \n // borrow a reference to the NFTMinter resource in storage\n self.minter = signer.storage.borrow\u003c\u0026ExampleNFT.NFTMinter\u003e(from: ExampleNFT.MinterStoragePath)\n ?? panic(\"Account does not store an object at the specified path\")\n\n // Borrow the recipient's public NFT collection reference\n self.recipientCollectionRef = getAccount(recipient).capabilities.borrow\u003c\u0026{NonFungibleToken.Receiver}\u003e(\n collectionData.publicPath\n ) ?? panic(\"Could not get receiver reference to the NFT Collection\")\n }\n\n pre {\n cuts.length == royaltyDescriptions.length \u0026\u0026 cuts.length == royaltyBeneficiaries.length: \"Array length should be equal for royalty related details\"\n }\n\n execute {\n\n // Create the royalty details\n var count = 0\n var royalties: [MetadataViews.Royalty] = []\n while royaltyBeneficiaries.length \u003e count {\n let beneficiary = royaltyBeneficiaries[count]\n let beneficiaryCapability = getAccount(beneficiary).capabilities.get\u003c\u0026{FungibleToken.Receiver}\u003e(\n MetadataViews.getRoyaltyReceiverPublicPath()\n )\n\n if !beneficiaryCapability.check() {\n panic(\"Beneficiary does not have Receiver configured at RoyaltyReceiverPublicPath\")\n }\n\n royalties.append(\n MetadataViews.Royalty(\n receiver: beneficiaryCapability,\n cut: cuts[count],\n description: royaltyDescriptions[count]\n )\n )\n count = count + 1\n }\n\n\n // Mint the NFT and deposit it to the recipient's collection\n let mintedNFT \u003c- self.minter.mintNFT(\n name: name,\n description: description,\n thumbnail: thumbnail,\n royalties: royalties\n )\n self.recipientCollectionRef.deposit(token: \u003c-mintedNFT)\n }\n\n}\n","network_pins":[{"network":"emulator","pin_self":"ddcfc8acd1a81baa0768bb3d47ad2866a8a2d8df4af9b6564b14e5cdb657bedb"}]},"parameters":[{"label":"recipient","index":0,"type":"Address","messages":[]},{"label":"name","index":1,"type":"String","messages":[]},{"label":"description","index":2,"type":"String","messages":[]},{"label":"thumbnail","index":3,"type":"String","messages":[]},{"label":"cuts","index":4,"type":"[UFix64]","messages":[]},{"label":"royaltyDescriptions","index":5,"type":"[String]","messages":[]},{"label":"royaltyBeneficiaries","index":6,"type":"[Address]","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281936,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280794,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"ExampleNFT","networks":[{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e","pin_self":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","pin_contract_name":"ExampleNFT","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281936,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280801,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"FungibleToken","networks":[{"network":"mainnet","address":"0xf233dcee88fe0abe","dependency_pin_block_height":86281947,"dependency_pin":{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]}},{"network":"testnet","address":"0x9a0766d93b6608b7","dependency_pin_block_height":215280806,"dependency_pin":{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]}},{"network":"emulator","address":"0xee82856bf20e2aa6","dependency_pin_block_height":0,"dependency_pin":{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000002","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Mint Nft"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/setup_account.template.json b/templates/flow-nft/setup_account.template.json index 4cb46d1..e5b80b0 100644 --- a/templates/flow-nft/setup_account.template.json +++ b/templates/flow-nft/setup_account.template.json @@ -1,309 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "2e98df423cdb968e8bb1896f6e5b225f3c83752ab0cdc7a73125950a2ce462ac", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction is what an account would run\n/// to set itself up to receive NFTs\n\nimport \"NonFungibleToken\"\nimport \"ExampleNFT\"\nimport \"MetadataViews\"\n\ntransaction {\n\n prepare(signer: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, SaveValue, UnpublishCapability) \u0026Account) {\n \n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n\n // Return early if the account already has a collection\n if signer.storage.borrow\u003c\u0026ExampleNFT.Collection\u003e(from: collectionData.storagePath) != nil {\n return\n }\n\n // Create a new empty collection\n let collection \u003c- ExampleNFT.createEmptyCollection(nftType: Type\u003c@ExampleNFT.NFT\u003e())\n\n // save it to the account\n signer.storage.save(\u003c-collection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n signer.capabilities.unpublish(collectionData.publicPath)\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026ExampleNFT.Collection\u003e(collectionData.storagePath)\n signer.capabilities.publish(collectionCap, at: collectionData.publicPath)\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "16fe35d95e73c5fa5fb7bcb7d493f3febe9b411404aa22a240cc1a46478279d5" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158739, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083722, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "ExampleNFT", - "networks": [ - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ExampleNFT", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158742, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083726, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": null - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"e4bba502621c24c2b206f5969ebef01b9479e924253f61570ca7c9e6bb4d15f8","data":{"type":"transaction","interface":"","cadence":{"body":"/// This transaction is what an account would run\n/// to set itself up to receive NFTs\n\nimport \"NonFungibleToken\"\nimport \"ExampleNFT\"\nimport \"MetadataViews\"\n\ntransaction {\n\n prepare(signer: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, SaveValue, UnpublishCapability) \u0026Account) {\n \n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n\n // Return early if the account already has a collection\n if signer.storage.borrow\u003c\u0026ExampleNFT.Collection\u003e(from: collectionData.storagePath) != nil {\n return\n }\n\n // Create a new empty collection\n let collection \u003c- ExampleNFT.createEmptyCollection(nftType: Type\u003c@ExampleNFT.NFT\u003e())\n\n // save it to the account\n signer.storage.save(\u003c-collection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n signer.capabilities.unpublish(collectionData.publicPath)\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026ExampleNFT.Collection\u003e(collectionData.storagePath)\n signer.capabilities.publish(collectionCap, at: collectionData.publicPath)\n }\n}\n","network_pins":[{"network":"emulator","pin_self":"16fe35d95e73c5fa5fb7bcb7d493f3febe9b411404aa22a240cc1a46478279d5"}]},"parameters":null,"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281947,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280808,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"ExampleNFT","networks":[{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e","pin_self":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","pin_contract_name":"ExampleNFT","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281947,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280817,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Setup Account"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/setup_account_from_address.template.json b/templates/flow-nft/setup_account_from_address.template.json index a81a97d..d62a8be 100644 --- a/templates/flow-nft/setup_account_from_address.template.json +++ b/templates/flow-nft/setup_account_from_address.template.json @@ -1,323 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "4694b33edca8cbfb50f6c35f76b9c9ebd0010ed79174a7970f5f9766654395d7", - "data": { - "type": "transaction", - "interface": "", - "messages": [ - { - "key": "title", - "i18n": [ - { - "tag": "en-US", - "translation": "Generic FT Transfer with Contract Address and Name" - } - ] - }, - { - "key": "description", - "i18n": [ - { - "tag": "en-US", - "translation": "Transfer any Fungible Token by providing the contract address and name" - } - ] - } - ], - "cadence": { - "body": "import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic FT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Fungible Token by providing the contract address and name\",\n\tlanguage: \"en-US\",\n)\n\n/// This transaction is what an account would run\n/// to set itself up to receive NFTs. This function\n/// uses views to know where to set up the collection\n/// in storage and to create the empty collection.\n///\n/// @param contractAddress: The address of the contract that defines the token being initialized\n/// @param contractName: The name of the contract that defines the token being initialized. Ex: \"ExampleNFT\"\n\ntransaction(contractAddress: Address, contractName: String) {\n\n prepare(signer: auth(IssueStorageCapabilityController, PublishCapability, SaveValue) \u0026Account) {\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n let collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n // Create a new empty collections\n let emptyCollection \u003c- collectionData.createEmptyCollection()\n\n // save it to the account\n signer.storage.save(\u003c-emptyCollection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026{NonFungibleToken.Collection}\u003e(\n collectionData.storagePath\n )\n signer.capabilities.publish(collectionCap, at: collectionData.publicPath)\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "3c3b146a0b5ce1840197196e5ef1e627e144c9c4d335a904d7b87a55efa5bfff" - }, - { - "network": "mainnet", - "pin_self": "aaa726ed91487179c606f18ebcd6611b23f7e8e97318ed5088df484fc76ee4c4" - }, - { - "network": "testnet", - "pin_self": "a0744b4b74d20c6047fb619e68c0e53a9def9f643da1106e8caa5434297d1953" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158746, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083730, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083732, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158746, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "contractAddress", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "contractName", - "index": 1, - "type": "String", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"96b9ae54c6bcceff658d28230e3dd30d18bf1097d725e469c317da695ac06403","data":{"type":"transaction","interface":"","cadence":{"body":"import \"NonFungibleToken\"\nimport \"MetadataViews\"\n\n#interaction (\n version: \"1.0.0\",\n\ttitle: \"Generic FT Transfer with Contract Address and Name\",\n\tdescription: \"Transfer any Fungible Token by providing the contract address and name\",\n\tlanguage: \"en-US\",\n)\n\n/// This transaction is what an account would run\n/// to set itself up to receive NFTs. This function\n/// uses views to know where to set up the collection\n/// in storage and to create the empty collection.\n///\n/// @param contractAddress: The address of the contract that defines the token being initialized\n/// @param contractName: The name of the contract that defines the token being initialized. Ex: \"ExampleNFT\"\n\ntransaction(contractAddress: Address, contractName: String) {\n\n prepare(signer: auth(IssueStorageCapabilityController, PublishCapability, SaveValue) \u0026Account) {\n // Borrow a reference to the nft contract deployed to the passed account\n let resolverRef = getAccount(contractAddress)\n .contracts.borrow\u003c\u0026{NonFungibleToken}\u003e(name: contractName)\n ?? panic(\"Could not borrow a reference to the non-fungible token contract\")\n\n // Use that reference to retrieve the NFTCollectionData view \n let collectionData = resolverRef.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"Could not resolve the NFTCollectionData view for the given non-fungible token contract\")\n\n // Create a new empty collections\n let emptyCollection \u003c- collectionData.createEmptyCollection()\n\n // save it to the account\n signer.storage.save(\u003c-emptyCollection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026{NonFungibleToken.Collection}\u003e(\n collectionData.storagePath\n )\n signer.capabilities.publish(collectionCap, at: collectionData.publicPath)\n }\n}\n","network_pins":[{"network":"testnet","pin_self":"a0744b4b74d20c6047fb619e68c0e53a9def9f643da1106e8caa5434297d1953"},{"network":"emulator","pin_self":"3c3b146a0b5ce1840197196e5ef1e627e144c9c4d335a904d7b87a55efa5bfff"},{"network":"mainnet","pin_self":"aaa726ed91487179c606f18ebcd6611b23f7e8e97318ed5088df484fc76ee4c4"}]},"parameters":[{"label":"contractAddress","index":0,"type":"Address","messages":[]},{"label":"contractName","index":1,"type":"String","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281953,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280822,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281953,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280829,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Setup Account From Address"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/setup_account_from_nft_reference.template.json b/templates/flow-nft/setup_account_from_nft_reference.template.json index dd6cb5b..e9319c6 100644 --- a/templates/flow-nft/setup_account_from_nft_reference.template.json +++ b/templates/flow-nft/setup_account_from_nft_reference.template.json @@ -1,310 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "788a674780924f7f1b6311669f0ee2f536bef67cb6b83c86c3059776614d8f06", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction is what an account would run\n/// to set itself up to receive NFTs. This function\n/// uses views to know where to set up the collection\n/// in storage and to create the empty collection.\n\nimport \"NonFungibleToken\"\nimport \"MetadataViews\"\n\ntransaction(address: Address, publicPath: PublicPath, id: UInt64) {\n\n prepare(signer: auth(IssueStorageCapabilityController, PublishCapability, SaveValue) \u0026Account) {\n let collection = getAccount(address).capabilities.borrow\u003c\u0026{NonFungibleToken.Collection}\u003e(publicPath)\n ?? panic(\"Could not borrow a reference to the collection\")\n\n let nftRef = collection.borrowNFT(id)\n ?? panic(\"Could not borrow a reference to the desired NFT\")\n \n let collectionData = nftRef.resolveView(Type\u003cMetadataViews.NFTCollectionData\u003e())! as! MetadataViews.NFTCollectionData\n\n // Create a new empty collections\n let emptyCollection \u003c- collectionData.createEmptyCollection()\n\n // save it to the account\n signer.storage.save(\u003c-emptyCollection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026{NonFungibleToken.Collection}\u003e(\n collectionData.storagePath\n )\n signer.capabilities.publish(collectionCap, at: publicPath)\n }\n}\n", - "network_pins": [ - { - "network": "testnet", - "pin_self": "3a839f9c04d090718b38b272dcc2045d23e7df80151fc764afe1f7fdb6debf0e" - }, - { - "network": "emulator", - "pin_self": "d7d731b7cac06b9b5efab06675c488ff4bd3cba8ee134a84df62bebc45c75ea5" - }, - { - "network": "mainnet", - "pin_self": "1d7cd01fe1c7684f4d4974bcb0d8df6577bceeb572720418c54382210f87ae40" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158750, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083741, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158750, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083744, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "address", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "publicPath", - "index": 1, - "type": "PublicPath", - "messages": [] - }, - { - "label": "id", - "index": 2, - "type": "UInt64", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"788a674780924f7f1b6311669f0ee2f536bef67cb6b83c86c3059776614d8f06","data":{"type":"transaction","interface":"","cadence":{"body":"/// This transaction is what an account would run\n/// to set itself up to receive NFTs. This function\n/// uses views to know where to set up the collection\n/// in storage and to create the empty collection.\n\nimport \"NonFungibleToken\"\nimport \"MetadataViews\"\n\ntransaction(address: Address, publicPath: PublicPath, id: UInt64) {\n\n prepare(signer: auth(IssueStorageCapabilityController, PublishCapability, SaveValue) \u0026Account) {\n let collection = getAccount(address).capabilities.borrow\u003c\u0026{NonFungibleToken.Collection}\u003e(publicPath)\n ?? panic(\"Could not borrow a reference to the collection\")\n\n let nftRef = collection.borrowNFT(id)\n ?? panic(\"Could not borrow a reference to the desired NFT\")\n \n let collectionData = nftRef.resolveView(Type\u003cMetadataViews.NFTCollectionData\u003e())! as! MetadataViews.NFTCollectionData\n\n // Create a new empty collections\n let emptyCollection \u003c- collectionData.createEmptyCollection()\n\n // save it to the account\n signer.storage.save(\u003c-emptyCollection, to: collectionData.storagePath)\n\n // create a public capability for the collection\n let collectionCap = signer.capabilities.storage.issue\u003c\u0026{NonFungibleToken.Collection}\u003e(\n collectionData.storagePath\n )\n signer.capabilities.publish(collectionCap, at: publicPath)\n }\n}\n","network_pins":[{"network":"testnet","pin_self":"3a839f9c04d090718b38b272dcc2045d23e7df80151fc764afe1f7fdb6debf0e"},{"network":"emulator","pin_self":"d7d731b7cac06b9b5efab06675c488ff4bd3cba8ee134a84df62bebc45c75ea5"},{"network":"mainnet","pin_self":"1d7cd01fe1c7684f4d4974bcb0d8df6577bceeb572720418c54382210f87ae40"}]},"parameters":[{"label":"address","index":0,"type":"Address","messages":[]},{"label":"publicPath","index":1,"type":"PublicPath","messages":[]},{"label":"id","index":2,"type":"UInt64","messages":[]}],"dependencies":[{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281965,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280834,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281968,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280840,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Setup Account From Nft Reference"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/setup_account_to_receive_royalty.template.json b/templates/flow-nft/setup_account_to_receive_royalty.template.json index 93ff68f..e2d4944 100644 --- a/templates/flow-nft/setup_account_to_receive_royalty.template.json +++ b/templates/flow-nft/setup_account_to_receive_royalty.template.json @@ -1,319 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "c05a831769db3cd271813c99db18363b5ce0f55b0203b694574d5d8aa37664f5", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction is a template for a transaction\n/// to create a new link in their account to be used for receiving royalties\n/// This transaction can be used for any fungible token, which is specified by the `vaultPath` argument\n///\n/// If the account wants to receive royalties in FLOW, they'll use `/storage/flowTokenVault`\n/// If they want to receive it in USDC, they would use FiatToken.VaultStoragePath\n/// and so on.\n/// The path used for the public link is a new path that in the future, is expected to receive\n/// and generic token, which could be forwarded to the appropriate vault\n\nimport \"FungibleToken\"\nimport \"MetadataViews\"\n\ntransaction(vaultPath: StoragePath) {\n\n prepare(signer: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, UnpublishCapability) \u0026Account) {\n\n // Return early if the account doesn't have a FungibleToken Vault\n if signer.storage.borrow\u003c\u0026{FungibleToken.Vault}\u003e(from: vaultPath) == nil {\n panic(\"A vault for the specified fungible token path does not exist\")\n }\n\n if signer.storage.type(at: vaultPath) == nil {\n panic(\"A vault for the specified fungible token path does not exist\")\n }\n\n // Create a public capability to the Vault that only exposes\n // the deposit function through the Receiver interface\n signer.capabilities.unpublish(MetadataViews.getRoyaltyReceiverPublicPath())\n let vaultCap = signer.capabilities.storage.issue\u003c\u0026{FungibleToken.Receiver}\u003e(vaultPath)\n signer.capabilities.publish(vaultCap, at: MetadataViews.getRoyaltyReceiverPublicPath())\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "cb290f923041e2c0a3663acf63d3a5c4d0a028841b3ffb75c28f2e12238b9652" - }, - { - "network": "mainnet", - "pin_self": "e1de21d8455ffc8c4a0b9f027ec4b95a375efddf12a3761f5bc9ef3d8571fb30" - }, - { - "network": "testnet", - "pin_self": "047282b865d8efa12fc3c65497a0d73dbb706a621d8498d99c3c89261540683e" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "FungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0xf233dcee88fe0abe", - "dependency_pin_block_height": 86158756, - "dependency_pin": { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x9a0766d93b6608b7", - "dependency_pin_block_height": 215083749, - "dependency_pin": { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xee82856bf20e2aa6", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000002", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158756, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083755, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "vaultPath", - "index": 0, - "type": "StoragePath", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"c05a831769db3cd271813c99db18363b5ce0f55b0203b694574d5d8aa37664f5","data":{"type":"transaction","interface":"","cadence":{"body":"/// This transaction is a template for a transaction\n/// to create a new link in their account to be used for receiving royalties\n/// This transaction can be used for any fungible token, which is specified by the `vaultPath` argument\n///\n/// If the account wants to receive royalties in FLOW, they'll use `/storage/flowTokenVault`\n/// If they want to receive it in USDC, they would use FiatToken.VaultStoragePath\n/// and so on.\n/// The path used for the public link is a new path that in the future, is expected to receive\n/// and generic token, which could be forwarded to the appropriate vault\n\nimport \"FungibleToken\"\nimport \"MetadataViews\"\n\ntransaction(vaultPath: StoragePath) {\n\n prepare(signer: auth(BorrowValue, IssueStorageCapabilityController, PublishCapability, UnpublishCapability) \u0026Account) {\n\n // Return early if the account doesn't have a FungibleToken Vault\n if signer.storage.borrow\u003c\u0026{FungibleToken.Vault}\u003e(from: vaultPath) == nil {\n panic(\"A vault for the specified fungible token path does not exist\")\n }\n\n if signer.storage.type(at: vaultPath) == nil {\n panic(\"A vault for the specified fungible token path does not exist\")\n }\n\n // Create a public capability to the Vault that only exposes\n // the deposit function through the Receiver interface\n signer.capabilities.unpublish(MetadataViews.getRoyaltyReceiverPublicPath())\n let vaultCap = signer.capabilities.storage.issue\u003c\u0026{FungibleToken.Receiver}\u003e(vaultPath)\n signer.capabilities.publish(vaultCap, at: MetadataViews.getRoyaltyReceiverPublicPath())\n }\n}\n","network_pins":[{"network":"testnet","pin_self":"047282b865d8efa12fc3c65497a0d73dbb706a621d8498d99c3c89261540683e"},{"network":"emulator","pin_self":"cb290f923041e2c0a3663acf63d3a5c4d0a028841b3ffb75c28f2e12238b9652"},{"network":"mainnet","pin_self":"e1de21d8455ffc8c4a0b9f027ec4b95a375efddf12a3761f5bc9ef3d8571fb30"}]},"parameters":[{"label":"vaultPath","index":0,"type":"StoragePath","messages":[]}],"dependencies":[{"contracts":[{"contract":"FungibleToken","networks":[{"network":"mainnet","address":"0xf233dcee88fe0abe","dependency_pin_block_height":86281973,"dependency_pin":{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]}},{"network":"testnet","address":"0x9a0766d93b6608b7","dependency_pin_block_height":215280849,"dependency_pin":{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]}},{"network":"emulator","address":"0xee82856bf20e2aa6","dependency_pin_block_height":0,"dependency_pin":{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000002","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281975,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280854,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Setup Account To Receive Royalty"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/transfer_nft.template.json b/templates/flow-nft/transfer_nft.template.json index 427e36b..151a56e 100644 --- a/templates/flow-nft/transfer_nft.template.json +++ b/templates/flow-nft/transfer_nft.template.json @@ -1,366 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "9c0ae963c776f16010dbc479d61ed69ca7d6b4d61cc5c757712003b5c8e5f1a6", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction is for transferring an ExampleNFT from one account to another\n\nimport \"ViewResolver\"\nimport \"MetadataViews\"\nimport \"NonFungibleToken\"\n\ntransaction(contractAddress: Address, contractName: String, recipient: Address, withdrawID: UInt64) {\n\n /// Reference to the withdrawer's collection\n let withdrawRef: auth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\n\n /// Reference of the collection to deposit the NFT to\n let receiverRef: \u0026{NonFungibleToken.Receiver}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // borrow the NFT contract as ViewResolver reference\n let viewResolver = getAccount(contractAddress).contracts.borrow\u003c\u0026{ViewResolver}\u003e(name: contractName)\n ?? panic(\"Could not borrow ViewResolver of given name from address\")\n\n // resolve the NFT collection data from the NFT contract\n let collectionData = viewResolver.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n\n // borrow a reference to the signer's NFT collection\n self.withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: collectionData.storagePath\n ) ?? panic(\"Account does not store an object at the specified path\")\n\n // get the recipients public account object\n let recipient = getAccount(recipient)\n\n // borrow a public reference to the receivers collection\n let receiverCap = recipient.capabilities.get\u003c\u0026{NonFungibleToken.Receiver}\u003e(collectionData.publicPath)\n\n self.receiverRef = receiverCap.borrow()\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n }\n\n execute {\n\n let nft \u003c- self.withdrawRef.withdraw(withdrawID: withdrawID)\n self.receiverRef.deposit(token: \u003c-nft)\n\n }\n\n post {\n !self.withdrawRef.getIDs().contains(withdrawID): \"Original owner should not have the NFT anymore\"\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "0c21a27361b265148f21daccaf93e96855be533b86218ebffe9631b74f4e99f9" - }, - { - "network": "mainnet", - "pin_self": "8825fa0ffaa8aaa8fa4596d8beed50ae02983d5c0ba724db10e87ea69f928cd5" - }, - { - "network": "testnet", - "pin_self": "b156c30e23ca82601e54376b796ac1a3af104064049fe4ebce9448ac0fd0181b" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "ViewResolver", - "networks": [ - { - "network": "testnet", - "address": "0x294e44e1ec6993c6", - "dependency_pin_block_height": 215083758, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x294e44e1ec6993c6", - "imports": [] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - }, - { - "network": "mainnet", - "address": "0xd8a7e05a7ac670c0", - "dependency_pin_block_height": 86158760, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xd8a7e05a7ac670c0", - "imports": [] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158760, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083765, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "NonFungibleToken", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158760, - "dependency_pin": { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083769, - "dependency_pin": { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": [ - { - "label": "contractAddress", - "index": 0, - "type": "Address", - "messages": [] - }, - { - "label": "contractName", - "index": 1, - "type": "String", - "messages": [] - }, - { - "label": "recipient", - "index": 2, - "type": "Address", - "messages": [] - }, - { - "label": "withdrawID", - "index": 3, - "type": "UInt64", - "messages": [] - } - ] - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"35a7daaa42d0ed630613ea1b4c89a3333a1eb4d99e6a304023881e4bcc61b3a7","data":{"type":"transaction","interface":"","cadence":{"body":"/// This transaction is for transferring an ExampleNFT from one account to another\n\nimport \"ViewResolver\"\nimport \"MetadataViews\"\nimport \"NonFungibleToken\"\n\ntransaction(contractAddress: Address, contractName: String, recipient: Address, withdrawID: UInt64) {\n\n /// Reference to the withdrawer's collection\n let withdrawRef: auth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\n\n /// Reference of the collection to deposit the NFT to\n let receiverRef: \u0026{NonFungibleToken.Receiver}\n\n prepare(signer: auth(BorrowValue) \u0026Account) {\n\n // borrow the NFT contract as ViewResolver reference\n let viewResolver = getAccount(contractAddress).contracts.borrow\u003c\u0026{ViewResolver}\u003e(name: contractName)\n ?? panic(\"Could not borrow ViewResolver of given name from address\")\n\n // resolve the NFT collection data from the NFT contract\n let collectionData = viewResolver.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n\n // borrow a reference to the signer's NFT collection\n self.withdrawRef = signer.storage.borrow\u003cauth(NonFungibleToken.Withdraw) \u0026{NonFungibleToken.Collection}\u003e(\n from: collectionData.storagePath\n ) ?? panic(\"Account does not store an object at the specified path\")\n\n // get the recipients public account object\n let recipient = getAccount(recipient)\n\n // borrow a public reference to the receivers collection\n let receiverCap = recipient.capabilities.get\u003c\u0026{NonFungibleToken.Receiver}\u003e(collectionData.publicPath)\n\n self.receiverRef = receiverCap.borrow()\n ?? panic(\"Could not borrow reference to the recipient's receiver\")\n\n }\n\n execute {\n\n let nft \u003c- self.withdrawRef.withdraw(withdrawID: withdrawID)\n self.receiverRef.deposit(token: \u003c-nft)\n\n }\n\n post {\n !self.withdrawRef.getIDs().contains(withdrawID): \"Original owner should not have the NFT anymore\"\n }\n}\n","network_pins":[{"network":"mainnet","pin_self":"8825fa0ffaa8aaa8fa4596d8beed50ae02983d5c0ba724db10e87ea69f928cd5"},{"network":"testnet","pin_self":"b156c30e23ca82601e54376b796ac1a3af104064049fe4ebce9448ac0fd0181b"},{"network":"emulator","pin_self":"0c21a27361b265148f21daccaf93e96855be533b86218ebffe9631b74f4e99f9"}]},"parameters":[{"label":"contractAddress","index":0,"type":"Address","messages":[]},{"label":"contractName","index":1,"type":"String","messages":[]},{"label":"recipient","index":2,"type":"Address","messages":[]},{"label":"withdrawID","index":3,"type":"UInt64","messages":[]}],"dependencies":[{"contracts":[{"contract":"ViewResolver","networks":[{"network":"mainnet","address":"0xd8a7e05a7ac670c0","dependency_pin_block_height":86281975,"dependency_pin":{"pin":"42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e","pin_self":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","pin_contract_name":"ViewResolver","pin_contract_address":"0xd8a7e05a7ac670c0","imports":[]}},{"network":"testnet","address":"0x294e44e1ec6993c6","dependency_pin_block_height":215280858,"dependency_pin":{"pin":"42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e","pin_self":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","pin_contract_name":"ViewResolver","pin_contract_address":"0x294e44e1ec6993c6","imports":[]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281975,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280864,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"NonFungibleToken","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281987,"dependency_pin":{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280870,"dependency_pin":{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Transfer Nft"}]}]} \ No newline at end of file diff --git a/templates/flow-nft/unlink_collection.template.json b/templates/flow-nft/unlink_collection.template.json index 2e77183..2ffd36d 100644 --- a/templates/flow-nft/unlink_collection.template.json +++ b/templates/flow-nft/unlink_collection.template.json @@ -1,235 +1 @@ - -{ - "f_type": "InteractionTemplate", - "f_version": "1.1.0", - "id": "64f259c44d36871560a21fc165021f0ca604bad250f8d6646d2f6bf73c471ccb", - "data": { - "type": "transaction", - "interface": "", - "messages": null, - "cadence": { - "body": "/// This transaction unlinks signer's public Capability at canonical public path\n\nimport \"MetadataViews\"\nimport \"ExampleNFT\"\n\ntransaction {\n prepare(signer: auth(UnpublishCapabilty) \u0026Account) {\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n signer.capabilities.unpublish(ExampleNFT.CollectionPublicPath)\n }\n}\n", - "network_pins": [ - { - "network": "emulator", - "pin_self": "5371604a2402d14d2e9ddc2adf75c6c83115e0d95ed32cd730ee78e28d3d78ee" - } - ] - }, - "dependencies": [ - { - "contracts": [ - { - "contract": "MetadataViews", - "networks": [ - { - "network": "mainnet", - "address": "0x1d7e57aa55817448", - "dependency_pin_block_height": 86158760, - "dependency_pin": { - "pin": "b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887", - "pin_self": "856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602", - "pin_self": "b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf233dcee88fe0abe", - "imports": [] - } - ] - }, - { - "pin": "ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1", - "pin_self": "e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x1d7e57aa55817448", - "imports": [] - } - ] - } - }, - { - "network": "testnet", - "address": "0x631e88ae7f1d7c20", - "dependency_pin_block_height": 215083772, - "dependency_pin": { - "pin": "04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957", - "pin_self": "60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef", - "pin_self": "1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0x9a0766d93b6608b7", - "imports": [] - } - ] - }, - { - "pin": "b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f", - "pin_self": "8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0x631e88ae7f1d7c20", - "imports": [] - } - ] - } - }, - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8", - "pin_self": "9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494", - "pin_contract_name": "MetadataViews", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2", - "pin_self": "d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f", - "pin_contract_name": "FungibleToken", - "pin_contract_address": "0xee82856bf20e2aa6", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - }, - { - "pin": "fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8", - "pin_self": "b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7", - "pin_contract_name": "Burner", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6", - "pin_self": "1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817", - "pin_contract_name": "NonFungibleToken", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [ - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - }, - { - "pin": "79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d", - "pin_self": "de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56", - "pin_contract_name": "ViewResolver", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - ] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - }, - { - "contracts": [ - { - "contract": "ExampleNFT", - "networks": [ - { - "network": "emulator", - "address": "0xf8d6e0586b0a20c7", - "dependency_pin_block_height": 0, - "dependency_pin": { - "pin": "42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e", - "pin_self": "a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a", - "pin_contract_name": "ExampleNFT", - "pin_contract_address": "0xf8d6e0586b0a20c7", - "imports": [] - } - }, - { - "network": "testing", - "address": "0000000000000007", - "dependency_pin_block_height": 0 - } - ] - } - ] - } - ], - "parameters": null - } -} - +{"f_type":"InteractionTemplate","f_version":"1.1.0","id":"64f259c44d36871560a21fc165021f0ca604bad250f8d6646d2f6bf73c471ccb","data":{"type":"transaction","interface":"","cadence":{"body":"/// This transaction unlinks signer's public Capability at canonical public path\n\nimport \"MetadataViews\"\nimport \"ExampleNFT\"\n\ntransaction {\n prepare(signer: auth(UnpublishCapabilty) \u0026Account) {\n let collectionData = ExampleNFT.resolveContractView(resourceType: nil, viewType: Type\u003cMetadataViews.NFTCollectionData\u003e()) as! MetadataViews.NFTCollectionData?\n ?? panic(\"ViewResolver does not resolve NFTCollectionData view\")\n signer.capabilities.unpublish(ExampleNFT.CollectionPublicPath)\n }\n}\n","network_pins":[{"network":"emulator","pin_self":"5371604a2402d14d2e9ddc2adf75c6c83115e0d95ed32cd730ee78e28d3d78ee"}]},"parameters":null,"dependencies":[{"contracts":[{"contract":"MetadataViews","networks":[{"network":"mainnet","address":"0x1d7e57aa55817448","dependency_pin_block_height":86281987,"dependency_pin":{"pin":"b599e3674f87f4441871ed72e1e4341651790b60e05d4dcffff7105be7705887","pin_self":"856ef3bb1b374cda7cfc0731f9976fa69fccdc41e15b8d94cbdb72bc09628272","pin_contract_name":"MetadataViews","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"2ebe6fb33e21006b9bc37275534d199a3768639c0cd531a233d81576dfcb2602","pin_self":"b913af1e763599b37d54e6e439dd4b435b61c9c1d9fee3628427099f05d4d3f0","pin_contract_name":"FungibleToken","pin_contract_address":"0xf233dcee88fe0abe","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf233dcee88fe0abe","imports":[]}]},{"pin":"ab297380ce176ffbd8976e7805ebf180dcd8a65933c5607680941d565ff2ecf1","pin_self":"e087a979d2220b9ff33a82751416bb9d2f9051a1aa2cc7383c00f37073c44006","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x1d7e57aa55817448","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x1d7e57aa55817448","imports":[]}]}},{"network":"testnet","address":"0x631e88ae7f1d7c20","dependency_pin_block_height":215280877,"dependency_pin":{"pin":"04296e5deab6a7f828ed616d28fc3c72d879bf4b95a34d89702ab19e87542957","pin_self":"60cb90ca0c0135f6f9ac74d87c4cb55350da74ed985f804b514754ffe1c04b48","pin_contract_name":"MetadataViews","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"1dcfe88a8f608a664b492e23dfdfdcc0f8d13f5261c918801f196f111584a9ef","pin_self":"1e23db980500f7f0b3112dbec14ee03079525c3e490532981e333607a0d72648","pin_contract_name":"FungibleToken","pin_contract_address":"0x9a0766d93b6608b7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0x9a0766d93b6608b7","imports":[]}]},{"pin":"b12511cf8bc6237d06580340c0118c624dc4f4f0faee8d073417c9b1e09ae65f","pin_self":"8396ebca01cd8d9ada9cd04f8a50dd85c2725fbb893d5a6a35ac9598237b725f","pin_contract_name":"NonFungibleToken","pin_contract_address":"0x631e88ae7f1d7c20","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0x631e88ae7f1d7c20","imports":[]}]}},{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"0f01d860070e89242aa4a9adddbe9a75cecdaada7c9a429063c241f24f0aefb8","pin_self":"9238a5bc9b8e5e2b0536f59699ebc335995c39dcd66bc6a1c6eff22acba50494","pin_contract_name":"MetadataViews","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"e9e7b397cf525d4d4dbdd91c7c2ac6c3cb2575ec8ee6459a06aa3429254d2eb2","pin_self":"d23879b5abd0070ddfec85fdde50398c6617d2f5b35a2eeb1f873c6f0658204f","pin_contract_name":"FungibleToken","pin_contract_address":"0xee82856bf20e2aa6","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]},{"pin":"fdf38f744b1cccbff5682a29a51efe62d3a596c40784491629cd2a037eed2ba8","pin_self":"b230a59e4f9f68ce0c06977a1cb38e7f560a843054602143f81c533cebf72aa7","pin_contract_name":"Burner","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"3752b59a6712df109692d94b27de7e3b4f9c5ed70b1ea189b150d3ee219a5ac6","pin_self":"1cc75b367e4e7d8206c2fb6bbbd2a927d888a6926c2bac70f81d1926634e8817","pin_contract_name":"NonFungibleToken","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]},{"pin":"79e92db336f6cc98eb75c2153a706ec75491d64bf097439fb157d49edd5e5c2d","pin_self":"de0788963b97da19cdb0f1d94211375522eac039013324b876290a95ff3c7c56","pin_contract_name":"ViewResolver","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]},{"contracts":[{"contract":"ExampleNFT","networks":[{"network":"emulator","address":"0xf8d6e0586b0a20c7","dependency_pin_block_height":0,"dependency_pin":{"pin":"42012470e20e90036b3098da71e1056ce0e561031bc41fa47faa1d1269f93a2e","pin_self":"a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a","pin_contract_name":"ExampleNFT","pin_contract_address":"0xf8d6e0586b0a20c7","imports":[]}},{"network":"testing","address":"0000000000000007","dependency_pin_block_height":0,"dependency_pin":{"pin":"","pin_self":"","pin_contract_name":"","pin_contract_address":"","imports":null}}]}]}]},"messages":[{"key":"title","i18n":[{"tag":"en-US","translation":"Unlink Collection"}]}]} \ No newline at end of file