@functionland/react-native-fula 1.14.1 → 1.14.4
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/LICENSE +20 -21
- package/android/build.gradle +90 -50
- package/android/gradle.properties +5 -1
- package/android/src/main/AndroidManifest.xml +3 -4
- package/android/src/main/AndroidManifestNew.xml +2 -0
- package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
- package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
- package/android/src/main/java/land/fx/fula/FulaModule.java +1 -1
- package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
- package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
- package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
- package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
- package/ios/Cryptography.swift +36 -0
- package/ios/Fula-Bridging-Header.h +3 -0
- package/ios/Fula.mm +199 -0
- package/ios/Fula.swift +1152 -0
- package/ios/{FulaModule.xcodeproj → Fula.xcodeproj}/project.pbxproj +38 -16
- package/ios/Fula.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Fula.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/Fula.xcodeproj/project.xcworkspace/xcuserdata/user246549.xcuserdatad/UserInterfaceState.xcuserstate +0 -0
- package/ios/Fula.xcodeproj/xcuserdata/user246549.xcuserdatad/xcschemes/xcschememanagement.plist +14 -0
- package/ios/UserDataHelper.swift +143 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/api-lookup.js +266 -266
- package/lib/commonjs/interfaces/api-lookup.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +64 -64
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/chain-api.js +10 -0
- package/lib/commonjs/protocols/chain-api.js.map +1 -1
- package/lib/commonjs/protocols/fula.js +99 -99
- package/lib/commonjs/protocols/fula.js.map +1 -1
- package/lib/commonjs/protocols/fxblox.js +3 -3
- package/lib/commonjs/protocols/fxblox.js.map +1 -1
- package/lib/commonjs/types/blockchain.js.map +1 -1
- package/lib/commonjs/types/fxblox.js.map +1 -1
- package/lib/module/index.js +4 -8
- package/lib/module/index.js.map +1 -1
- package/lib/module/interfaces/api-lookup.js +266 -266
- package/lib/module/interfaces/api-lookup.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/protocols/blockchain.js +64 -64
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/chain-api.js +8 -0
- package/lib/module/protocols/chain-api.js.map +1 -1
- package/lib/module/protocols/fula.js +99 -99
- package/lib/module/protocols/fula.js.map +1 -1
- package/lib/module/protocols/fxblox.js +3 -3
- package/lib/module/protocols/fxblox.js.map +1 -1
- package/lib/module/types/blockchain.js.map +1 -1
- package/lib/module/types/fxblox.js.map +1 -1
- package/lib/typescript/index.d.ts +5 -4
- package/lib/typescript/index.d.ts.map +1 -0
- package/lib/typescript/interfaces/api-lookup.d.ts +1644 -1643
- package/lib/typescript/interfaces/api-lookup.d.ts.map +1 -0
- package/lib/typescript/interfaces/fulaNativeModule.d.ts +62 -61
- package/lib/typescript/interfaces/fulaNativeModule.d.ts.map +1 -0
- package/lib/typescript/protocols/blockchain.d.ts +18 -17
- package/lib/typescript/protocols/blockchain.d.ts.map +1 -0
- package/lib/typescript/protocols/chain-api.d.ts +7 -6
- package/lib/typescript/protocols/chain-api.d.ts.map +1 -0
- package/lib/typescript/protocols/fula.d.ts +132 -131
- package/lib/typescript/protocols/fula.d.ts.map +1 -0
- package/lib/typescript/protocols/fxblox.d.ts +8 -7
- package/lib/typescript/protocols/fxblox.d.ts.map +1 -0
- package/lib/typescript/types/blockchain.d.ts +69 -68
- package/lib/typescript/types/blockchain.d.ts.map +1 -0
- package/lib/typescript/types/fxblox.d.ts +9 -8
- package/lib/typescript/types/fxblox.d.ts.map +1 -0
- package/package.json +43 -28
- package/react-native-fula.podspec +47 -19
- package/src/index.tsx +4 -4
- package/src/interfaces/api-lookup.ts +1647 -1647
- package/src/interfaces/fulaNativeModule.ts +122 -122
- package/src/protocols/blockchain.ts +504 -504
- package/src/protocols/chain-api.ts +8 -0
- package/src/protocols/fula.ts +314 -314
- package/src/protocols/fxblox.ts +49 -49
- package/src/types/blockchain.ts +80 -80
- package/src/types/fxblox.ts +8 -8
- package/android/.gradle/7.5.1/checksums/checksums.lock +0 -0
- package/android/.gradle/7.5.1/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.5.1/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.5.1/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.5.1/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.5.1/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.5.1/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.5.1/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.5.1/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.5.1/gc.properties +0 -0
- package/android/.gradle/7.6/checksums/checksums.lock +0 -0
- package/android/.gradle/7.6/checksums/md5-checksums.bin +0 -0
- package/android/.gradle/7.6/checksums/sha1-checksums.bin +0 -0
- package/android/.gradle/7.6/dependencies-accessors/dependencies-accessors.lock +0 -0
- package/android/.gradle/7.6/dependencies-accessors/gc.properties +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.bin +0 -0
- package/android/.gradle/7.6/executionHistory/executionHistory.lock +0 -0
- package/android/.gradle/7.6/fileChanges/last-build.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.bin +0 -0
- package/android/.gradle/7.6/fileHashes/fileHashes.lock +0 -0
- package/android/.gradle/7.6/fileHashes/resourceHashesCache.bin +0 -0
- package/android/.gradle/7.6/gc.properties +0 -0
- package/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock +0 -0
- package/android/.gradle/buildOutputCleanup/cache.properties +0 -2
- package/android/.gradle/buildOutputCleanup/outputFiles.bin +0 -0
- package/android/.gradle/file-system.probe +0 -0
- package/android/.gradle/vcs-1/gc.properties +0 -0
- package/android/.idea/compiler.xml +0 -6
- package/android/.idea/gradle.xml +0 -20
- package/android/.idea/jarRepositories.xml +0 -50
- package/android/.idea/misc.xml +0 -10
- package/android/.idea/sonarlint/issuestore/2/a/2afbb999f001938c88fa43fc2ef52abf0f8213e4 +0 -0
- package/android/.idea/sonarlint/issuestore/2/e/2e09eb0f0df666781fdff057a0af6101364ebe2f +0 -0
- package/android/.idea/sonarlint/issuestore/6/2/62149c3f7c3a14d7a77778e558d274e8c00a5585 +0 -0
- package/android/.idea/sonarlint/issuestore/8/0/80a78d662b0659428eb880336106c3c5fc3f0714 +0 -0
- package/android/.idea/sonarlint/issuestore/d/2/d2865ef8fc01c40e9fd82977fde2c8378fad0b12 +0 -0
- package/android/.idea/sonarlint/issuestore/f/b/fbe448ebfc3eb2d4e308f6b8b043666f5b57235e +0 -0
- package/android/.idea/sonarlint/issuestore/index.pb +0 -13
- package/android/.idea/sonarlint/securityhotspotstore/2/a/2afbb999f001938c88fa43fc2ef52abf0f8213e4 +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/2/e/2e09eb0f0df666781fdff057a0af6101364ebe2f +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/6/2/62149c3f7c3a14d7a77778e558d274e8c00a5585 +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/8/0/80a78d662b0659428eb880336106c3c5fc3f0714 +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/d/2/d2865ef8fc01c40e9fd82977fde2c8378fad0b12 +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/f/b/fbe448ebfc3eb2d4e308f6b8b043666f5b57235e +0 -0
- package/android/.idea/sonarlint/securityhotspotstore/index.pb +0 -13
- package/android/.idea/vcs.xml +0 -6
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +0 -7
- package/android/gradlew +0 -291
- package/android/gradlew.bat +0 -91
- package/android/local.properties +0 -8
- package/ios/FulaModule.h +0 -10
- package/ios/FulaModule.m +0 -149
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAccount","seed","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","checkAccountExists","account","createPool","poolName","listPools","joinPool","poolID","leavePool","cancelPoolJoin","listPoolJoinRequests","votePoolJoinRequest","accept","newReplicationRequest","replicationFactor","cid","newStoreRequest","uploader","listAvailableReplicationRequests","removeReplicationRequest","removeStorer","storer","removeStoredReplication","bloxFreeSpace"],"sources":["blockchain.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\nimport type * as BType from '../types/blockchain';\r\n\r\n/*\r\ncreateAccount: This function takes a seed argument, which is used to create an account. The seed must start with \"/\". The function returns a promise of an object that contains the seed and the account that was created.\r\n*/\r\nexport const createAccount = (\r\n seed: string //seed that is used to create the account. It must start with \"/\"\r\n): Promise<BType.SeededResponse> => {\r\n console.log('createAccount in react-native started', seed);\r\n let res = Fula.createAccount(seed)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.SeededResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncheckAccountExists: This function takes an account argument, and returns a promise of an object that contains the account and a boolean exists flag. If exists is true, it means the account exists, otherwise, the account does not exist\r\n*/\r\nexport const checkAccountExists = (\r\n account: string\r\n): Promise<BType.AccountExistsResponse> => {\r\n console.log('checkAccountExists in react-native started', account);\r\n let res = Fula.checkAccountExists(account)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.AccountExistsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\ncreatePool: This function takes two arguments: seed and poolName. The seed is used to identify the account that is creating the pool, and the poolName is the name of the pool being created. The function returns a promise of an object that contains the owner of the pool and the poolID of the created pool.\r\n*/\r\nexport const createPool = (\r\n seed: string,\r\n poolName: string\r\n): Promise<BType.PoolCreateResponse> => {\r\n console.log('createPool in react-native started', seed, poolName);\r\n let res = Fula.createPool(seed, poolName)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCreateResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n listPools: This function takes no arguments and returns a promise of an object that contains a list of pools. Each pool in the list contains the poolID, owner, poolName, parent, and participants of the pool\r\n */\r\nexport const listPools = (): Promise<BType.PoolListResponse> => {\r\n console.log('listPools in react-native started');\r\n let res = Fula.listPools()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolListResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n joinPool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is joining the pool, and the poolID is the ID of the pool the account is joining. The function returns a promise of an object that contains the account joining the pool and the poolID of the joined pool.\r\n */\r\n\r\nexport const joinPool = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolJoinResponse> => {\r\n console.log('joinPool in react-native started', seed, poolID);\r\n let res = Fula.joinPool(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n leavePool: This function takes two arguments: seed and poolID. The seed is used to identify the account that is leaving the pool, and the poolID is the ID of the pool the account is leaving. The function returns a promise of an object that contains the `\r\n */\r\n\r\nexport const leavePool = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolLeaveResponse> => {\r\n console.log('leavePool in react-native started', seed, poolID);\r\n let res = Fula.leavePool(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolLeaveResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\nexport const cancelPoolJoin = (\r\n seed: string,\r\n poolID: number\r\n): Promise<BType.PoolCancelJoinResponse> => {\r\n console.log('cancelPoolJoin in react-native started', seed, poolID);\r\n let res = Fula.cancelPoolJoin(seed, poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolCancelJoinResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\nexport const listPoolJoinRequests = (\r\n poolID: number\r\n): Promise<BType.PoolRequestsResponse> => {\r\n console.log('listPoolJoinRequests in react-native started', poolID);\r\n let res = Fula.listPoolJoinRequests(poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolRequestsResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n seed is used to authorize the request.\r\npoolID is the ID of the pool in which the account is requesting to join.\r\naccount is the account that is requesting to join the pool.\r\naccept is a boolean value that indicates whether to accept or reject the join request.\r\nIt returns a promise of BType.PoolVoteResponse which includes the account and poolID\r\n*/\r\nexport const votePoolJoinRequest = (\r\n seed: string,\r\n poolID: number,\r\n account: string,\r\n accept: boolean\r\n): Promise<BType.PoolVoteResponse> => {\r\n console.log(\r\n 'votePoolJoinRequest in react-native started',\r\n seed,\r\n poolID,\r\n account,\r\n accept\r\n );\r\n let res = Fula.votePoolJoinRequest(seed, poolID, account, accept)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.PoolVoteResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nreplicationFactor is the number of copies of the content to be stored.\r\ncid is the content identifier of the content to be replicated.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n */\r\nexport const newReplicationRequest = (\r\n seed: string,\r\n poolID: number,\r\n replicationFactor: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n replicationFactor,\r\n cid\r\n );\r\n let res = Fula.newReplicationRequest(seed, poolID, replicationFactor, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is used to authorize the request.\r\npoolID is the ID of the pool in which the replication request is made.\r\nuploader is the account of the user making the request\r\ncid is the content identifier of the content to be stored.\r\nIt returns a promise of BType.ManifestUploadResponse which includes the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const newStoreRequest = (\r\n seed: string,\r\n poolID: number,\r\n uploader: string,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'newStoreRequest in react-native started',\r\n seed,\r\n poolID,\r\n uploader,\r\n cid\r\n );\r\n let res = Fula.newStoreRequest(seed, poolID, uploader, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes one argument:\r\n\r\npoolID is the ID of the pool for which the replication requests are listed\r\nIt returns a promise of BType.ManifestUploadResponse[] which is an array of the replication requests, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const listAvailableReplicationRequests = (\r\n poolID: number\r\n): Promise<BType.ManifestUploadResponse[]> => {\r\n console.log(\r\n 'listAvailableReplicationRequests in react-native started',\r\n poolID\r\n );\r\n let res = Fula.listAvailableReplicationRequests(poolID)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse[] = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes three arguments:\r\n\r\nseed is the seed of the account that is removing the replication request\r\npoolID is the ID of the pool for which the replication request is being removed\r\ncid is the content ID of the replication request being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the removed replication request, including the uploader, storage, ManifestMetadata, and poolID\r\n*/\r\nexport const removeReplicationRequest = (\r\n seed: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeReplicationRequest in react-native started',\r\n seed,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeReplicationRequest(seed, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the storer\r\nstorer is the address of the storer that is being removed\r\npoolID is the ID of the pool for which the storer is being removed\r\ncid is the content ID of the replication request for which the storer is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the storer has been removed.\r\n*/\r\nexport const removeStorer = (\r\n seed: string,\r\n storer: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStorer in react-native started',\r\n seed,\r\n storer,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStorer(seed, storer, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\nIt takes four arguments:\r\n\r\nseed is the seed of the account that is removing the stored replication\r\nuploader is the address of the uploader that is being removed\r\npoolID is the ID of the pool for which the stored replication is being removed\r\ncid is the content ID of the replication request for which the stored replication is being removed\r\nIt returns a promise of BType.ManifestUploadResponse which is the replication request, including the uploader, storage, ManifestMetadata, and poolID after the stored replication has been removed.\r\n*/\r\nexport const removeStoredReplication = (\r\n seed: string,\r\n uploader: string,\r\n poolID: number,\r\n cid: string\r\n): Promise<BType.ManifestUploadResponse> => {\r\n console.log(\r\n 'removeStoredReplication in react-native started',\r\n seed,\r\n uploader,\r\n poolID,\r\n cid\r\n );\r\n let res = Fula.removeStoredReplication(seed, uploader, poolID, cid)\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.ManifestUploadResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n\r\n/*\r\n bloxFreeSpace: This function takes no arguments and returns a promise of an object that contains the blox free space information.\r\n */\r\nexport const bloxFreeSpace = (): Promise<BType.BloxFreeSpaceResponse> => {\r\n console.log('bloxFreeSpace in react-native started');\r\n let res = Fula.bloxFreeSpace()\r\n .then((res) => {\r\n try {\r\n let jsonRes: BType.BloxFreeSpaceResponse = JSON.parse(res);\r\n return jsonRes;\r\n } catch (e) {\r\n try {\r\n return JSON.parse(res);\r\n } catch (e) {\r\n return res;\r\n }\r\n }\r\n })\r\n .catch((err) => {\r\n return err;\r\n });\r\n return res;\r\n};\r\n"],"mappings":";;;;;;AAAA;AAAkD;AAGlD;AACA;AACA;AACO,MAAMA,aAAa,GACxBC,IAAY,IACsB;EAClCC,OAAO,CAACC,GAAG,CAAC,uCAAuC,EAAEF,IAAI,CAAC;EAC1D,IAAIG,GAAG,GAAGC,yBAAI,CAACL,aAAa,CAACC,IAAI,CAAC,CAC/BK,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACnD,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAO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,CAAC;MAC1D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_fulaNativeModule","_interopRequireDefault","require","obj","__esModule","default","createAccount","seed","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","exports","checkAccountExists","account","createPool","poolName","listPools","joinPool","poolID","leavePool","cancelPoolJoin","listPoolJoinRequests","votePoolJoinRequest","accept","newReplicationRequest","replicationFactor","cid","newStoreRequest","uploader","listAvailableReplicationRequests","removeReplicationRequest","removeStorer","storer","removeStoredReplication","bloxFreeSpace"],"sourceRoot":"../../../src","sources":["protocols/blockchain.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlD;AACA;AACA;AACO,MAAMG,aAAa,GACxBC,IAAY,IACsB;EAClCC,OAAO,CAACC,GAAG,CAAC,uCAAuC,EAAEF,IAAI,CAAC;EAC1D,IAAIG,GAAG,GAAGC,yBAAI,CAACL,aAAa,CAACC,IAAI,CAAC,CAC/BK,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACnD,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,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AAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;;AAED;AACA;AACA;AAFAS,OAAA,CAAAsB,uBAAA,GAAAA,uBAAA;AAGO,MAAMC,aAAa,GAAGA,CAAA,KAA4C;EACvElC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGC,yBAAI,CAAC+B,aAAa,CAAC,CAAC,CAC3B9B,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAC1D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;AAACS,OAAA,CAAAuB,aAAA,GAAAA,aAAA"}
|
|
@@ -7,6 +7,8 @@ exports.listPools = exports.init = exports.disconnectApi = exports.checkJoinRequ
|
|
|
7
7
|
var _apiLookup = _interopRequireDefault(require("../interfaces/api-lookup"));
|
|
8
8
|
var _api = require("@polkadot/api");
|
|
9
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
//import { Keyring } from '@polkadot/keyring';
|
|
11
|
+
|
|
10
12
|
const types = {
|
|
11
13
|
FulaPoolPool: _apiLookup.default.FulaPoolPool
|
|
12
14
|
};
|
|
@@ -77,6 +79,10 @@ const listPools = async function (api) {
|
|
|
77
79
|
if (api === undefined) {
|
|
78
80
|
api = await init();
|
|
79
81
|
}
|
|
82
|
+
// Type guard to assure TypeScript that api is not undefined
|
|
83
|
+
if (!api || !api.query || !api.query.pool || !api.query.pool.lastPoolId || !api.query.pool.pools) {
|
|
84
|
+
throw new Error('Failed to initialize api or api.query.pool');
|
|
85
|
+
}
|
|
80
86
|
const pools = {
|
|
81
87
|
pools: []
|
|
82
88
|
};
|
|
@@ -111,6 +117,10 @@ const checkJoinRequest = async (api, poolId, accountId) => {
|
|
|
111
117
|
if (api === undefined) {
|
|
112
118
|
api = await init();
|
|
113
119
|
}
|
|
120
|
+
// Type guard to assure TypeScript that api is not undefined
|
|
121
|
+
if (!api || !api.query || !api.query.pool || !api.query.pool.poolRequests) {
|
|
122
|
+
throw new Error('Failed to initialize api or api.query.pool');
|
|
123
|
+
}
|
|
114
124
|
const poolRequest = await api.query.pool.poolRequests(poolId, accountId);
|
|
115
125
|
if (poolRequest != null) {
|
|
116
126
|
let formattedPoolRequest = JSON.parse(JSON.stringify(poolRequest.toHuman()));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["types","FulaPoolPool","EventTypes","init","wsAddress","provider","WsProvider","api","ApiPromise","create","catch","err","console","log","Promise","reject","disconnectApi","disconnect","listPools","start","
|
|
1
|
+
{"version":3,"names":["_apiLookup","_interopRequireDefault","require","_api","obj","__esModule","default","types","FulaPoolPool","EventTypes","init","wsAddress","arguments","length","undefined","provider","WsProvider","api","ApiPromise","create","catch","err","console","log","Promise","reject","exports","disconnectApi","disconnect","listPools","start","query","pool","lastPoolId","pools","Error","finalReturnedId","Number","toHuman","i","poolInfo","formattedPoolInfo","JSON","parse","stringify","push","resolve","checkJoinRequest","poolId","accountId","poolRequests","poolRequest","formattedPoolRequest"],"sourceRoot":"../../../src","sources":["protocols/chain-api.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAAuD,SAAAD,uBAAAG,GAAA,WAAAA,GAAA,I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,MAAM,CAACJ,GAAG,CAAC;EAC5B;AACF,CAAC;AAACK,OAAA,CAAAqB,gBAAA,GAAAA,gBAAA"}
|
|
@@ -6,11 +6,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.writeFileContent = exports.writeFile = exports.testData = exports.shutdown = exports.setAuth = exports.rm = exports.readFileContent = exports.readFile = exports.put = exports.push = exports.newClient = exports.mv = exports.mkdir = exports.ls = exports.logout = exports.listFailedActions = exports.isReady = exports.init = exports.has = exports.get = exports.cp = exports.checkFailedActions = exports.checkConnection = void 0;
|
|
7
7
|
var _fulaNativeModule = _interopRequireDefault(require("../interfaces/fulaNativeModule"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
/**
|
|
10
|
-
* Get gets the value corresponding to the given key from the local datastore.
|
|
11
|
-
// The key must be a valid ipld.Link.
|
|
12
|
-
* @param config
|
|
13
|
-
* @returns boolean
|
|
9
|
+
/**
|
|
10
|
+
* Get gets the value corresponding to the given key from the local datastore.
|
|
11
|
+
// The key must be a valid ipld.Link.
|
|
12
|
+
* @param config
|
|
13
|
+
* @returns boolean
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
16
|
const init = function (identity, storePath, bloxAddr, exchange) {
|
|
@@ -19,14 +19,14 @@ const init = function (identity, storePath, bloxAddr, exchange) {
|
|
|
19
19
|
let useRelay = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : true;
|
|
20
20
|
let refresh = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : false;
|
|
21
21
|
console.log('init in react-native started', identity, storePath, bloxAddr, exchange, autoFlush, useRelay);
|
|
22
|
-
return _fulaNativeModule.default.
|
|
22
|
+
return _fulaNativeModule.default.initFula(identity, storePath, bloxAddr, exchange, autoFlush, rootCid, useRelay, refresh);
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
/**
|
|
26
|
-
* Get gets the value corresponding to the given key from the local datastore.
|
|
27
|
-
// The key must be a valid ipld.Link.
|
|
28
|
-
* @param config
|
|
29
|
-
* @returns boolean
|
|
25
|
+
/**
|
|
26
|
+
* Get gets the value corresponding to the given key from the local datastore.
|
|
27
|
+
// The key must be a valid ipld.Link.
|
|
28
|
+
* @param config
|
|
29
|
+
* @returns boolean
|
|
30
30
|
*/
|
|
31
31
|
exports.init = init;
|
|
32
32
|
const newClient = function (identity, storePath, bloxAddr, exchange) {
|
|
@@ -37,18 +37,18 @@ const newClient = function (identity, storePath, bloxAddr, exchange) {
|
|
|
37
37
|
return _fulaNativeModule.default.newClient(identity, storePath, bloxAddr, exchange, autoFlush, useRelay, refresh);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
-
/**
|
|
41
|
-
* rm removes all data
|
|
42
|
-
* @param path
|
|
43
|
-
* @returns string: new cid of the root
|
|
40
|
+
/**
|
|
41
|
+
* rm removes all data
|
|
42
|
+
* @param path
|
|
43
|
+
* @returns string: new cid of the root
|
|
44
44
|
*/
|
|
45
45
|
exports.newClient = newClient;
|
|
46
46
|
const logout = (identity, storePath) => {
|
|
47
47
|
return _fulaNativeModule.default.logout(identity, storePath);
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
/**
|
|
51
|
-
* Checks if there are any un-synced changes on the device
|
|
50
|
+
/**
|
|
51
|
+
* Checks if there are any un-synced changes on the device
|
|
52
52
|
*/
|
|
53
53
|
exports.logout = logout;
|
|
54
54
|
const checkFailedActions = function () {
|
|
@@ -57,8 +57,8 @@ const checkFailedActions = function () {
|
|
|
57
57
|
return _fulaNativeModule.default.checkFailedActions(retry, timeout);
|
|
58
58
|
};
|
|
59
59
|
|
|
60
|
-
/**
|
|
61
|
-
* Lists the cids that failed to be sent to backend and are kept only locally
|
|
60
|
+
/**
|
|
61
|
+
* Lists the cids that failed to be sent to backend and are kept only locally
|
|
62
62
|
*/
|
|
63
63
|
exports.checkFailedActions = checkFailedActions;
|
|
64
64
|
const listFailedActions = function () {
|
|
@@ -66,8 +66,8 @@ const listFailedActions = function () {
|
|
|
66
66
|
return _fulaNativeModule.default.listFailedActions(cids);
|
|
67
67
|
};
|
|
68
68
|
|
|
69
|
-
/**
|
|
70
|
-
* Checks if there are any un-synced changes on the device
|
|
69
|
+
/**
|
|
70
|
+
* Checks if there are any un-synced changes on the device
|
|
71
71
|
*/
|
|
72
72
|
exports.listFailedActions = listFailedActions;
|
|
73
73
|
const checkConnection = function () {
|
|
@@ -75,34 +75,34 @@ const checkConnection = function () {
|
|
|
75
75
|
return _fulaNativeModule.default.checkConnection(timeout);
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
/**
|
|
79
|
-
* Get gets the value corresponding to the given key from the local datastore.
|
|
80
|
-
// The key must be a valid ipld.Link.
|
|
81
|
-
* @param key
|
|
82
|
-
* @returns value
|
|
78
|
+
/**
|
|
79
|
+
* Get gets the value corresponding to the given key from the local datastore.
|
|
80
|
+
// The key must be a valid ipld.Link.
|
|
81
|
+
* @param key
|
|
82
|
+
* @returns value
|
|
83
83
|
*/
|
|
84
84
|
exports.checkConnection = checkConnection;
|
|
85
85
|
const get = key => {
|
|
86
86
|
return _fulaNativeModule.default.get(key);
|
|
87
87
|
};
|
|
88
88
|
|
|
89
|
-
/**
|
|
90
|
-
* Has checks whether the value corresponding to the given key is present in the local datastore.
|
|
91
|
-
// The key must be a valid ipld.Link.
|
|
92
|
-
* @param key
|
|
93
|
-
* @returns boolean
|
|
89
|
+
/**
|
|
90
|
+
* Has checks whether the value corresponding to the given key is present in the local datastore.
|
|
91
|
+
// The key must be a valid ipld.Link.
|
|
92
|
+
* @param key
|
|
93
|
+
* @returns boolean
|
|
94
94
|
*/
|
|
95
95
|
exports.get = get;
|
|
96
96
|
const has = key => {
|
|
97
97
|
return _fulaNativeModule.default.has(key);
|
|
98
98
|
};
|
|
99
99
|
|
|
100
|
-
/**
|
|
101
|
-
* Push requests the given addr to download the root cid from this node.
|
|
102
|
-
// The addr must be a valid multiaddr that includes peer ID.
|
|
103
|
-
// this function.
|
|
104
|
-
* @param addr
|
|
105
|
-
* @returns null or error
|
|
100
|
+
/**
|
|
101
|
+
* Push requests the given addr to download the root cid from this node.
|
|
102
|
+
// The addr must be a valid multiaddr that includes peer ID.
|
|
103
|
+
// this function.
|
|
104
|
+
* @param addr
|
|
105
|
+
* @returns null or error
|
|
106
106
|
*/
|
|
107
107
|
exports.has = has;
|
|
108
108
|
const push = () => {
|
|
@@ -115,56 +115,56 @@ const testData = (identity, bloxAddr) => {
|
|
|
115
115
|
return _fulaNativeModule.default.testData(identity, bloxAddr);
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
-
/**
|
|
119
|
-
* Put stores the given key value onto the local datastore.
|
|
120
|
-
// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
|
|
121
|
-
// to the given key.
|
|
122
|
-
* @param key, value
|
|
123
|
-
* @returns null or string
|
|
118
|
+
/**
|
|
119
|
+
* Put stores the given key value onto the local datastore.
|
|
120
|
+
// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding
|
|
121
|
+
// to the given key.
|
|
122
|
+
* @param key, value
|
|
123
|
+
* @returns null or string
|
|
124
124
|
*/
|
|
125
125
|
exports.testData = testData;
|
|
126
126
|
const put = (value, codec) => {
|
|
127
127
|
return _fulaNativeModule.default.put(value, codec);
|
|
128
128
|
};
|
|
129
129
|
|
|
130
|
-
/**
|
|
131
|
-
* mkdir creates a directory at the given path.
|
|
132
|
-
* @param path
|
|
133
|
-
* @returns string: new cid of the root
|
|
130
|
+
/**
|
|
131
|
+
* mkdir creates a directory at the given path.
|
|
132
|
+
* @param path
|
|
133
|
+
* @returns string: new cid of the root
|
|
134
134
|
*/
|
|
135
135
|
exports.put = put;
|
|
136
136
|
const mkdir = path => {
|
|
137
137
|
return _fulaNativeModule.default.mkdir(path);
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
-
/**
|
|
141
|
-
* writeFileContent writes content at a given path
|
|
142
|
-
* @param path
|
|
143
|
-
* @returns string: new cid of the root
|
|
140
|
+
/**
|
|
141
|
+
* writeFileContent writes content at a given path
|
|
142
|
+
* @param path
|
|
143
|
+
* @returns string: new cid of the root
|
|
144
144
|
*/
|
|
145
145
|
exports.mkdir = mkdir;
|
|
146
146
|
const writeFileContent = (path, content) => {
|
|
147
147
|
return _fulaNativeModule.default.writeFileContent(path, content);
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
-
/*
|
|
151
|
-
// reads content of the file form localFilename (should include full absolute path to local file with read permission
|
|
152
|
-
// writes content to the specified location by fulaTargetFilename in Fula filesystem
|
|
153
|
-
// It keeps the original file modiifcation date
|
|
154
|
-
// fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
|
|
155
|
-
// localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
|
|
156
|
-
// Returns: new cid of the root after this file is placed in the tree
|
|
150
|
+
/*
|
|
151
|
+
// reads content of the file form localFilename (should include full absolute path to local file with read permission
|
|
152
|
+
// writes content to the specified location by fulaTargetFilename in Fula filesystem
|
|
153
|
+
// It keeps the original file modiifcation date
|
|
154
|
+
// fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
|
|
155
|
+
// localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
|
|
156
|
+
// Returns: new cid of the root after this file is placed in the tree
|
|
157
157
|
*/
|
|
158
158
|
exports.writeFileContent = writeFileContent;
|
|
159
159
|
const writeFile = (fulaTargetFilename, localFilename) => {
|
|
160
160
|
return _fulaNativeModule.default.writeFile(fulaTargetFilename, localFilename);
|
|
161
161
|
};
|
|
162
162
|
|
|
163
|
-
/**
|
|
164
|
-
* ls lists the name of files and folders at a given path
|
|
165
|
-
* @param path
|
|
166
|
-
* @returns string: list of items
|
|
167
|
-
* TODO: Findout how is the string and convert to array
|
|
163
|
+
/**
|
|
164
|
+
* ls lists the name of files and folders at a given path
|
|
165
|
+
* @param path
|
|
166
|
+
* @returns string: list of items
|
|
167
|
+
* TODO: Findout how is the string and convert to array
|
|
168
168
|
*/
|
|
169
169
|
exports.writeFile = writeFile;
|
|
170
170
|
const ls = path => {
|
|
@@ -196,84 +196,84 @@ const ls = path => {
|
|
|
196
196
|
});
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
/**
|
|
200
|
-
* rm removes all files and folders at a given path
|
|
201
|
-
* @param path
|
|
202
|
-
* @returns string: new cid of the root
|
|
199
|
+
/**
|
|
200
|
+
* rm removes all files and folders at a given path
|
|
201
|
+
* @param path
|
|
202
|
+
* @returns string: new cid of the root
|
|
203
203
|
*/
|
|
204
204
|
exports.ls = ls;
|
|
205
205
|
const rm = path => {
|
|
206
206
|
return _fulaNativeModule.default.rm(path);
|
|
207
207
|
};
|
|
208
208
|
|
|
209
|
-
/**
|
|
210
|
-
* cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
|
|
211
|
-
* @param sourcePath, targetPath
|
|
212
|
-
* @returns string: new cid of the root
|
|
209
|
+
/**
|
|
210
|
+
* cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
|
|
211
|
+
* @param sourcePath, targetPath
|
|
212
|
+
* @returns string: new cid of the root
|
|
213
213
|
*/
|
|
214
214
|
exports.rm = rm;
|
|
215
215
|
const cp = (sourcePath, targetPath) => {
|
|
216
216
|
return _fulaNativeModule.default.cp(sourcePath, targetPath);
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
/**
|
|
220
|
-
* mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
|
|
221
|
-
* @param sourcePath, targetPath
|
|
222
|
-
* @returns string: new cid of the root
|
|
219
|
+
/**
|
|
220
|
+
* mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already
|
|
221
|
+
* @param sourcePath, targetPath
|
|
222
|
+
* @returns string: new cid of the root
|
|
223
223
|
*/
|
|
224
224
|
exports.cp = cp;
|
|
225
225
|
const mv = (sourcePath, targetPath) => {
|
|
226
226
|
return _fulaNativeModule.default.mv(sourcePath, targetPath);
|
|
227
227
|
};
|
|
228
228
|
|
|
229
|
-
/*
|
|
230
|
-
// reads content of the file form localFilename (should include full absolute path to local file with read permission
|
|
231
|
-
// writes content to the specified location by fulaTargetFilename in Fula filesystem
|
|
232
|
-
// fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
|
|
233
|
-
// localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
|
|
234
|
-
// Returns: new cid of the root after this file is placed in the tree
|
|
229
|
+
/*
|
|
230
|
+
// reads content of the file form localFilename (should include full absolute path to local file with read permission
|
|
231
|
+
// writes content to the specified location by fulaTargetFilename in Fula filesystem
|
|
232
|
+
// fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)
|
|
233
|
+
// localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)
|
|
234
|
+
// Returns: new cid of the root after this file is placed in the tree
|
|
235
235
|
*/
|
|
236
236
|
exports.mv = mv;
|
|
237
237
|
const readFile = (fulaTargetFilename, localFilename) => {
|
|
238
238
|
return _fulaNativeModule.default.readFile(fulaTargetFilename, localFilename);
|
|
239
239
|
};
|
|
240
240
|
|
|
241
|
-
/**
|
|
242
|
-
* readFile reads content of a given path
|
|
243
|
-
* @param path
|
|
244
|
-
* @returns string: cotent
|
|
241
|
+
/**
|
|
242
|
+
* readFile reads content of a given path
|
|
243
|
+
* @param path
|
|
244
|
+
* @returns string: cotent
|
|
245
245
|
*/
|
|
246
246
|
exports.readFile = readFile;
|
|
247
247
|
const readFileContent = path => {
|
|
248
248
|
return _fulaNativeModule.default.readFileContent(path);
|
|
249
249
|
};
|
|
250
250
|
|
|
251
|
-
/**
|
|
252
|
-
* Shutdown closes all resources used by Client.
|
|
253
|
-
// After calling this function Client must be discarded.
|
|
254
|
-
* @param
|
|
255
|
-
* @returns
|
|
251
|
+
/**
|
|
252
|
+
* Shutdown closes all resources used by Client.
|
|
253
|
+
// After calling this function Client must be discarded.
|
|
254
|
+
* @param
|
|
255
|
+
* @returns
|
|
256
256
|
*/
|
|
257
257
|
exports.readFileContent = readFileContent;
|
|
258
258
|
const shutdown = () => {
|
|
259
259
|
return _fulaNativeModule.default.shutdown();
|
|
260
260
|
};
|
|
261
261
|
|
|
262
|
-
/**
|
|
263
|
-
* setAuth adds or removes a peer from the list of peers that are allowed to push to this node.
|
|
264
|
-
* This can only be called on a peer that is added as an owner of blox by --authorizer parameter
|
|
265
|
-
* @param peerId, allow
|
|
266
|
-
* @returns boolean: true if successful or false if not
|
|
262
|
+
/**
|
|
263
|
+
* setAuth adds or removes a peer from the list of peers that are allowed to push to this node.
|
|
264
|
+
* This can only be called on a peer that is added as an owner of blox by --authorizer parameter
|
|
265
|
+
* @param peerId, allow
|
|
266
|
+
* @returns boolean: true if successful or false if not
|
|
267
267
|
*/
|
|
268
268
|
exports.shutdown = shutdown;
|
|
269
269
|
const setAuth = (peerId, allow) => {
|
|
270
270
|
return _fulaNativeModule.default.setAuth(peerId, allow);
|
|
271
271
|
};
|
|
272
272
|
|
|
273
|
-
/**
|
|
274
|
-
* isReady checks if the connection is ready to be used.
|
|
275
|
-
* @param filesystemCheck: also check if the wnfs is ready
|
|
276
|
-
* @returns boolean: true if ready or false if not
|
|
273
|
+
/**
|
|
274
|
+
* isReady checks if the connection is ready to be used.
|
|
275
|
+
* @param filesystemCheck: also check if the wnfs is ready
|
|
276
|
+
* @returns boolean: true if ready or false if not
|
|
277
277
|
*/
|
|
278
278
|
exports.setAuth = setAuth;
|
|
279
279
|
const isReady = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["init","identity","storePath","bloxAddr","exchange","autoFlush","rootCid","useRelay","refresh","console","log","Fula","newClient","logout","checkFailedActions","retry","timeout","listFailedActions","cids","checkConnection","get","key","has","push","testData","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown","setAuth","peerId","allow","isReady","filesystemCheck"],"sources":["fula.ts"],"sourcesContent":["import Fula from '../interfaces/fulaNativeModule';\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param config\r\n * @returns boolean\r\n */\r\n\r\nexport const init = (\r\n identity: string, //privateKey of did identity\r\n storePath: string,\r\n bloxAddr: string,\r\n exchange: string,\r\n autoFlush: boolean = false,\r\n rootCid: string | null = null,\r\n useRelay: boolean = true,\r\n refresh: boolean = false\r\n): Promise<{ peerId: string; rootCid: string }> => {\r\n console.log(\r\n 'init in react-native started',\r\n identity,\r\n storePath,\r\n bloxAddr,\r\n exchange,\r\n autoFlush,\r\n useRelay\r\n );\r\n return Fula.init(\r\n identity,\r\n storePath,\r\n bloxAddr,\r\n exchange,\r\n autoFlush,\r\n rootCid,\r\n useRelay,\r\n refresh\r\n );\r\n};\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param config\r\n * @returns boolean\r\n */\r\n\r\nexport const newClient = (\r\n identity: string, //privateKey of did identity\r\n storePath: string,\r\n bloxAddr: string,\r\n exchange: string,\r\n autoFlush: boolean = false,\r\n useRelay: boolean = true,\r\n refresh: boolean = false\r\n): Promise<string> => {\r\n console.log(\r\n 'newClient in react-native started',\r\n identity,\r\n storePath,\r\n bloxAddr,\r\n exchange,\r\n autoFlush,\r\n useRelay,\r\n refresh\r\n );\r\n return Fula.newClient(\r\n identity,\r\n storePath,\r\n bloxAddr,\r\n exchange,\r\n autoFlush,\r\n useRelay,\r\n refresh\r\n );\r\n};\r\n\r\n/**\r\n * rm removes all data\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const logout = (\r\n identity: string,\r\n storePath: string\r\n): Promise<boolean> => {\r\n return Fula.logout(identity, storePath);\r\n};\r\n\r\n/**\r\n * Checks if there are any un-synced changes on the device\r\n */\r\nexport const checkFailedActions = (\r\n retry: boolean = false,\r\n timeout: number = 20\r\n): Promise<boolean> => {\r\n return Fula.checkFailedActions(retry, timeout);\r\n};\r\n\r\n/**\r\n * Lists the cids that failed to be sent to backend and are kept only locally\r\n */\r\nexport const listFailedActions = (cids: string[] = []): Promise<string[]> => {\r\n return Fula.listFailedActions(cids);\r\n};\r\n\r\n/**\r\n * Checks if there are any un-synced changes on the device\r\n */\r\nexport const checkConnection = (timeout: number = 20): Promise<boolean> => {\r\n return Fula.checkConnection(timeout);\r\n};\r\n\r\n/**\r\n * Get gets the value corresponding to the given key from the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns value\r\n */\r\nexport const get = (key: string): Promise<string> => {\r\n return Fula.get(key);\r\n};\r\n\r\n/**\r\n * Has checks whether the value corresponding to the given key is present in the local datastore.\r\n// The key must be a valid ipld.Link.\r\n * @param key\r\n * @returns boolean\r\n */\r\nexport const has = (key: Uint8Array): Promise<boolean> => {\r\n return Fula.has(key);\r\n};\r\n\r\n/**\r\n * Push requests the given addr to download the root cid from this node.\r\n// The addr must be a valid multiaddr that includes peer ID.\r\n// this function.\r\n * @param addr\r\n * @returns null or error\r\n */\r\nexport const push = (): Promise<string> => {\r\n return Fula.push();\r\n};\r\n\r\n//This method sends some test data to backedn\r\nexport const testData = (\r\n identity: string,\r\n bloxAddr: string\r\n): Promise<string> => {\r\n return Fula.testData(identity, bloxAddr);\r\n};\r\n\r\n/**\r\n * Put stores the given key value onto the local datastore.\r\n// The key must be a valid ipld.Link and the value must be the valid encoded ipld.Node corresponding\r\n// to the given key.\r\n * @param key, value\r\n * @returns null or string\r\n */\r\nexport const put = (value: string, codec: string): Promise<string> => {\r\n return Fula.put(value, codec);\r\n};\r\n\r\n/**\r\n * mkdir creates a directory at the given path.\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const mkdir = (path: string): Promise<string> => {\r\n return Fula.mkdir(path);\r\n};\r\n\r\n/**\r\n * writeFileContent writes content at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const writeFileContent = (\r\n path: string,\r\n content: string\r\n): Promise<string> => {\r\n return Fula.writeFileContent(path, content);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // It keeps the original file modiifcation date\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\nexport const writeFile = (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n): Promise<string> => {\r\n return Fula.writeFile(fulaTargetFilename, localFilename);\r\n};\r\n\r\n/**\r\n * ls lists the name of files and folders at a given path\r\n * @param path\r\n * @returns string: list of items\r\n * TODO: Findout how is the string and convert to array\r\n */\r\nexport const ls = (path: string): Promise<void | JSON> => {\r\n return Fula.ls(path)\r\n .then((res) => {\r\n let lsResult = [];\r\n let lsRows = res.split('!!!');\r\n for (const element of lsRows) {\r\n let rowItems = element.split('???');\r\n if (rowItems && rowItems[0]) {\r\n let item = {\r\n name: '',\r\n created: '',\r\n modified: '',\r\n };\r\n item.name = rowItems[0];\r\n if (rowItems[1]) {\r\n item.created = rowItems[1];\r\n }\r\n if (rowItems[2]) {\r\n item.modified = rowItems[2];\r\n }\r\n lsResult.push(item);\r\n }\r\n }\r\n let jsonRes = JSON.parse(JSON.stringify(lsResult));\r\n return jsonRes;\r\n })\r\n .catch((e) => {\r\n return e;\r\n });\r\n};\r\n\r\n/**\r\n * rm removes all files and folders at a given path\r\n * @param path\r\n * @returns string: new cid of the root\r\n */\r\nexport const rm = (path: string): Promise<string> => {\r\n return Fula.rm(path);\r\n};\r\n\r\n/**\r\n * cp copies the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\r\n * @param sourcePath, targetPath\r\n * @returns string: new cid of the root\r\n */\r\nexport const cp = (sourcePath: string, targetPath: string): Promise<string> => {\r\n return Fula.cp(sourcePath, targetPath);\r\n};\r\n\r\n/**\r\n * mv moves the file or folder at the sourcePath to targetPath. targetPath is a folder that must exist already\r\n * @param sourcePath, targetPath\r\n * @returns string: new cid of the root\r\n */\r\nexport const mv = (sourcePath: string, targetPath: string): Promise<string> => {\r\n return Fula.mv(sourcePath, targetPath);\r\n};\r\n\r\n/*\r\n // reads content of the file form localFilename (should include full absolute path to local file with read permission\r\n // writes content to the specified location by fulaTargetFilename in Fula filesystem\r\n // fulaTargetFilename: a string including full path and filename of target file on Fula (e.g. root/pictures/cat.jpg)\r\n // localFilename: a string containing full path and filename of local file on hte device (e.g /usr/bin/cat.jpg)\r\n // Returns: new cid of the root after this file is placed in the tree\r\n */\r\nexport const readFile = (\r\n fulaTargetFilename: string,\r\n localFilename: string\r\n): Promise<string> => {\r\n return Fula.readFile(fulaTargetFilename, localFilename);\r\n};\r\n\r\n/**\r\n * readFile reads content of a given path\r\n * @param path\r\n * @returns string: cotent\r\n */\r\nexport const readFileContent = (path: string): Promise<string> => {\r\n return Fula.readFileContent(path);\r\n};\r\n\r\n/**\r\n * Shutdown closes all resources used by Client.\r\n// After calling this function Client must be discarded.\r\n * @param\r\n * @returns\r\n */\r\nexport const shutdown = (): Promise<void> => {\r\n return Fula.shutdown();\r\n};\r\n\r\n/**\r\n * setAuth adds or removes a peer from the list of peers that are allowed to push to this node.\r\n * This can only be called on a peer that is added as an owner of blox by --authorizer parameter\r\n * @param peerId, allow\r\n * @returns boolean: true if successful or false if not\r\n */\r\nexport const setAuth = (peerId: string, allow: boolean): Promise<boolean> => {\r\n return Fula.setAuth(peerId, allow);\r\n};\r\n\r\n/**\r\n * isReady checks if the connection is ready to be used.\r\n * @param filesystemCheck: also check if the wnfs is ready\r\n * @returns boolean: true if ready or false if not\r\n */\r\nexport const isReady = (filesystemCheck: boolean = true): Promise<boolean> => {\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,GAAG,MAAqB;EAC3C,OAAOjD,yBAAI,CAACiD,QAAQ,EAAE;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALA;AAMO,MAAMC,OAAO,GAAG,CAACC,MAAc,EAAEC,KAAc,KAAuB;EAC3E,OAAOpD,yBAAI,CAACkD,OAAO,CAACC,MAAM,EAAEC,KAAK,CAAC;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJA;AAKO,MAAMC,OAAO,GAAG,YAAuD;EAAA,IAAtDC,eAAwB,uEAAG,IAAI;EACrD,OAAOtD,yBAAI,CAACqD,OAAO,CAACC,eAAe,CAAC;AACtC,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_fulaNativeModule","_interopRequireDefault","require","obj","__esModule","default","init","identity","storePath","bloxAddr","exchange","autoFlush","arguments","length","undefined","rootCid","useRelay","refresh","console","log","Fula","initFula","exports","newClient","logout","checkFailedActions","retry","timeout","listFailedActions","cids","checkConnection","get","key","has","push","testData","put","value","codec","mkdir","path","writeFileContent","content","writeFile","fulaTargetFilename","localFilename","ls","then","res","lsResult","lsRows","split","element","rowItems","item","name","created","modified","jsonRes","JSON","parse","stringify","catch","e","rm","cp","sourcePath","targetPath","mv","readFile","readFileContent","shutdown","setAuth","peerId","allow","isReady","filesystemCheck"],"sourceRoot":"../../../src","sources":["protocols/fula.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElD;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMG,IAAI,GAAG,SAAAA,CAClBC,QAAgB,EAChBC,SAAiB,EACjBC,QAAgB,EAChBC,QAAgB,EAKiC;EAAA,IAJjDC,SAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAA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,CAAA,KAAqB;EAC3C,OAAOnD,yBAAI,CAACmD,QAAQ,CAAC,CAAC;AACxB,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AALAjD,OAAA,CAAAiD,QAAA,GAAAA,QAAA;AAMO,MAAMC,OAAO,GAAGA,CAACC,MAAc,EAAEC,KAAc,KAAuB;EAC3E,OAAOtD,yBAAI,CAACoD,OAAO,CAACC,MAAM,EAAEC,KAAK,CAAC;AACpC,CAAC;;AAED;AACA;AACA;AACA;AACA;AAJApD,OAAA,CAAAkD,OAAA,GAAAA,OAAA;AAKO,MAAMG,OAAO,GAAG,SAAAA,CAAA,EAAuD;EAAA,IAAtDC,eAAwB,GAAAhE,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,IAAI;EACrD,OAAOQ,yBAAI,CAACuD,OAAO,CAACC,eAAe,CAAC;AACtC,CAAC;AAACtD,OAAA,CAAAqD,OAAA,GAAAA,OAAA"}
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.wifiRemoveall = exports.reboot = void 0;
|
|
7
7
|
var _fulaNativeModule = _interopRequireDefault(require("../interfaces/fulaNativeModule"));
|
|
8
8
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
9
|
-
/**
|
|
10
|
-
* send a command to Blox hardware to remove all save wifis.
|
|
11
|
-
* @returns json{status:true if success, false if fails; msg: error message or success log}
|
|
9
|
+
/**
|
|
10
|
+
* send a command to Blox hardware to remove all save wifis.
|
|
11
|
+
* @returns json{status:true if success, false if fails; msg: error message or success log}
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
const wifiRemoveall = () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["wifiRemoveall","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","reboot"],"
|
|
1
|
+
{"version":3,"names":["_fulaNativeModule","_interopRequireDefault","require","obj","__esModule","default","wifiRemoveall","console","log","res","Fula","then","jsonRes","JSON","parse","e","catch","err","exports","reboot"],"sourceRoot":"../../../src","sources":["protocols/fxblox.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAkD,SAAAD,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAGlD;AACA;AACA;AACA;;AAEO,MAAMG,aAAa,GAAGA,CAAA,KAA4C;EACvEC,OAAO,CAACC,GAAG,CAAC,uCAAuC,CAAC;EACpD,IAAIC,GAAG,GAAGC,yBAAI,CAACJ,aAAa,CAAC,CAAC,CAC3BK,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAAoC,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MAC1D,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAEK,MAAMa,MAAM,GAAGA,CAAA,KAAqC;EACzDZ,OAAO,CAACC,GAAG,CAAC,gCAAgC,CAAC;EAC7C,IAAIC,GAAG,GAAGC,yBAAI,CAACS,MAAM,CAAC,CAAC,CACpBR,IAAI,CAAEF,GAAG,IAAK;IACb,IAAI;MACF,IAAIG,OAA6B,GAAGC,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACnD,OAAOG,OAAO;IAChB,CAAC,CAAC,OAAOG,CAAC,EAAE;MACV,IAAI;QACF,OAAOF,IAAI,CAACC,KAAK,CAACL,GAAG,CAAC;MACxB,CAAC,CAAC,OAAOM,CAAC,EAAE;QACV,OAAON,GAAG;MACZ;IACF;EACF,CAAC,CAAC,CACDO,KAAK,CAAEC,GAAG,IAAK;IACd,OAAOA,GAAG;EACZ,CAAC,CAAC;EACJ,OAAOR,GAAG;AACZ,CAAC;AAACS,OAAA,CAAAC,MAAA,GAAAA,MAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/blockchain.ts"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/fxblox.ts"],"mappings":""}
|
package/lib/module/index.js
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
export
|
|
5
|
-
import * as _chainApi from './protocols/chain-api';
|
|
6
|
-
export { _chainApi as chainApi };
|
|
7
|
-
import * as _fxblox from './protocols/fxblox';
|
|
8
|
-
export { _fxblox as fxblox };
|
|
1
|
+
export * as fula from './protocols/fula';
|
|
2
|
+
export * as blockchain from './protocols/blockchain';
|
|
3
|
+
export * as chainApi from './protocols/chain-api';
|
|
4
|
+
export * as fxblox from './protocols/fxblox';
|
|
9
5
|
//# sourceMappingURL=index.js.map
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fula","blockchain","chainApi","fxblox"],"
|
|
1
|
+
{"version":3,"names":["fula","blockchain","chainApi","fxblox"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":"AAAA,OAAO,KAAKA,IAAI,MAAM,kBAAkB;AACxC,OAAO,KAAKC,UAAU,MAAM,wBAAwB;AACpD,OAAO,KAAKC,QAAQ,MAAM,uBAAuB;AACjD,OAAO,KAAKC,MAAM,MAAM,oBAAoB"}
|