@functionland/react-native-fula 1.39.2 → 1.41.1

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.
Files changed (86) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +226 -226
  3. package/android/build.gradle +1 -1
  4. package/android/gradle.properties +5 -5
  5. package/android/src/main/AndroidManifest.xml +3 -3
  6. package/android/src/main/AndroidManifestNew.xml +2 -2
  7. package/android/src/main/java/land/fx/fula/ConfigRef.java +7 -7
  8. package/android/src/main/java/land/fx/fula/Cryptography.java +62 -62
  9. package/android/src/main/java/land/fx/fula/FulaModule.java +8 -6
  10. package/android/src/main/java/land/fx/fula/FulaPackage.java +32 -32
  11. package/android/src/main/java/land/fx/fula/SharedPreferenceHelper.java +65 -65
  12. package/android/src/main/java/land/fx/fula/StaticHelper.java +13 -13
  13. package/android/src/main/java/land/fx/fula/ThreadUtils.java +42 -42
  14. package/ios/Cryptography.swift +49 -49
  15. package/ios/Fula-Bridging-Header.h +3 -3
  16. package/ios/Fula.mm +166 -215
  17. package/ios/Fula.swift +1289 -1334
  18. package/ios/UserDataHelper.swift +143 -143
  19. package/lib/commonjs/index.js.map +1 -1
  20. package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
  21. package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
  22. package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
  23. package/lib/commonjs/interfaces/augment-api.js.map +1 -1
  24. package/lib/commonjs/interfaces/augment-types.js.map +1 -1
  25. package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
  26. package/lib/commonjs/interfaces/index.js.map +1 -1
  27. package/lib/commonjs/interfaces/lookup.js +278 -278
  28. package/lib/commonjs/interfaces/lookup.js.map +1 -1
  29. package/lib/commonjs/interfaces/registry.js.map +1 -1
  30. package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
  31. package/lib/commonjs/interfaces/types.js.map +1 -1
  32. package/lib/commonjs/protocols/blockchain.js +6 -2
  33. package/lib/commonjs/protocols/blockchain.js.map +1 -1
  34. package/lib/commonjs/protocols/chain-api.js +39 -10
  35. package/lib/commonjs/protocols/chain-api.js.map +1 -1
  36. package/lib/commonjs/protocols/fula.js +128 -114
  37. package/lib/commonjs/protocols/fula.js.map +1 -1
  38. package/lib/commonjs/protocols/fxblox.js +3 -3
  39. package/lib/commonjs/protocols/fxblox.js.map +1 -1
  40. package/lib/commonjs/types/blockchain.js.map +1 -1
  41. package/lib/commonjs/types/fxblox.js.map +1 -1
  42. package/lib/module/index.js.map +1 -1
  43. package/lib/module/interfaces/augment-api-errors.js.map +1 -1
  44. package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
  45. package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
  46. package/lib/module/interfaces/augment-api.js.map +1 -1
  47. package/lib/module/interfaces/augment-types.js.map +1 -1
  48. package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
  49. package/lib/module/interfaces/index.js.map +1 -1
  50. package/lib/module/interfaces/lookup.js +278 -278
  51. package/lib/module/interfaces/lookup.js.map +1 -1
  52. package/lib/module/interfaces/registry.js.map +1 -1
  53. package/lib/module/interfaces/types-lookup.js.map +1 -1
  54. package/lib/module/interfaces/types.js.map +1 -1
  55. package/lib/module/protocols/blockchain.js +6 -2
  56. package/lib/module/protocols/blockchain.js.map +1 -1
  57. package/lib/module/protocols/chain-api.js +35 -8
  58. package/lib/module/protocols/chain-api.js.map +1 -1
  59. package/lib/module/protocols/fula.js +128 -114
  60. package/lib/module/protocols/fula.js.map +1 -1
  61. package/lib/module/protocols/fxblox.js +3 -3
  62. package/lib/module/protocols/fxblox.js.map +1 -1
  63. package/lib/module/types/blockchain.js.map +1 -1
  64. package/lib/module/types/fxblox.js.map +1 -1
  65. package/lib/typescript/interfaces/fulaNativeModule.d.ts +2 -2
  66. package/lib/typescript/protocols/chain-api.d.ts +4 -0
  67. package/lib/typescript/protocols/chain-api.d.ts.map +1 -1
  68. package/package.json +3 -2
  69. package/react-native-fula.podspec +47 -47
  70. package/src/index.tsx +4 -4
  71. package/src/interfaces/augment-api-errors.ts +449 -449
  72. package/src/interfaces/augment-api-rpc.ts +617 -617
  73. package/src/interfaces/augment-api-runtime.ts +224 -224
  74. package/src/interfaces/augment-api.ts +10 -10
  75. package/src/interfaces/augment-types.ts +1230 -1230
  76. package/src/interfaces/fulaNativeModule.ts +2 -2
  77. package/src/interfaces/index.ts +4 -4
  78. package/src/interfaces/lookup.ts +1889 -1889
  79. package/src/interfaces/registry.ts +152 -152
  80. package/src/interfaces/types-lookup.ts +2043 -2043
  81. package/src/interfaces/types.ts +3 -3
  82. package/src/protocols/blockchain.ts +2 -2
  83. package/src/protocols/chain-api.ts +19 -1
  84. package/src/protocols/fula.ts +427 -427
  85. package/src/protocols/fxblox.ts +70 -70
  86. package/src/types/fxblox.ts +13 -13
