@flowtyio/flow-contracts 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/contracts/hybrid-custody/CapabilityDelegator.cdc +174 -0
- package/contracts/hybrid-custody/CapabilityFactory.cdc +105 -0
- package/contracts/hybrid-custody/CapabilityFilter.cdc +199 -0
- package/contracts/hybrid-custody/HybridCustody.cdc +1202 -0
- package/contracts/hybrid-custody/factories/FTAllFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/FTBalanceFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/FTProviderFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/FTReceiverBalanceFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/FTReceiverFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/NFTCollectionPublicFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/NFTProviderAndCollectionPublicFactory.cdc +10 -0
- package/contracts/hybrid-custody/factories/NFTProviderFactory.cdc +10 -0
- package/flow.json +22 -11
- package/package.json +2 -2
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "FungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract FTAllFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{FungibleToken.Provider, FungibleToken.Balance, FungibleToken.Receiver}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "FungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract FTBalanceFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{FungibleToken.Balance}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "FungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract FTProviderFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{FungibleToken.Provider}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "FungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract FTReceiverBalanceFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{FungibleToken.Receiver, FungibleToken.Balance}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "FungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract FTReceiverFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{FungibleToken.Receiver}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "NonFungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract NFTCollectionPublicFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{NonFungibleToken.CollectionPublic}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "NonFungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract NFTProviderAndCollectionFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{NonFungibleToken.Provider, NonFungibleToken.CollectionPublic}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import "CapabilityFactory"
|
|
2
|
+
import "NonFungibleToken"
|
|
3
|
+
|
|
4
|
+
pub contract NFTProviderFactory {
|
|
5
|
+
pub struct Factory: CapabilityFactory.Factory {
|
|
6
|
+
pub fun getCapability(acct: &AuthAccount, path: CapabilityPath): Capability {
|
|
7
|
+
return acct.getCapability<&{NonFungibleToken.Provider}>(path)
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/flow.json
CHANGED
|
@@ -52,77 +52,88 @@
|
|
|
52
52
|
"source": "./contracts/hybrid-custody/HybridCustody.cdc",
|
|
53
53
|
"aliases": {
|
|
54
54
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
55
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
55
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
56
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
56
57
|
}
|
|
57
58
|
},
|
|
58
59
|
"CapabilityFactory": {
|
|
59
60
|
"source": "./contracts/hybrid-custody/CapabilityFactory.cdc",
|
|
60
61
|
"aliases": {
|
|
61
62
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
62
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
63
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
64
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
63
65
|
}
|
|
64
66
|
},
|
|
65
67
|
"CapabilityDelegator": {
|
|
66
68
|
"source": "./contracts/hybrid-custody/CapabilityDelegator.cdc",
|
|
67
69
|
"aliases": {
|
|
68
70
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
69
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
71
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
72
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
70
73
|
}
|
|
71
74
|
},
|
|
72
75
|
"CapabilityFilter": {
|
|
73
76
|
"source": "./contracts/hybrid-custody/CapabilityFilter.cdc",
|
|
74
77
|
"aliases": {
|
|
75
78
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
76
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
79
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
80
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
77
81
|
}
|
|
78
82
|
},
|
|
79
83
|
"FTAllFactory": {
|
|
80
84
|
"source": "./contracts/hybrid-custody/factories/FTAllFactory.cdc",
|
|
81
85
|
"aliases": {
|
|
82
86
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
83
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
87
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
88
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
84
89
|
}
|
|
85
90
|
},
|
|
86
91
|
"FTBalanceFactory": {
|
|
87
92
|
"source": "./contracts/hybrid-custody/factories/FTBalanceFactory.cdc",
|
|
88
93
|
"aliases": {
|
|
89
94
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
90
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
95
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
96
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
91
97
|
}
|
|
92
98
|
},
|
|
93
99
|
"FTProviderFactory": {
|
|
94
100
|
"source": "./contracts/hybrid-custody/factories/FTProviderFactory.cdc",
|
|
95
101
|
"aliases": {
|
|
96
102
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
97
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
103
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
104
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
98
105
|
}
|
|
99
106
|
},
|
|
100
107
|
"FTReceiverFactory": {
|
|
101
108
|
"source": "./contracts/hybrid-custody/factories/FTReceiverFactory.cdc",
|
|
102
109
|
"aliases": {
|
|
103
110
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
104
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
111
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
112
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
105
113
|
}
|
|
106
114
|
},
|
|
107
115
|
"NFTCollectionPublicFactory": {
|
|
108
116
|
"source": "./contracts/hybrid-custody/factories/NFTCollectionPublicFactory.cdc",
|
|
109
117
|
"aliases": {
|
|
110
118
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
111
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
119
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
120
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
112
121
|
}
|
|
113
122
|
},
|
|
114
123
|
"NFTProviderAndCollectionPublicFactory": {
|
|
115
124
|
"source": "./contracts/hybrid-custody/factories/NFTProviderAndCollectionPublicFactory.cdc",
|
|
116
125
|
"aliases": {
|
|
117
126
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
118
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
127
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
128
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
119
129
|
}
|
|
120
130
|
},
|
|
121
131
|
"NFTProviderFactory": {
|
|
122
132
|
"source": "./contracts/hybrid-custody/factories/NFTProviderFactory.cdc",
|
|
123
133
|
"aliases": {
|
|
124
134
|
"emulator": "0xf8d6e0586b0a20c7",
|
|
125
|
-
"testnet": "0x294e44e1ec6993c6"
|
|
135
|
+
"testnet": "0x294e44e1ec6993c6",
|
|
136
|
+
"mainnet": "0xd8a7e05a7ac670c0"
|
|
126
137
|
}
|
|
127
138
|
}
|
|
128
139
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flowtyio/flow-contracts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"main": "index.json",
|
|
5
5
|
"description": "An NPM package for common flow contracts",
|
|
6
6
|
"author": "flowtyio",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"files": [
|
|
29
29
|
"*.js",
|
|
30
30
|
"index.json",
|
|
31
|
-
"contracts
|
|
31
|
+
"contracts/**/*.cdc",
|
|
32
32
|
"flow.json",
|
|
33
33
|
"README.md",
|
|
34
34
|
"LICENSE"
|