Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 143 additions & 47 deletions templates/flow-transfer-tokens.template.json
Original file line number Diff line number Diff line change
@@ -1,68 +1,164 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "290b6b6222b2a77b16db896a80ddf29ebd1fa3038c9e6625a933fa213fce51fa",
"f_version": "1.1.0",
"id": "1737b54235c2caa4fc07e54f27c6056491b74e3400f214717cf7c75d002af011",
"data": {
"type": "transaction",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "Transfer Tokens"
}
"messages": [
{
"key": "title",
"i18n": [
{
"tag": "en-US",
"translation": "Transfer tokens"
}
]
},
"description": {
"i18n": {
"en-US": "Transfer tokens from one account to another"
}
{
"key": "description",
"i18n": [
{
"tag": "en-US",
"translation": "Transfer tokens from one account to another"
}
]
}
],
"cadence": {
"body": "\nimport \"FungibleToken\"\n \ntransaction(amount: UFix64, to: Address) {\n\nlet vault: @{FungibleToken.Vault}\n\n prepare(signer: auth(BorrowValue) &Account) {\n self.vault <- signer.storage.borrow<auth(FungibleToken.Withdraw) &{FungibleToken.Provider}>(from: /storage/flowTokenVault)!\n .withdraw(amount: amount)\n }\n\n execute {\n getAccount(to).capabilities.borrow<&{FungibleToken.Receiver}>(/public/flowTokenReceiver)!\n .deposit(from: <-self.vault)\n }\n}",
"network_pins": [
{
"network": "mainnet",
"pin_self": "b9b0bc19acbb7eefe5830ff932a2ee9212a886d5e56e8e39005aaefb451c6eb0"
},
{
"network": "testnet",
"pin_self": "c98130fba38e69c932f43cc07a990b5e9cd3a0db66ddbc6b1dc1d4b4d6c0465b"
}
]
},
"cadence": "import FungibleToken from 0xFUNGIBLETOKENADDRESS\ntransaction(amount: UFix64, to: Address) {\nlet vault: @FungibleToken.Vault\nprepare(signer: AuthAccount) {\nself.vault <- signer\n.borrow<&{FungibleToken.Provider}>(from: /storage/flowTokenVault)!\n.withdraw(amount: amount)\n}\nexecute {\ngetAccount(to)\n.getCapability(/public/flowTokenReceiver)!\n.borrow<&{FungibleToken.Receiver}>()!\n.deposit(from: <-self.vault)\n}\n}",
"dependencies": {
"0xFUNGIBLETOKENADDRESS": {
"FungibleToken": {
"mainnet": {
"address": "0xf233dcee88fe0abe",
"fq_address": "A.0xf233dcee88fe0abe.FungibleToken",
"contract": "FungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 34166296
},
"testnet": {
"address": "0x9a0766d93b6608b7",
"fq_address": "A.0x9a0766d93b6608b7.FungibleToken",
"dependencies": [
{
"contracts": [
{
"contract": "FungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 74776482
"networks": [
{
"network": "emulator",
"address": "0xee82856bf20e2aa6",
"dependency_pin_block_height": 0
},
{
"network": "mainnet",
"address": "0xf233dcee88fe0abe",
"dependency_pin_block_height": 121226045,
"dependency_pin": {
"pin": "e38db2cfa2ad7138c91a7ef11be78f93e269abee4ce01c1a991acb446466d8e9",
"pin_self": "eb92316c19b95946f55cb84623a658335205e602cce94e9e1f0f9dd26148f50e",
"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": 271631263,
"dependency_pin": {
"pin": "312eda91fa1b04517fc9cb8204b9885e18a1263ca9ba60bed45343bf0bab00bb",
"pin_self": "6b1226cc283606b660002c52aa71187d6896524a8ff62f06cedaef348b26ff9a",
"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": []
}
]
}
}
]
}
}
]
}
},
"arguments": {
"amount": {
],
"parameters": [
{
"label": "amount",
"index": 0,
"type": "UFix64",
"messages": {
"title": {
"i18n": {
"en-US": "The amount of FLOW tokens to send"
}
"messages": [
{
"key": "title",
"i18n": [
{
"tag": "en-US",
"translation": "Amount"
}
]
},
{
"key": "description",
"i18n": [
{
"tag": "en-US",
"translation": "The amount of FLOW tokens to send"
}
]
}
},
"balance": ""
]
},
"to": {
{
"label": "to",
"index": 1,
"type": "Address",
"messages": {
"title": {
"i18n": {
"en-US": "The Flow account the tokens will go to"
}
"messages": [
{
"key": "title",
"i18n": [
{
"tag": "en-US",
"translation": "To"
}
]
},
{
"key": "description",
"i18n": [
{
"tag": "en-US",
"translation": "The Flow account the tokens will go to"
}
]
}
},
"balance": ""
]
}
}
]
}
}