From 4f1bda20d418b86d33ba3e14311c7c3097f6fc16 Mon Sep 17 00:00:00 2001 From: Bjarte Stien Karlsen Date: Thu, 25 Jul 2024 13:57:45 +0200 Subject: [PATCH] update client --- lib/find.json | 6 +++--- lib/package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/find.json b/lib/find.json index 486cdfa6..ed7572b7 100644 --- a/lib/find.json +++ b/lib/find.json @@ -64,7 +64,7 @@ "user" ] }, - "code": "import FIND from 0xf3fcd2c1a78f5eee\nimport Profile from 0xf3fcd2c1a78f5eee\nimport FindRelatedAccounts from 0xf3fcd2c1a78f5eee\nimport NonFungibleToken from 0xf8d6e0586b0a20c7\nimport MetadataViews from 0xf8d6e0586b0a20c7\nimport EmeraldIdentity from 0xf8d6e0586b0a20c7\nimport TokenForwarding from 0xf8d6e0586b0a20c7\nimport FungibleToken from 0xee82856bf20e2aa6\nimport FindUtils from 0xf3fcd2c1a78f5eee\nimport Clock from 0xf3fcd2c1a78f5eee\nimport LostAndFound from 0xf8d6e0586b0a20c7\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n //?? EmeraldIdentityDapper.getDiscordFromAccount(account: address)\n //?? EmeraldIdentityLilico.getDiscordFromAccount(account: address)\n // ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" + "code": "import FIND from 0xf3fcd2c1a78f5eee\nimport Profile from 0xf3fcd2c1a78f5eee\nimport FindRelatedAccounts from 0xf3fcd2c1a78f5eee\nimport NonFungibleToken from 0xf8d6e0586b0a20c7\nimport MetadataViews from 0xf8d6e0586b0a20c7\nimport TokenForwarding from 0xf8d6e0586b0a20c7\nimport FungibleToken from 0xee82856bf20e2aa6\nimport FindUtils from 0xf3fcd2c1a78f5eee\nimport Clock from 0xf3fcd2c1a78f5eee\nimport LostAndFound from 0xf8d6e0586b0a20c7\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = \"\"//EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n //emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" }, "getFindThoughts": { "spec": { @@ -2713,7 +2713,7 @@ "user" ] }, - "code": "import FIND from 0x35717efbbce11c74\nimport Profile from 0x35717efbbce11c74\nimport FindRelatedAccounts from 0x35717efbbce11c74\nimport NonFungibleToken from 0x631e88ae7f1d7c20\nimport MetadataViews from 0x631e88ae7f1d7c20\nimport EmeraldIdentity from 0xfe433270356d985c\nimport TokenForwarding from 0x51ea0e37c27a1f1a\nimport FungibleToken from 0x9a0766d93b6608b7\nimport FindUtils from 0x35717efbbce11c74\nimport Clock from 0x35717efbbce11c74\nimport LostAndFound from 0xbe4635353f55bbd4\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n //?? EmeraldIdentityDapper.getDiscordFromAccount(account: address)\n //?? EmeraldIdentityLilico.getDiscordFromAccount(account: address)\n // ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" + "code": "import FIND from 0x35717efbbce11c74\nimport Profile from 0x35717efbbce11c74\nimport FindRelatedAccounts from 0x35717efbbce11c74\nimport NonFungibleToken from 0x631e88ae7f1d7c20\nimport MetadataViews from 0x631e88ae7f1d7c20\nimport TokenForwarding from 0x51ea0e37c27a1f1a\nimport FungibleToken from 0x9a0766d93b6608b7\nimport FindUtils from 0x35717efbbce11c74\nimport Clock from 0x35717efbbce11c74\nimport LostAndFound from 0xbe4635353f55bbd4\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = \"\"//EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n //emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" }, "getFindThoughts": { "spec": { @@ -5430,7 +5430,7 @@ "user" ] }, - "code": "import FIND from 0x35717efbbce11c74\nimport Profile from 0x35717efbbce11c74\nimport FindRelatedAccounts from 0x35717efbbce11c74\nimport NonFungibleToken from 0x631e88ae7f1d7c20\nimport MetadataViews from 0x631e88ae7f1d7c20\nimport EmeraldIdentity from 0xfe433270356d985c\nimport TokenForwarding from 0x51ea0e37c27a1f1a\nimport FungibleToken from 0x9a0766d93b6608b7\nimport FindUtils from 0x35717efbbce11c74\nimport Clock from 0x35717efbbce11c74\nimport LostAndFound from 0xbe4635353f55bbd4\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n //?? EmeraldIdentityDapper.getDiscordFromAccount(account: address)\n //?? EmeraldIdentityLilico.getDiscordFromAccount(account: address)\n // ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" + "code": "import FIND from 0x35717efbbce11c74\nimport Profile from 0x35717efbbce11c74\nimport FindRelatedAccounts from 0x35717efbbce11c74\nimport NonFungibleToken from 0x631e88ae7f1d7c20\nimport MetadataViews from 0x631e88ae7f1d7c20\nimport TokenForwarding from 0x51ea0e37c27a1f1a\nimport FungibleToken from 0x9a0766d93b6608b7\nimport FindUtils from 0x35717efbbce11c74\nimport Clock from 0x35717efbbce11c74\nimport LostAndFound from 0xbe4635353f55bbd4\n\naccess(all) \nstruct FINDReport{\n access(all) let isDapper: Bool\n access(all) let profile:Profile.UserReport?\n access(all) let privateMode: Bool\n access(all) let activatedAccount: Bool\n access(all) let hasLostAndFoundItem: Bool\n access(all) let accounts : [AccountInformation]?\n //not sure\n access(all) let readyForWearables : Bool?\n\n init(profile: Profile.UserReport?,\n privateMode: Bool,\n activatedAccount: Bool,\n isDapper: Bool,\n hasLostAndFoundItem: Bool,\n accounts: [AccountInformation]?,\n readyForWearables: Bool?\n) {\n\n self.hasLostAndFoundItem=hasLostAndFoundItem\n self.profile=profile\n self.privateMode=privateMode\n self.activatedAccount=activatedAccount\n self.isDapper=isDapper\n self.accounts=accounts\n self.readyForWearables=readyForWearables\n}\n}\n\naccess(all) struct AccountInformation {\n access(all) let name: String\n access(all) let address: String\n access(all) let network: String\n access(all) let trusted: Bool\n access(all) let node: String\n\n init(name: String, address: String, network: String, trusted: Bool, node: String) {\n self.name = name\n self.address = address\n self.network = network\n self.trusted = trusted\n self.node = node\n }\n}\n\n\naccess(all) \nfun main(user: String) : FINDReport? {\n\n let maybeAddress=FIND.resolve(user)\n if maybeAddress == nil{\n return nil\n }\n\n let address=maybeAddress!\n\n //why not auth account here?\n let account=getAccount(address)\n if account.balance == 0.0 {\n return nil\n }\n\n\n var isDapper=false\n if let receiver =account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/flowTokenReceiver) {\n isDapper=receiver.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n if let duc = account.capabilities.borrow\u003c\u0026{FungibleToken.Receiver}\u003e(/public/dapperUtilityCoinReceiver){\n isDapper = duc.isInstance(Type\u003c@TokenForwarding.Forwarder\u003e())\n } else {\n isDapper = false\n }\n }\n\n let profile=account.capabilities.borrow\u003c\u0026{Profile.Public}\u003e(Profile.publicPath)\n var profileReport = profile?.asReport()\n if profileReport != nil \u0026\u0026 profileReport!.findName != FIND.reverseLookup(address) {\n profileReport = Profile.UserReport(\n findName: \"\",\n address: profileReport!.address,\n name: profileReport!.name,\n gender: profileReport!.gender,\n description: profileReport!.description,\n tags: profileReport!.tags,\n avatar: profileReport!.avatar,\n links: profileReport!.links,\n wallets: profileReport!.wallets,\n following: profileReport!.following,\n followers: profileReport!.followers,\n allowStoringFollowers: profileReport!.allowStoringFollowers,\n createdAt: profileReport!.createdAt\n )\n }\n\n let discordID = \"\"//EmeraldIdentity.getDiscordFromAccount(account: address) ?? \"\"\n\n let emeraldIDAccounts : {String : Address} = {}\n //emeraldIDAccounts[\"blocto\"] = EmeraldIdentity.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"lilico\"] = EmeraldIdentityLilico.getAccountFromDiscord(discordID: discordID)\n // emeraldIDAccounts[\"dapper\"] = EmeraldIdentityDapper.getAccountFromDiscord(discordID: discordID)\n\n let accounts : [AccountInformation] = []\n for wallet in [\"blocto\", \"lilico\", \"dapper\"] {\n if let w = emeraldIDAccounts[wallet] {\n if w == address {\n continue\n }\n\n accounts.append(\n AccountInformation(\n name: wallet,\n address: w.toString(),\n network: \"Flow\",\n trusted: true,\n node: \"EmeraldID\")\n )\n }\n }\n\n if let allAcctsCap = FindRelatedAccounts.getCapability(address) {\n let allAcctsRef = allAcctsCap.borrow()!\n let allAccts = allAcctsRef.getAllRelatedAccountInfo()\n for acct in allAccts.values {\n // We only verify flow accounts that are mutually linked\n var trusted = false\n if acct.address != nil {\n if acct.address! == address {\n continue\n }\n trusted = allAcctsRef.linked(name: acct.name, network: acct.network, address: acct.address!)\n }\n accounts.append(AccountInformation(\n name: acct.name,\n address: acct.stringAddress,\n network: acct.network,\n trusted: trusted,\n node: \"FindRelatedAccounts\")\n )\n }\n }\n\n var readyForWearables = false\n var hasLostAndFoundItem : Bool = false\n\n for t in LostAndFound.getRedeemableTypes(address) {\n if t.isSubtype(of: Type\u003c@{NonFungibleToken.NFT}\u003e()) {\n hasLostAndFoundItem = true\n break\n }\n }\n\n return FINDReport(\n profile: profileReport,\n privateMode: profile?.isPrivateModeEnabled() ?? false,\n activatedAccount: true,\n isDapper:isDapper,\n hasLostAndFoundItem: hasLostAndFoundItem,\n accounts: accounts,\n readyForWearables: readyForWearables,\n )\n }" }, "getFindThoughts": { "spec": { diff --git a/lib/package.json b/lib/package.json index 29f11158..c72bd1ef 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,6 +1,6 @@ { "name": "@findonflow/find-flow-contracts-1.0", - "version": "1.0.5", + "version": "1.0.6", "description": "Cadence transactions and scripts to work with https://find.xyz for cadence 1.0", "main": "index.js", "scripts": {