@@ -1,3 +1,3 @@
1
- // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
- /* eslint-disable */
3
-
1
+ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit
2
+ /* eslint-disable */
3
+
@@ -137,7 +137,7 @@ export const joinPool = (poolID: number): Promise<BType.PoolJoinResponse> => {
137
137
 
138
138
  export const leavePool = (poolID: number): Promise<BType.PoolLeaveResponse> => {
139
139
  console.log('leavePool in react-native started', poolID);
140
- let res1 = Fula.leavePool(poolID)
140
+ let res1 = Fula.leavePool(poolID.toString())
141
141
  .then((res) => {
142
142
  try {
143
143
  let jsonRes: BType.PoolLeaveResponse = JSON.parse(res);
@@ -160,7 +160,7 @@ export const cancelPoolJoin = (
160
160
  poolID: number
161
161
  ): Promise<BType.PoolCancelJoinResponse> => {
162
162
  console.log('cancelPoolJoin in react-native started', poolID);
163
- let res1 = Fula.cancelPoolJoin(poolID)
163
+ let res1 = Fula.cancelPoolJoin(poolID.toString())
164
164
  .then((res) => {
165
165
  try {
166
166
  let jsonRes: BType.PoolCancelJoinResponse = JSON.parse(res);
@@ -2,7 +2,7 @@ import { default as EventTypes } from '../interfaces/lookup';
2
2
 
3
3
  import { ApiPromise, WsProvider } from '@polkadot/api';
4
4
  import { Keyring } from '@polkadot/keyring';
5
- const { cryptoWaitReady } = require('@polkadot/util-crypto');
5
+ const { cryptoWaitReady, blake2AsHex } = require('@polkadot/util-crypto');
6
6
  import type * as BType from '../types/blockchain';
7
7
 
8
8
  const types = {
@@ -140,6 +140,24 @@ export const batchUploadManifest = async (
140
140
  }
141
141
  };
142
142
 
143
+ export const createHexSeedFromString = async (
144
+ seed: string
145
+ ): Promise<string> => {
146
+ await cryptoWaitReady(); // Ensure the crypto library is initialized
147
+ const seedHex = blake2AsHex(seed, 256); // Hash the input to a 32-byte hex string
148
+ return seedHex;
149
+ };
150
+
151
+ export const getLocalAccount = (seed: string): { account: string } => {
152
+ // Simple transaction
153
+ const keyring = new Keyring({ type: 'sr25519' });
154
+ const userKey = keyring.addFromUri(seed, { name: 'account' }, 'sr25519');
155
+ console.log(
156
+ `${userKey.meta.name}: has address ${userKey.address} with publicKey [${userKey.publicKey}]`
157
+ );
158
+ return { account: userKey.address };
159
+ };
160
+
143
161
  /*
144
162
  listPools: This function takes start index and length 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
145
163
  */