Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add migrated Blocto transaction for testnet (temporary) #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions templates/Blocto/afl-buy-pack.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "9e05a9cde9138c4aef16a41b86f6e3ce0a26935acc21bc1008397e8bdfad78e9",
"data": {
"type": "InteractionTemplate",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "AFL Buy pack"
}
},
"description": {
"i18n": {
"en-US": "Purchase AFL pack(s) for {price} USDC"
}
}
},
"cadence": "import AFLAdmin from 0xAFL_ADDRESS\nimport AFLPack from 0xAFL_ADDRESS\nimport FungibleToken from 0xFUNGIBLE_TOKEN_ADDRESS\nimport FiatToken from 0xFIAT_TOKEN_ADDRESS\n\ntransaction(templateIds: [UInt64], packTemplateId: UInt64, price:UFix64, receiptAddress: Address) {\n let adminRef: &AFLPack.Pack\n let temporaryVault : @FungibleToken.Vault\n prepare(adminAccount: AuthAccount, tokenRecipientAccount: AuthAccount){\n self.adminRef = adminAccount.borrow<&AFLPack.Pack>(from: AFLPack.PackStoragePath)\n ??panic(\"could not borrow admin reference\")\n let vaultRef = tokenRecipientAccount.borrow<&FiatToken.Vault>(from: FiatToken.VaultStoragePath)\n ??panic(\"could not borrow vault\")\n self.temporaryVault <- vaultRef.withdraw(amount: price)\n }\n execute{\n self.adminRef.buyPack(templateIds: templateIds, packTemplateId: packTemplateId, receiptAddress: receiptAddress, price: price, flowPayment: <- self.temporaryVault)\n }\n}",
"dependencies": {
"0xAFL_ADDRESS": {
"AFLPack": {
"testnet": {
"address": "0xb39a42479c1c2c77",
"contract": "AFLPack",
"fq_address": "A.0xb39a42479c1c2c77.AFLPack",
"pin": "9f480a76a29283e85debad372cb6d3c77e16dd4cdf4509739db034d571e842db",
"pin_block_height": 139076020
}
}
},
"0xFUNGIBLE_TOKEN_ADDRESS": {
"FungibleToken": {
"testnet": {
"address": "0x9a0766d93b6608b7",
"contract": "FungibleToken",
"fq_address": "A.0x9a0766d93b6608b7.FungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 139076031
}
}
},
"0xFIAT_TOKEN_ADDRESS": {
"FiatToken": {
"testnet": {
"address": "0xa983fecbed621163",
"contract": "FiatToken",
"fq_address": "A.0xa983fecbed621163.FiatToken",
"pin": "ec7be5050256b8b9ab2a6f5550a42b6a64627fa7e684a88de5dd767864f0471a",
"pin_block_height": 139076049
}
}
}
},
"arguments": {
"templateIds": {
"index": 0,
"type": "UInt64",
"messages": {}
},
"packTemplateId": {
"index": 1,
"type": "UInt64",
"messages": {}
},
"price": {
"index": 2,
"type": "UFix64",
"messages": {}
},
"receiptAddress": {
"index": 3,
"type": "Address",
"messages": {}
}
}
}
}
92 changes: 92 additions & 0 deletions templates/Blocto/biscuitsngroovy-borrow-money-by-nft.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "5d94a36874e81e48ca6315e65d94153b29bc400b566580563dc7191170995640",
"data": {
"type": "InteractionTemplate",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "BiscuitsNGroovy Borrow money by nft"
}
},
"description": {
"i18n": {
"en-US": "Lend NFT {id} in {baseAmount} FLOW tokens.",
"zh-CN": "以 {baseAmount} FLOW 代币出借 NFT {id}",
"zh-TW": "以 {baseAmount} FLOW 代幣出借 NFT {id}"
}
}
},
"cadence": "import FungibleToken from 0xFUNGIBLE_TOKEN_ADDRESS\nimport NonFungibleToken from 0xNON_FUNGIBLE_TOKEN_ADDRESS\nimport NFTLendingPlace from 0xMANTLEFI_NFTLENDINGPLACE\nimport FlowToken from 0xFLOW_TOKEN_ADDRESS\n\n// List an NFT in the account storage for lending\ntransaction(id: UInt64, baseAmount: UFix64, interest: UFix64, duration: UFix64) {\n\n prepare(acct: AuthAccount) {\n\n // Init\n if acct.borrow<&AnyResource{NFTLendingPlace.LendingPublic}>(from: /storage/NFTLendingPlaceCollection) == nil {\n let receiver = acct.getCapability<&FlowToken.Vault{FungibleToken.Receiver}>(/public/flowTokenReceiver)\n let lendingPlace <- NFTLendingPlace.createLendingCollection(ownerVault: receiver)\n acct.save(<-lendingPlace, to: /storage/NFTLendingPlaceCollection)\n acct.link<&NFTLendingPlace.LendingCollection{NFTLendingPlace.LendingPublic}>(/public/NFTLendingPlaceCollection, target: /storage/NFTLendingPlaceCollection)\n }\n\n let lendingPlace = acct.borrow<&NFTLendingPlace.LendingCollection>(from: /storage/NFTLendingPlaceCollection)\n ?? panic(\"Could not borrow borrower's NFT Lending Place resource\")\n\n let collectionRef = acct.borrow<&NonFungibleToken.Collection>(from: /storage/BnGNFTCollection)\n ?? panic(\"Could not borrow borrower's NFT collection resource\")\n\n // Withdraw the NFT to use as collateral\n let token <- collectionRef.withdraw(withdrawID: id)\n\n // List the NFT as collateral\n lendingPlace.listForLending(owner: acct.address, token: <-token, baseAmount: baseAmount, interest: interest, duration: duration)\n }\n}\n",
"dependencies": {
"0xFUNGIBLE_TOKEN_ADDRESS": {
"FungibleToken": {
"testnet": {
"address": "0x9a0766d93b6608b7",
"contract": "FungibleToken",
"fq_address": "A.0x9a0766d93b6608b7.FungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 138885717
}
}
},
"0xNON_FUNGIBLE_TOKEN_ADDRESS": {
"NonFungibleToken": {
"testnet": {
"address": "0x631e88ae7f1d7c20",
"contract": "NonFungibleToken",
"fq_address": "A.0x631e88ae7f1d7c20.NonFungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 138885759
}
}
},
"0xMANTLEFI_NFTLENDINGPLACE": {
"NFTLendingPlace": {
"testnet": {
"address": "0x615a6bf3445b9c61",
"contract": "NFTLendingPlace",
"fq_address": "A.0x615a6bf3445b9c61.NFTLendingPlace",
"pin": "7723617b4999f66ce1942ee3847d899b74dca4b43ff6f7ce75f32c7d8b5b43a6",
"pin_block_height": 138885823
}
}
},
"0xFLOW_TOKEN_ADDRESS": {
"FlowToken": {
"testnet": {
"address": "0x7e60df042a9c0868",
"contract": "FlowToken",
"fq_address": "A.0x7e60df042a9c0868.FlowToken",
"pin": "0326c320322c4e8dde768ba2975c384184fb7e41765c2c87e79a2040bfc71be8",
"pin_block_height": 138885859
}
}
}
},
"arguments": {
"id": {
"index": 0,
"type": "UInt64",
"messages": {}
},
"baseAmount": {
"index": 1,
"type": "UFix64",
"messages": {}
},
"interest": {
"index": 2,
"type": "UFix64",
"messages": {}
},
"duration": {
"index": 3,
"type": "UFix64",
"messages": {}
}
}
}
}
55 changes: 55 additions & 0 deletions templates/Blocto/biscuitsngroovy-cancel-borrow-money.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "6a1d677eaca3f3a0f60c68e765c9b07d105170e371ba7ee0a80114afa96ffc25",
"data": {
"type": "InteractionTemplate",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "BiscuitsNGroovy Cancel borrow money"
}
},
"description": {
"i18n": {
"en-US": "Unlist {Uuid}.",
"zh-CN": "下架 {Uuid}",
"zh-TW": "下架 {Uuid}"
}
}
},
"cadence": "import NonFungibleToken from 0xNON_FUNGIBLE_TOKEN_ADDRESS\nimport NFTLendingPlace from 0xMANTLEFI_NFTLENDINGPLACE\n\n// Let the NFT owner unlist NFT from NFTLendingPlace's resource\ntransaction(Uuid: UInt64) {\n\n prepare(acct: AuthAccount) {\n\n let lending = acct.borrow<&NFTLendingPlace.LendingCollection>(from: /storage/NFTLendingPlaceCollection)\n ?? panic(\"Could not borrow borrower's vault resource\")\n\n // Borrow a reference to the NFTCollection in storage\n let collectionRef = acct.borrow<&NonFungibleToken.Collection>(from: /storage/BnGNFTCollection)\n ?? panic(\"Could not borrow borrower's NFT collection resource\")\n\n let NFTtoken <- lending.withdraw(uuid: Uuid)\n\n collectionRef.deposit(token: <- NFTtoken)\n }\n}\n",
"dependencies": {
"0xNON_FUNGIBLE_TOKEN_ADDRESS": {
"NonFungibleToken": {
"testnet": {
"address": "0x631e88ae7f1d7c20",
"contract": "NonFungibleToken",
"fq_address": "A.0x631e88ae7f1d7c20.NonFungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 138885812
}
}
},
"0xMANTLEFI_NFTLENDINGPLACE": {
"NFTLendingPlace": {
"testnet": {
"address": "0x615a6bf3445b9c61",
"contract": "NFTLendingPlace",
"fq_address": "A.0x615a6bf3445b9c61.NFTLendingPlace",
"pin": "7723617b4999f66ce1942ee3847d899b74dca4b43ff6f7ce75f32c7d8b5b43a6",
"pin_block_height": 138885880
}
}
}
},
"arguments": {
"Uuid": {
"index": 0,
"type": "UInt64",
"messages": {}
}
}
}
}
60 changes: 60 additions & 0 deletions templates/Blocto/biscuitsngroovy-force-redeem.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "74df7edc0d5a7f8ddaa3032a423b20d375cc4aa935948429dd841d28e7a4f848",
"data": {
"type": "InteractionTemplate",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "BiscuitsNGroovy Force redeem"
}
},
"description": {
"i18n": {
"en-US": "Forced redeem of NFT {Uuid} on {BorrowerAddress} debit.",
"zh-CN": "对 {BorrowerAddress} 借方强制清算 NFT {Uuid}",
"zh-TW": "對 {BorrowerAddress} 借方強制清算 NFT {Uuid}"
}
}
},
"cadence": "import NonFungibleToken from 0xNON_FUNGIBLE_TOKEN_ADDRESS\nimport NFTLendingPlace from 0xMANTLEFI_NFTLENDINGPLACE\n\n// Let the lender get borrower's NFT by force\ntransaction(Uuid: UInt64, BorrowerAddress: Address) {\n\n prepare(acct: AuthAccount) {\n\n let borrower = getAccount(BorrowerAddress)\n\n let lendingPlace = borrower.getCapability<&AnyResource{NFTLendingPlace.LendingPublic}>(/public/NFTLendingPlaceCollection)\n .borrow()\n ?? panic(\"Could not borrow borrower's NFT Lending Place resource\")\n\n let ticketRef = acct.borrow<&NFTLendingPlace.LenderTicket>(from: /storage/NFTLendingPlaceCollectionLenderTicket)\n ?? panic(\"Could not borrow lender's LenderTicket resource\")\n\n let returnNft <- lendingPlace.forcedRedeem(uuid: Uuid, lendticket: ticketRef)\n\n let collectionRef = acct.borrow<&NonFungibleToken.Collection>(from: /storage/BnGNFTCollection)\n ?? panic(\"Could not borrow owner's NFT collection reference\")\n\n collectionRef.deposit(token: <-returnNft)\n }\n}\n",
"dependencies": {
"0xNON_FUNGIBLE_TOKEN_ADDRESS": {
"NonFungibleToken": {
"testnet": {
"address": "0x631e88ae7f1d7c20",
"contract": "NonFungibleToken",
"fq_address": "A.0x631e88ae7f1d7c20.NonFungibleToken",
"pin": "83c9e3d61d3b5ebf24356a9f17b5b57b12d6d56547abc73e05f820a0ae7d9cf5",
"pin_block_height": 138885859
}
}
},
"0xMANTLEFI_NFTLENDINGPLACE": {
"NFTLendingPlace": {
"testnet": {
"address": "0x615a6bf3445b9c61",
"contract": "NFTLendingPlace",
"fq_address": "A.0x615a6bf3445b9c61.NFTLendingPlace",
"pin": "7723617b4999f66ce1942ee3847d899b74dca4b43ff6f7ce75f32c7d8b5b43a6",
"pin_block_height": 138885930
}
}
}
},
"arguments": {
"Uuid": {
"index": 0,
"type": "UInt64",
"messages": {}
},
"BorrowerAddress": {
"index": 1,
"type": "Address",
"messages": {}
}
}
}
}
70 changes: 70 additions & 0 deletions templates/Blocto/biscuitsngroovy-lend-money.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"f_type": "InteractionTemplate",
"f_version": "1.0.0",
"id": "f4321a7a20d145a2b2e29ccd2b2b5553a7c9b83cc09e46d7d43ce7a3073f594a",
"data": {
"type": "InteractionTemplate",
"interface": "",
"messages": {
"title": {
"i18n": {
"en-US": "BiscuitsNGroovy Lend money"
}
},
"description": {
"i18n": {
"en-US": "Lend {LendAmount} FLOW tokens to {BorrowerAddress} borrower.",
"zh-CN": "将 {LendAmount} FLOW 代币借给 {BorrowerAddress} 借方",
"zh-TW": "將 {LendAmount} FLOW 代幣借給 {BorrowerAddress} 借方"
}
}
},
"cadence": "import NFTLendingPlace from 0xMANTLEFI_NFTLENDINGPLACE\nimport FlowToken from 0xFLOW_TOKEN_ADDRESS\n\n// Let the lender lend FLOW to borrower\ntransaction(BorrowerAddress: Address, LenderAddress: Address, Uuid: UInt64, LendAmount: UFix64) {\n\n let temporaryVault: @FlowToken.Vault\n\n let ticketRef: &NFTLendingPlace.LenderTicket\n\n prepare(acct: AuthAccount) {\n\n // Init\n if acct.borrow<&NFTLendingPlace.LenderTicket>(from: /storage/NFTLendingPlaceCollectionLenderTicket) == nil {\n let lendingTicket <- NFTLendingPlace.createLenderTicket()\n acct.save(<-lendingTicket, to: /storage/NFTLendingPlaceCollectionLenderTicket)\n }\n\n self.ticketRef = acct.borrow<&NFTLendingPlace.LenderTicket>(from: /storage/NFTLendingPlaceCollectionLenderTicket)\n ?? panic(\"Could not borrow lender's LenderTicket reference\")\n\n let vaultRef = acct.borrow<&FlowToken.Vault>(from: /storage/flowTokenVault)\n ?? panic(\"Could not borrow lender's vault reference\")\n\n self.temporaryVault <- vaultRef.withdraw(amount: LendAmount) as! @FlowToken.Vault\n }\n\n execute {\n\n let borrower = getAccount(BorrowerAddress)\n\n let lendingPlaceRef = borrower.getCapability<&AnyResource{NFTLendingPlace.LendingPublic}>(/public/NFTLendingPlaceCollection)\n .borrow()\n ?? panic(\"Could not borrow borrower's NFT Lending Place recource\")\n\n lendingPlaceRef.lendOut(uuid: Uuid, recipient: LenderAddress, lendAmount: <-self.temporaryVault, ticket: self.ticketRef)\n }\n}\n",
"dependencies": {
"0xMANTLEFI_NFTLENDINGPLACE": {
"NFTLendingPlace": {
"testnet": {
"address": "0x615a6bf3445b9c61",
"contract": "NFTLendingPlace",
"fq_address": "A.0x615a6bf3445b9c61.NFTLendingPlace",
"pin": "7723617b4999f66ce1942ee3847d899b74dca4b43ff6f7ce75f32c7d8b5b43a6",
"pin_block_height": 138885919
}
}
},
"0xFLOW_TOKEN_ADDRESS": {
"FlowToken": {
"testnet": {
"address": "0x7e60df042a9c0868",
"contract": "FlowToken",
"fq_address": "A.0x7e60df042a9c0868.FlowToken",
"pin": "0326c320322c4e8dde768ba2975c384184fb7e41765c2c87e79a2040bfc71be8",
"pin_block_height": 138885966
}
}
}
},
"arguments": {
"BorrowerAddress": {
"index": 0,
"type": "Address",
"messages": {}
},
"LenderAddress": {
"index": 1,
"type": "Address",
"messages": {}
},
"Uuid": {
"index": 2,
"type": "UInt64",
"messages": {}
},
"LendAmount": {
"index": 3,
"type": "UFix64",
"messages": {}
}
}
}
}
Loading