@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.
- package/LICENSE +20 -20
- package/README.md +226 -226
- package/android/build.gradle +1 -1
- package/android/gradle.properties +5 -5
- package/android/src/main/AndroidManifest.xml +3 -3
- package/android/src/main/AndroidManifestNew.xml +2 -2
- 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 +8 -6
- 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 +49 -49
- package/ios/Fula-Bridging-Header.h +3 -3
- package/ios/Fula.mm +166 -215
- package/ios/Fula.swift +1289 -1334
- package/ios/UserDataHelper.swift +143 -143
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-errors.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/commonjs/interfaces/augment-api.js.map +1 -1
- package/lib/commonjs/interfaces/augment-types.js.map +1 -1
- package/lib/commonjs/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/commonjs/interfaces/index.js.map +1 -1
- package/lib/commonjs/interfaces/lookup.js +278 -278
- package/lib/commonjs/interfaces/lookup.js.map +1 -1
- package/lib/commonjs/interfaces/registry.js.map +1 -1
- package/lib/commonjs/interfaces/types-lookup.js.map +1 -1
- package/lib/commonjs/interfaces/types.js.map +1 -1
- package/lib/commonjs/protocols/blockchain.js +6 -2
- package/lib/commonjs/protocols/blockchain.js.map +1 -1
- package/lib/commonjs/protocols/chain-api.js +39 -10
- package/lib/commonjs/protocols/chain-api.js.map +1 -1
- package/lib/commonjs/protocols/fula.js +128 -114
- 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.map +1 -1
- package/lib/module/interfaces/augment-api-errors.js.map +1 -1
- package/lib/module/interfaces/augment-api-rpc.js.map +1 -1
- package/lib/module/interfaces/augment-api-runtime.js.map +1 -1
- package/lib/module/interfaces/augment-api.js.map +1 -1
- package/lib/module/interfaces/augment-types.js.map +1 -1
- package/lib/module/interfaces/fulaNativeModule.js.map +1 -1
- package/lib/module/interfaces/index.js.map +1 -1
- package/lib/module/interfaces/lookup.js +278 -278
- package/lib/module/interfaces/lookup.js.map +1 -1
- package/lib/module/interfaces/registry.js.map +1 -1
- package/lib/module/interfaces/types-lookup.js.map +1 -1
- package/lib/module/interfaces/types.js.map +1 -1
- package/lib/module/protocols/blockchain.js +6 -2
- package/lib/module/protocols/blockchain.js.map +1 -1
- package/lib/module/protocols/chain-api.js +35 -8
- package/lib/module/protocols/chain-api.js.map +1 -1
- package/lib/module/protocols/fula.js +128 -114
- 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/interfaces/fulaNativeModule.d.ts +2 -2
- package/lib/typescript/protocols/chain-api.d.ts +4 -0
- package/lib/typescript/protocols/chain-api.d.ts.map +1 -1
- package/package.json +3 -2
- package/react-native-fula.podspec +47 -47
- package/src/index.tsx +4 -4
- package/src/interfaces/augment-api-errors.ts +449 -449
- package/src/interfaces/augment-api-rpc.ts +617 -617
- package/src/interfaces/augment-api-runtime.ts +224 -224
- package/src/interfaces/augment-api.ts +10 -10
- package/src/interfaces/augment-types.ts +1230 -1230
- package/src/interfaces/fulaNativeModule.ts +2 -2
- package/src/interfaces/index.ts +4 -4
- package/src/interfaces/lookup.ts +1889 -1889
- package/src/interfaces/registry.ts +152 -152
- package/src/interfaces/types-lookup.ts +2043 -2043
- package/src/interfaces/types.ts +3 -3
- package/src/protocols/blockchain.ts +2 -2
- package/src/protocols/chain-api.ts +19 -1
- package/src/protocols/fula.ts +427 -427
- package/src/protocols/fxblox.ts +70 -70
- package/src/types/fxblox.ts +13 -13
package/src/interfaces/types.ts
CHANGED
|
@@ -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
|
*/
|