@tatumio/flow 2.0.1-alpha.330 → 2.0.1-alpha.332
Sign up to get free protection for your applications and to get access to all the features.
package/package.json
CHANGED
@@ -1,19 +1,19 @@
|
|
1
1
|
{
|
2
2
|
"name": "@tatumio/flow",
|
3
|
-
"version": "2.0.1-alpha.
|
3
|
+
"version": "2.0.1-alpha.332",
|
4
4
|
"license": "MIT",
|
5
5
|
"main": "./src/index.js",
|
6
6
|
"types": "./src/index.d.ts",
|
7
7
|
"dependencies": {
|
8
|
-
"@tatumio/shared-testing-common": "2.0.1-alpha.
|
9
|
-
"@tatumio/api-client": "2.0.1-alpha.
|
8
|
+
"@tatumio/shared-testing-common": "2.0.1-alpha.332",
|
9
|
+
"@tatumio/api-client": "2.0.1-alpha.332",
|
10
10
|
"axios": "^0.26.0",
|
11
11
|
"form-data": "^4.0.0",
|
12
|
-
"@tatumio/shared-core": "2.0.1-alpha.
|
12
|
+
"@tatumio/shared-core": "2.0.1-alpha.332",
|
13
13
|
"dedent-js": "^1.0.1",
|
14
|
-
"@tatumio/shared-abstract-sdk": "2.0.1-alpha.
|
14
|
+
"@tatumio/shared-abstract-sdk": "2.0.1-alpha.332",
|
15
15
|
"bignumber.js": "^9.0.2",
|
16
|
-
"@tatumio/shared-blockchain-abstract": "2.0.1-alpha.
|
16
|
+
"@tatumio/shared-blockchain-abstract": "2.0.1-alpha.332",
|
17
17
|
"bip32": "^2.0.5",
|
18
18
|
"bip39": "^3.0.2",
|
19
19
|
"hdkey": "^2.0.1",
|
@@ -29,7 +29,7 @@ import TatumMultiNFT from ${testnet ? flow_tx_1.FLOW_TESTNET_ADDRESSES.TatumMult
|
|
29
29
|
pub fun main(account: Address, id: UInt64, type: String): String {
|
30
30
|
let collectionRef = getAccount(account)
|
31
31
|
.getCapability(TatumMultiNFT.CollectionPublicPath)
|
32
|
-
.borrow<&
|
32
|
+
.borrow<&TatumMultiNFT.Collection>()
|
33
33
|
?? panic("Could not borrow capability from public collection")
|
34
34
|
let ref = collectionRef.borrowTatumNFT(id: id, type: type)
|
35
35
|
if ref != nil {
|
@@ -43,7 +43,7 @@ import TatumMultiNFT from ${testnet ? flow_tx_1.FLOW_TESTNET_ADDRESSES.TatumMult
|
|
43
43
|
pub fun main(address: Address, type: String): [UInt64] {
|
44
44
|
let collectionRef = getAccount(address)
|
45
45
|
.getCapability(TatumMultiNFT.CollectionPublicPath)
|
46
|
-
.borrow<&
|
46
|
+
.borrow<&TatumMultiNFT.Collection>()
|
47
47
|
?? panic("Could not borrow capability from public collection")
|
48
48
|
return collectionRef.getIDsByType(type: type)
|
49
49
|
}`,
|
@@ -63,7 +63,7 @@ transaction(recipient: Address, url: String, type: String) {
|
|
63
63
|
// borrow the recipient's public NFT collection reference
|
64
64
|
let receiver = recipientAccount
|
65
65
|
.getCapability(TatumMultiNFT.CollectionPublicPath)
|
66
|
-
.borrow<&
|
66
|
+
.borrow<&TatumMultiNFT.Collection>()
|
67
67
|
?? panic("Could not get receiver reference to the NFT Collection")
|
68
68
|
// mint the NFT and deposit it to the recipient's collection
|
69
69
|
self.minter.mintNFT(recipient: receiver, type: type, url: url, address: recipient)
|
@@ -87,7 +87,7 @@ transaction(recipient: [Address], url: [String], type: String) {
|
|
87
87
|
// borrow the recipient's public NFT collection reference
|
88
88
|
let receiver = recipientAccount
|
89
89
|
.getCapability(TatumMultiNFT.CollectionPublicPath)
|
90
|
-
.borrow<&
|
90
|
+
.borrow<&TatumMultiNFT.Collection>()
|
91
91
|
?? panic("Could not get receiver reference to the NFT Collection")
|
92
92
|
// mint the NFT and deposit it to the recipient's collection
|
93
93
|
self.minter.mintNFT(recipient: receiver, type: type, url: url[a], address: recipient[a])
|
@@ -99,10 +99,10 @@ transaction(recipient: [Address], url: [String], type: String) {
|
|
99
99
|
import TatumMultiNFT from ${testnet ? flow_tx_1.FLOW_TESTNET_ADDRESSES.TatumMultiNFT : flow_tx_1.FLOW_MAINNET_ADDRESSES.TatumMultiNFT}
|
100
100
|
transaction(withdrawID: UInt64, type: String) {
|
101
101
|
// local variable for storing the minter reference
|
102
|
-
let senderCollection: &
|
102
|
+
let senderCollection: &TatumMultiNFT.Collection
|
103
103
|
prepare(signer: AuthAccount) {
|
104
104
|
// borrow a reference to the signer's NFT collection
|
105
|
-
self.senderCollection = signer.borrow<&
|
105
|
+
self.senderCollection = signer.borrow<&TatumMultiNFT.Collection>(from: TatumMultiNFT.CollectionStoragePath)
|
106
106
|
?? panic("Could not borrow a reference to the owner's collection")
|
107
107
|
// check if token has correct type
|
108
108
|
self.senderCollection.borrowTatumNFT(id: withdrawID, type: type)
|
@@ -118,17 +118,17 @@ transaction(withdrawID: UInt64, type: String) {
|
|
118
118
|
import TatumMultiNFT from ${testnet ? flow_tx_1.FLOW_TESTNET_ADDRESSES.TatumMultiNFT : flow_tx_1.FLOW_MAINNET_ADDRESSES.TatumMultiNFT}
|
119
119
|
transaction(recipient: Address, withdrawID: UInt64) {
|
120
120
|
// local variable for storing the minter reference
|
121
|
-
let senderCollection: &
|
121
|
+
let senderCollection: &TatumMultiNFT.Collection
|
122
122
|
prepare(signer: AuthAccount) {
|
123
123
|
// borrow a reference to the signer's NFT collection
|
124
|
-
self.senderCollection = signer.borrow<&
|
124
|
+
self.senderCollection = signer.borrow<&TatumMultiNFT.Collection>(from: TatumMultiNFT.CollectionStoragePath)
|
125
125
|
?? panic("Could not borrow a reference to the owner's collection")
|
126
126
|
}
|
127
127
|
execute {
|
128
128
|
// get the recipients public account object
|
129
129
|
let recipient = getAccount(recipient)
|
130
130
|
// borrow a public reference to the receivers collection
|
131
|
-
let depositRef = recipient.getCapability(TatumMultiNFT.CollectionPublicPath).borrow<&
|
131
|
+
let depositRef = recipient.getCapability(TatumMultiNFT.CollectionPublicPath).borrow<&TatumMultiNFT.Collection>()!
|
132
132
|
// withdraw the NFT from the owner's collection
|
133
133
|
let nft <- self.senderCollection.withdraw(withdrawID: withdrawID)
|
134
134
|
// Deposit the NFT in the recipient's collection
|