diff --git a/package-lock.json b/package-lock.json index fb87255f..d461cd98 100755 --- a/package-lock.json +++ b/package-lock.json @@ -1032,18 +1032,18 @@ "integrity": "sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg==" }, "@polkadot/api": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-0.79.1.tgz", - "integrity": "sha512-AXNT55vm8p93oVC8eXF0HMr5DHQsK+rOEbOUCAwgdfewz0aHUmyXDl7PjFRW2dLSQPj3gG4MHoj4Lw6F88lUBQ==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/api/-/api-0.82.0-beta.23.tgz", + "integrity": "sha512-/yMie1gKG9H4Y0/ia2+Un26xCJbvXaMIJjcf8vWsUvMBSSbl1bg/uorRW3FY6e43pb3UzKrv1CLkqN1AhAmK6A==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/api-derive": "^0.79.1", - "@polkadot/extrinsics": "^0.79.1", - "@polkadot/rpc-provider": "^0.79.1", - "@polkadot/rpc-rx": "^0.79.1", - "@polkadot/storage": "^0.79.1", - "@polkadot/types": "^0.79.1", - "@polkadot/util-crypto": "^0.91.1" + "@polkadot/api-derive": "^0.82.0-beta.23", + "@polkadot/extrinsics": "^0.82.0-beta.23", + "@polkadot/rpc-core": "^0.82.0-beta.23", + "@polkadot/rpc-provider": "^0.82.0-beta.23", + "@polkadot/storage": "^0.82.0-beta.23", + "@polkadot/types": "^0.82.0-beta.23", + "@polkadot/util-crypto": "^0.94.0-beta.4" }, "dependencies": { "@babel/runtime": { @@ -1053,22 +1053,17 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/api-derive": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-0.79.1.tgz", - "integrity": "sha512-VHIClyj9+7d32JfCI5JH6pPLIPT1gQMJiPsRtxmVdmvtySWE4njcJYVdcw/vvclCnljoNzvSAXp/fICSBnmkdA==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/api-derive/-/api-derive-0.82.0-beta.23.tgz", + "integrity": "sha512-ax9i8nmejG6GpaTh58NUKzwiRGF9qXOB45n+yZjpR8jM5WAtkGQN1tY9qmau2Vqm+meyggEA5t7hDvsj8s81KQ==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/api": "^0.79.1", - "@polkadot/types": "^0.79.1", + "@polkadot/api": "^0.82.0-beta.23", + "@polkadot/types": "^0.82.0-beta.23", "@types/memoizee": "^0.4.2", "memoizee": "^0.4.14" }, @@ -1080,22 +1075,17 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/extrinsics": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/extrinsics/-/extrinsics-0.79.1.tgz", - "integrity": "sha512-4OlVp8Crvnx8t4LimZFLOIexu54MA1quMr3YVwf8Kv7kbRCkeAScNaFg9mKnl7DHasTPRI4LR+bTEvfSqypxCA==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/extrinsics/-/extrinsics-0.82.0-beta.23.tgz", + "integrity": "sha512-qUXnJ2L1G7oSQhKBo26Nrl72XNAhs/cmrBebxgzSbbrbjZWy8LoOAn6JnmhflfDT/TCnDaQKBZP04OC68a/QkA==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/types": "^0.79.1", - "@polkadot/util": "^0.91.1" + "@polkadot/types": "^0.82.0-beta.23", + "@polkadot/util": "^0.94.0-beta.4" }, "dependencies": { "@babel/runtime": { @@ -1105,18 +1095,13 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/jsonrpc": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/jsonrpc/-/jsonrpc-0.79.1.tgz", - "integrity": "sha512-J7FhDQgcfii+1WG8wkBPa19BbwqmT5YRXGwrL+ZLelGnp9ypXJ4KJNMTspsmqIeoP9JE+6NIAS3vHoWM814cFw==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/jsonrpc/-/jsonrpc-0.82.0-beta.23.tgz", + "integrity": "sha512-DASPowM0XDgC8IE/OtKvJ5VnPmzuVB/gxLna7H1wctYCfQCi5Te79F4uOnh54XSu7D6uqBKtloyrtexBYTlVkA==", "requires": { "@babel/runtime": "^7.4.5" }, @@ -1128,22 +1113,17 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/keyring": { - "version": "0.91.1", - "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-0.91.1.tgz", - "integrity": "sha512-XYWbqWK8CAeuPFg1llS65r2sO7k2qTalJMHPQiaIVETPXQGx4SCzzMzBkD9eVvHTs9KfamynOQrspflhjHtgbg==", + "version": "0.93.1", + "resolved": "https://registry.npmjs.org/@polkadot/keyring/-/keyring-0.93.1.tgz", + "integrity": "sha512-sJ9E9AKcJASdnkbzBA1L773oPgXAkEF3LsUjpkaDTelPqzsky6hdyglj3oQpkCj6Oofd1BwJeonmqinIV8Fl4Q==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/util": "^0.91.1", - "@polkadot/util-crypto": "^0.91.1", + "@polkadot/util": "^0.93.1", + "@polkadot/util-crypto": "^0.93.1", "@types/bs58": "^4.0.0", "bs58": "^4.0.1" }, @@ -1156,23 +1136,55 @@ "regenerator-runtime": "^0.13.2" } }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + "@polkadot/util": { + "version": "0.93.1", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-0.93.1.tgz", + "integrity": "sha512-ORqpaCf7pDtg07/TVPnXyEKTyL7YhlTT9xFU1UFv3WoTLPrGThFlZnWQrfOVYuuMtlnsdpt2evJ1i5V9alGdOQ==", + "requires": { + "@babel/runtime": "^7.4.5", + "@types/bn.js": "^4.11.5", + "@types/deasync": "^0.1.0", + "bn.js": "^4.11.8", + "camelcase": "^5.3.1", + "chalk": "^2.4.2", + "ip-regex": "^4.1.0", + "moment": "^2.24.0" + } + }, + "@polkadot/util-crypto": { + "version": "0.93.1", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-0.93.1.tgz", + "integrity": "sha512-oSTUnJxWQkd6XopK+HFOa8sgTSTJW6LOoTg8iv6QCkddyEhsk8XkTe43AE4F+RA0VOi7MOiiBEl6Pl5eFIer9g==", + "requires": { + "@babel/runtime": "^7.4.5", + "@polkadot/util": "^0.93.1", + "@polkadot/wasm-crypto": "^0.11.1", + "@types/bip39": "^2.4.2", + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^3.5.0", + "@types/xxhashjs": "^0.2.1", + "bip39": "^2.5.0", + "blakejs": "^1.1.0", + "js-sha3": "^0.8.0", + "secp256k1": "^3.7.0", + "tweetnacl": "^1.0.1", + "xxhashjs": "^0.2.2" + } } } }, "@polkadot/rpc-core": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-0.79.1.tgz", - "integrity": "sha512-jWwwPbihGUwTUR48w9ootK/mpS/2aBsG4KUsSuLgmBSyVNPUA/U19VW7yD3BgMF6GdURAZFCBk3tqKIEjZox9w==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-core/-/rpc-core-0.82.0-beta.23.tgz", + "integrity": "sha512-iMQisQctxhGUMvYVrUBKvYpCld5hmK6X3KQcOqJe+5EmycptVNKPabQxi3bo57FSxKTnzLcesnMHljSCyY5aFg==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/jsonrpc": "^0.79.1", - "@polkadot/rpc-provider": "^0.79.1", - "@polkadot/types": "^0.79.1", - "@polkadot/util": "^0.91.1" + "@polkadot/jsonrpc": "^0.82.0-beta.23", + "@polkadot/rpc-provider": "^0.82.0-beta.23", + "@polkadot/types": "^0.82.0-beta.23", + "@polkadot/util": "^0.94.0-beta.4", + "memoizee": "^0.4.14", + "rxjs": "^6.5.2" }, "dependencies": { "@babel/runtime": { @@ -1182,26 +1194,20 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/rpc-provider": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-0.79.1.tgz", - "integrity": "sha512-ZRY9S9Mqk9aQyJKBeHzrgpL02SZkH/fHwcmIDZGWI8kJuAP3Yn7LO761K82HMsehkbNCBnxdWB5oJKQ+qlYFrw==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/rpc-provider/-/rpc-provider-0.82.0-beta.23.tgz", + "integrity": "sha512-9AOMHB09wISocZZ4j3T28m+a0pIIVZZmfSlkqQkzN+/zWjLk5dJTAaRnxpFacFKSoHbTr9oK1s+SrdHK7p4t7A==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/keyring": "^0.91.1", - "@polkadot/storage": "^0.79.1", - "@polkadot/util": "^0.91.1", - "@polkadot/util-crypto": "^0.91.1", + "@polkadot/storage": "^0.82.0-beta.23", + "@polkadot/util": "^0.94.0-beta.4", + "@polkadot/util-crypto": "^0.94.0-beta.4", "@types/nock": "^10.0.3", - "eventemitter3": "^3.1.0", + "eventemitter3": "^4.0.0", "isomorphic-fetch": "^2.2.1", "websocket": "^1.0.28" }, @@ -1214,52 +1220,22 @@ "regenerator-runtime": "^0.13.2" } }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" - } - } - }, - "@polkadot/rpc-rx": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/rpc-rx/-/rpc-rx-0.79.1.tgz", - "integrity": "sha512-lf0Z5VUrdvddnw+XcFcdcmmsExO5h+wMN2ILgAm9fZZUC+y+8dxMxFE3vFL2N7CSecFznf0FRr8GMiRJzZTt8w==", - "requires": { - "@babel/runtime": "^7.4.5", - "@polkadot/rpc-core": "^0.79.1", - "@polkadot/rpc-provider": "^0.79.1", - "@types/memoizee": "^0.4.2", - "@types/rx": "^4.1.1", - "memoizee": "^0.4.14", - "rxjs": "^6.5.2" - }, - "dependencies": { - "@babel/runtime": { - "version": "7.4.5", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.4.5.tgz", - "integrity": "sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==", - "requires": { - "regenerator-runtime": "^0.13.2" - } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" + "eventemitter3": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz", + "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==" } } }, "@polkadot/storage": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/storage/-/storage-0.79.1.tgz", - "integrity": "sha512-hyr8n83XFSm0tm5v8XSW8ul3VPfC9ekesjtzgc95jzqQHs3J4ntbyh8rjAOX+IB3EP0W8nI6mvMvHP5MdS7ltQ==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/storage/-/storage-0.82.0-beta.23.tgz", + "integrity": "sha512-+paqWsdJDazBknqEdqCEftbwJxBuvz1wQcGgk3jxdhaGTi2H5D/aaDv1k2ChkbOywdO2DqiVJAKUiJpzjcPC6Q==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/keyring": "^0.91.1", - "@polkadot/types": "^0.79.1", - "@polkadot/util": "^0.91.1", - "@polkadot/util-crypto": "^0.91.1" + "@polkadot/types": "^0.82.0-beta.23", + "@polkadot/util": "^0.94.0-beta.4", + "@polkadot/util-crypto": "^0.94.0-beta.4" }, "dependencies": { "@babel/runtime": { @@ -1269,22 +1245,17 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/types": { - "version": "0.79.1", - "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-0.79.1.tgz", - "integrity": "sha512-u7hcubX5Kl3m3IM+YXyORXlgHUJSb+a/YyzalERF7yRxEUW1fPMRE6935cUQT5kHdRme0aANncjHFGbE6Qn0vg==", + "version": "0.82.0-beta.23", + "resolved": "https://registry.npmjs.org/@polkadot/types/-/types-0.82.0-beta.23.tgz", + "integrity": "sha512-4edZf6NrPhA9Co/+f7f7CX9EiVSFp5DjuUW8UcPZkS0yEwFQIjfk8wDizO6rob4txi5gEs+19SQktJ9ERcxAYQ==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/keyring": "^0.91.1", - "@polkadot/util": "^0.91.1" + "@polkadot/util": "^0.94.0-beta.4", + "@polkadot/util-crypto": "^0.94.0-beta.4" }, "dependencies": { "@babel/runtime": { @@ -1294,11 +1265,6 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, @@ -1314,9 +1280,9 @@ } }, "@polkadot/util": { - "version": "0.91.1", - "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-0.91.1.tgz", - "integrity": "sha512-NqW3FlKQl0wh4mt/QpmGduE0VLBSsb6S45pyjgM3P7Fz37EyrOOZa8s7IBdIck2dtY3MwAy8JWGJjpTnMHXh8Q==", + "version": "0.94.0-beta.4", + "resolved": "https://registry.npmjs.org/@polkadot/util/-/util-0.94.0-beta.4.tgz", + "integrity": "sha512-dla3lV/9WVxODJHSytwNXsbRbs/Jx3ewXDyovptxMqHuepAsNlL44szbRZ+umIDG63JlFoI9eycLK+LEXnVnIA==", "requires": { "@babel/runtime": "^7.4.5", "@types/bn.js": "^4.11.5", @@ -1335,29 +1301,25 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/util-crypto": { - "version": "0.91.1", - "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-0.91.1.tgz", - "integrity": "sha512-o1CU1fwf0zxTJfuXgWs+IBJ8qIsZK9Pk7dSKR+YcDP3RYYCF8kRp+PDw/BHtvOhSerLKn9rxECjmtk+5sVVzkQ==", + "version": "0.94.0-beta.4", + "resolved": "https://registry.npmjs.org/@polkadot/util-crypto/-/util-crypto-0.94.0-beta.4.tgz", + "integrity": "sha512-CNzjy92l6zjPm9B1e5plhINtrNKfS2dySExQZeNGJpOUb/dgn2TYzwhoQf4ZAUv0VzLqtgtO4TrwhXtiCFPzRg==", "requires": { "@babel/runtime": "^7.4.5", - "@polkadot/util": "^0.91.1", - "@polkadot/wasm-crypto": "^0.10.1", + "@polkadot/util": "^0.94.0-beta.4", + "@polkadot/wasm-crypto": "^0.11.1", "@types/bip39": "^2.4.2", + "@types/bs58": "^4.0.0", "@types/pbkdf2": "^3.0.0", "@types/secp256k1": "^3.5.0", - "@types/webassembly-js-api": "^0.0.2", "@types/xxhashjs": "^0.2.1", "bip39": "^2.5.0", "blakejs": "^1.1.0", + "bs58": "^4.0.1", "js-sha3": "^0.8.0", "secp256k1": "^3.7.0", "tweetnacl": "^1.0.1", @@ -1371,18 +1333,13 @@ "requires": { "regenerator-runtime": "^0.13.2" } - }, - "regenerator-runtime": { - "version": "0.13.2", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" } } }, "@polkadot/wasm-crypto": { - "version": "0.10.1", - "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-0.10.1.tgz", - "integrity": "sha512-hI3OYftMGJkDetTe1DeU9aH4euk6WVmAMFszslNrCxHMFFkemEgACykwpyuOdCjv24VZP/cMsrVskKix1GzSYQ==" + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/@polkadot/wasm-crypto/-/wasm-crypto-0.11.1.tgz", + "integrity": "sha512-zd4p5UjsUlr4oW/5IWKEODHX7VKa6dc94oD8WJSr7++f+UGxSpF84qW+h+16uMDhU5PbHqq31dv1w73cr+KP4Q==" }, "@react-native-community/cli": { "version": "1.9.8", @@ -1604,9 +1561,9 @@ } }, "@types/node": { - "version": "12.0.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.8.tgz", - "integrity": "sha512-b8bbUOTwzIY3V5vDTY1fIJ+ePKDUBqt2hC2woVGotdQQhG/2Sh62HOKHrT7ab+VerXAcPyAiTEipPu/FsreUtg==" + "version": "12.0.10", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.10.tgz", + "integrity": "sha512-LcsGbPomWsad6wmMNv7nBLw7YYYyfdYcz6xryKYQhx89c3XXan+8Q6AJ43G5XDIaklaVkK3mE4fCb0SBvMiPSQ==" }, "@types/normalize-package-data": { "version": "2.4.0", @@ -1647,119 +1604,6 @@ "@types/react": "*" } }, - "@types/rx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@types/rx/-/rx-4.1.1.tgz", - "integrity": "sha1-WY/JSla67ZdfGUV04PVy/Y5iekg=", - "requires": { - "@types/rx-core": "*", - "@types/rx-core-binding": "*", - "@types/rx-lite": "*", - "@types/rx-lite-aggregates": "*", - "@types/rx-lite-async": "*", - "@types/rx-lite-backpressure": "*", - "@types/rx-lite-coincidence": "*", - "@types/rx-lite-experimental": "*", - "@types/rx-lite-joinpatterns": "*", - "@types/rx-lite-testing": "*", - "@types/rx-lite-time": "*", - "@types/rx-lite-virtualtime": "*" - } - }, - "@types/rx-core": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-core/-/rx-core-4.0.3.tgz", - "integrity": "sha1-CzNUsSOM7b4rdPYybxOdvHpZHWA=" - }, - "@types/rx-core-binding": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/@types/rx-core-binding/-/rx-core-binding-4.0.4.tgz", - "integrity": "sha512-5pkfxnC4w810LqBPUwP5bg7SFR/USwhMSaAeZQQbEHeBp57pjKXRlXmqpMrLJB4y1oglR/c2502853uN0I+DAQ==", - "requires": { - "@types/rx-core": "*" - } - }, - "@types/rx-lite": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/rx-lite/-/rx-lite-4.0.6.tgz", - "integrity": "sha512-oYiDrFIcor9zDm0VDUca1UbROiMYBxMLMaM6qzz4ADAfOmA9r1dYEcAFH+2fsPI5BCCjPvV9pWC3X3flbrvs7w==", - "requires": { - "@types/rx-core": "*", - "@types/rx-core-binding": "*" - } - }, - "@types/rx-lite-aggregates": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-lite-aggregates/-/rx-lite-aggregates-4.0.3.tgz", - "integrity": "sha512-MAGDAHy8cRatm94FDduhJF+iNS5//jrZ/PIfm+QYw9OCeDgbymFHChM8YVIvN2zArwsRftKgE33QfRWvQk4DPg==", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-async": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/rx-lite-async/-/rx-lite-async-4.0.2.tgz", - "integrity": "sha512-vTEv5o8l6702ZwfAM5aOeVDfUwBSDOs+ARoGmWAKQ6LOInQ8J4/zjM7ov12fuTpktUKdMQjkeCp07Vd73mPkxw==", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-backpressure": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-lite-backpressure/-/rx-lite-backpressure-4.0.3.tgz", - "integrity": "sha512-Y6aIeQCtNban5XSAF4B8dffhIKu6aAy/TXFlScHzSxh6ivfQBQw6UjxyEJxIOt3IT49YkS+siuayM2H/Q0cmgA==", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-coincidence": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-lite-coincidence/-/rx-lite-coincidence-4.0.3.tgz", - "integrity": "sha512-1VNJqzE9gALUyMGypDXZZXzR0Tt7LC9DdAZQ3Ou/Q0MubNU35agVUNXKGHKpNTba+fr8GdIdkC26bRDqtCQBeQ==", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-experimental": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/rx-lite-experimental/-/rx-lite-experimental-4.0.1.tgz", - "integrity": "sha1-xTL1y98/LBXaFt7Ykw0bKYQCPL0=", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-joinpatterns": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/rx-lite-joinpatterns/-/rx-lite-joinpatterns-4.0.1.tgz", - "integrity": "sha1-9w/jcFGKhDLykVjMkv+1a05K/D4=", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-testing": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/rx-lite-testing/-/rx-lite-testing-4.0.1.tgz", - "integrity": "sha1-IbGdEfTf1v/vWp0WSOnIh5v+Iek=", - "requires": { - "@types/rx-lite-virtualtime": "*" - } - }, - "@types/rx-lite-time": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-lite-time/-/rx-lite-time-4.0.3.tgz", - "integrity": "sha512-ukO5sPKDRwCGWRZRqPlaAU0SKVxmWwSjiOrLhoQDoWxZWg6vyB9XLEZViKOzIO6LnTIQBlk4UylYV0rnhJLxQw==", - "requires": { - "@types/rx-lite": "*" - } - }, - "@types/rx-lite-virtualtime": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@types/rx-lite-virtualtime/-/rx-lite-virtualtime-4.0.3.tgz", - "integrity": "sha512-3uC6sGmjpOKatZSVHI2xB1+dedgml669ZRvqxy+WqmGJDVusOdyxcKfyzjW0P3/GrCiN4nmRkLVMhPwHCc5QLg==", - "requires": { - "@types/rx-lite": "*" - } - }, "@types/secp256k1": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-3.5.0.tgz", @@ -1774,11 +1618,6 @@ "integrity": "sha512-ZPHnXkzmGMfk+pHqAGzTSpA9CbsHmJLgkvOl5w52LZ0XTxB1ZIHWZzQ7lEtjTNWScBbsQekg8TjApMXkMe4nkw==", "dev": true }, - "@types/webassembly-js-api": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@types/webassembly-js-api/-/webassembly-js-api-0.0.2.tgz", - "integrity": "sha512-htlxJRag6RUiMYUkS8Fjup+TMHO0VarpiF9MrqYaGJ0wXtIraQFz40rfA8VIeCiWy8sgpv3RLmigpgicG8fqGA==" - }, "@types/xxhashjs": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/@types/xxhashjs/-/xxhashjs-0.2.1.tgz", @@ -4240,7 +4079,8 @@ "console-control-strings": { "version": "1.1.0", "resolved": "http://registry.npm.taobao.org/console-control-strings/download/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=" + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true }, "constants-browserify": { "version": "1.0.0", @@ -4475,11 +4315,12 @@ "integrity": "sha1-QICG1AlVDCYxFVYZ6fp7ytw7mRs=" }, "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", + "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", "requires": { - "es5-ext": "^0.10.9" + "es5-ext": "^0.10.50", + "type": "^1.0.1" } }, "d3-array": { @@ -9879,6 +9720,7 @@ "version": "2.3.5", "resolved": "http://registry.npm.taobao.org/minipass/download/minipass-2.3.5.tgz", "integrity": "sha1-ys6+SSAiSX9law8PUeJoKp7S2Eg=", + "optional": true, "requires": { "safe-buffer": "^5.1.2", "yallist": "^3.0.0" @@ -9887,7 +9729,8 @@ "yallist": { "version": "3.0.3", "resolved": "http://registry.npm.taobao.org/yallist/download/yallist-3.0.3.tgz", - "integrity": "sha1-tLBJ4xS+VF486AIjbWzSLNkcPek=" + "integrity": "sha1-tLBJ4xS+VF486AIjbWzSLNkcPek=", + "optional": true } } }, @@ -11928,8 +11771,7 @@ "regenerator-runtime": { "version": "0.13.2", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz", - "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==", - "dev": true + "integrity": "sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==" }, "regenerator-transform": { "version": "0.13.3", @@ -13825,6 +13667,11 @@ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.1.tgz", "integrity": "sha512-kcoMoKTPYnoeS50tzoqjPY3Uv9axeuuFAZY9M/9zFnhoVvRfxz9K29IMPD7jGmt2c8SW7i3gT9WqDl2+nV7p4A==" }, + "type": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/type/-/type-1.0.1.tgz", + "integrity": "sha512-MAM5dBMJCJNKs9E7JXo4CXRAansRfG0nlJxW7Wf6GZzSOvH31zClSaHdIMWLehe/EGMBkqeC55rrkaOr5Oo7Nw==" + }, "type-check": { "version": "0.3.2", "resolved": "http://registry.npm.taobao.org/type-check/download/type-check-0.3.2.tgz", diff --git a/src/components/Active.js b/src/components/Active.js index 6e5a9753..28771cc4 100755 --- a/src/components/Active.js +++ b/src/components/Active.js @@ -1,528 +1,541 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Text, View, Image, TouchableOpacity, RefreshControl, ScrollView } from 'react-native' -import { Method } from '@polkadot/types' -import { formatBalance } from '@polkadot/util' -import { VictoryPie } from 'victory-native' -import { observer, inject } from 'mobx-react' -import { ScreenWidth, ScreenHeight } from '../util/Common' -import polkadotAPI from '../util/polkadotAPI' -import i18n from '../locales/i18n' - -@inject('rootStore') -@observer -class Active extends Component { - constructor(props) { - super(props) - this.state = { - referendums: [], - Actives_Nofixed: [], - Actives_Nofixedvalue: [], - Actives_Title: [], - votingCountdown: 0, - votingIndex: [], - votingState: [], - votingStateIndex: [] - } - this.votingState = this.votingState.bind(this) - this.Nay = this.Nay.bind(this) - this.Aye = this.Aye.bind(this) - this.NayNumber = this.NayNumber.bind(this) - this.AyeNumber = this.AyeNumber.bind(this) - } - - Nay(votingState) { - let balance = 0 - for (let i = 0; i < votingState.msg.length; i++) { - if (JSON.stringify(votingState.msg[i].vote) == '"0x00"') { - balance = balance + Number(votingState.msg[i].balance) - } - } - return balance - } - - NayNumber(votingState) { - let NayNumber = 0 - for (let i = 0; i < votingState.msg.length; i++) { - if (JSON.stringify(votingState.msg[i].vote) == '"0x00"') { - NayNumber = NayNumber + 1 - } - } - return NayNumber - } - - Aye(votingState) { - let balance = 0 - for (let i = 0; i < votingState.msg.length; i++) { - if (JSON.stringify(votingState.msg[i].vote) == '"0xff"') { - balance = balance + Number(votingState.msg[i].balance) - } - } - return balance - } - - AyeNumber(votingState) { - let AyeNumber = 0 - for (let i = 0; i < votingState.msg.length; i++) { - if (JSON.stringify(votingState.msg[i].vote) == '"0xff"') { - AyeNumber = AyeNumber + 1 - } - } - return AyeNumber - } - - votingState() { - ;(async () => { - this.state.votingState = [] - let ifNewIndex = false - let l = 0 - for (let i = 0; i < this.state.votingIndex.length; i++) { - await polkadotAPI.referendumVotesFor(this.state.votingIndex[i], result => { - if (result[0] != null) { - if (this.state.votingState[0] != null) { - for (let k = 0; k < this.state.votingState.length; k++) { - if (this.state.votingState[k][0].referendumId == result[0].referendumId) { - this.state.votingState[k] = result - l-- - break - } else if (l == this.state.votingState.length) { - ifNewIndex = true - l = 0 - break - } - l++ - } - if (ifNewIndex == true) { - this.state.votingState.push(result) - ifNewIndex = false - } - this.setState({}) - } else { - this.state.votingState.push(result) - } - } - }) - } - })() - } - - load() { - ;(async () => { - await polkadotAPI.bestNumber(bestNumber => { - this.setState({ votingCountdown: bestNumber }) - }) - - await polkadotAPI.referendums(result => { - this.setState({ - referendums: [], - Actives_Nofixed: [], - Actives_Nofixedvalue: [], - Actives_Title: [], - votingIndex: [], - votingState: [] - }) - let Actives_Title = [], - Actives_Nofixedvalue = [], - Actives_Nofixed = [], - referendums = [], - votingIndex = [], - votingState = [] - result.map((item, index) => { - let info = item.unwrapOr(null) - if (info) { - let { meta, method, section } = Method.findFunction(info.proposal.callIndex) - let have = 0 - Actives_Title.push({ section: section, method: method }) - Actives_Nofixedvalue.push(info.proposal.args) - Actives_Nofixed.push(meta.args) - referendums.push(info) - votingIndex.push(info.index) - for (let i = 0; i < votingState.length; i++) { - if (votingState[i].index == index) { - have = 1 - } - } - if (have == 0) { - votingState.push({ index: info.index, msg: [] }) - } - } - this.setState({ - Actives_Title, - Actives_Nofixedvalue, - Actives_Nofixed, - referendums, - votingIndex, - votingState - })(async () => { - const index = info.index - await polkadotAPI.referendumVotesFor(index, result => { - this.props.rootStore.stateStore.have = 0 - for (let i = 0; i < this.state.votingState.length; i++) { - if (this.state.votingState[i].index == index) { - this.props.rootStore.stateStore.have = 1 - this.state.votingState[i].msg = result - } - } - }) - })() - }) - }) - })() - } - - componentWillMount() { - this.load() - } - - refresh() { - this.setState({ - isrefresh: true - }) - this.load() - setTimeout(() => { - this.setState({ - isrefresh: false - }) - }, 2000) - } - - render() { - return ( - - - } - > - {this.state.referendums[0] == null ? ( - - {i18n.t('Democracy.noReferendums')} - - ) : ( - this.state.referendums.map((item, index) => { - return ( - - - - - - {this.state.Actives_Title[index].section + '.' + this.state.Actives_Title[index].method} - - - - - {Number(item.end) - Number(this.state.votingCountdown) - 1} - - {i18n.t('Democracy.blocksEnd')} - - {this.state.Actives_Nofixed[index].map((itemNo, indexNo) => { - return ( - - - {itemNo.name + ' : ' + itemNo.type} - - - - {String(this.state.Actives_Nofixedvalue[index][indexNo])} - - - - ) - })} - - - - {'#' + item.index} - - - - - - {this.Aye(this.state.votingState[index]) == 0 ? ( - - ) : ( - - - - {i18n.t('Democracy.Threshold')} - {': ' + item.threshold} - - - - - - - - - - {i18n.t('Democracy.Aye')} - {' ' + formatBalance(this.Aye(this.state.votingState[index]))} - - - {( - (this.Aye(this.state.votingState[index]) / - (this.Aye(this.state.votingState[index]) + this.Nay(this.state.votingState[index]))) * - 100 - ).toFixed(2) + '%'} - - - {'(' + this.AyeNumber(this.state.votingState[index]) + ')'} - - - - - - {i18n.t('Democracy.Nay')} - {' ' + formatBalance(this.Nay(this.state.votingState[index]))} - - - {( - (this.Nay(this.state.votingState[index]) / - (this.Aye(this.state.votingState[index]) + this.Nay(this.state.votingState[index]))) * - 100 - ).toFixed(2) + '%'} - - - {'(' + this.NayNumber(this.state.votingState[index]) + ')'} - - - - - )} - - {/* Nay or Aye */} - - - { - this.props.p.navigation.navigate('NayorAye', { - choose: 'Nay', - index: item.index - }) - }} - > - {i18n.t('Democracy.Nay')} - - { - this.props.p.navigation.navigate('NayorAye', { - choose: 'Aye', - index: item.index - }) - }} - > - {i18n.t('Democracy.Aye')} - - - - - - ) - }) - )} - - - ) - } -} -export default Active +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Text, View, Image, TouchableOpacity, RefreshControl, ScrollView } from 'react-native' +import { Method } from '@polkadot/types' +import { formatBalance } from '@polkadot/util' +import { VictoryPie } from 'victory-native' +import { observer, inject } from 'mobx-react' +import { ScreenWidth, ScreenHeight } from '../util/Common' +import polkadotAPI from '../util/polkadotAPI' +import i18n from '../locales/i18n' + +@inject('rootStore') +@observer +class Active extends Component { + constructor(props) { + super(props) + this.state = { + referendums: [], + Actives_Nofixed: [], + Actives_Nofixedvalue: [], + Actives_Title: [], + votingCountdown: 0, + votingIndex: [], + votingState: [], + votingStateIndex: [] + } + this.votingState = this.votingState.bind(this) + this.Nay = this.Nay.bind(this) + this.Aye = this.Aye.bind(this) + this.NayNumber = this.NayNumber.bind(this) + this.AyeNumber = this.AyeNumber.bind(this) + } + + /** + * @description 根据投票信息获取 Nay balance | Get Nay balance based on the voting information. + * @param {Object} votingState 投票信息 | voting information. + */ + Nay(votingState) { + let balance = 0 + for (let i = 0; i < votingState.msg.length; i++) { + if (JSON.stringify(votingState.msg[i].vote) == '"0x00"') { + balance = balance + Number(votingState.msg[i].balance) + } + } + return balance + } + + /** + * @description 根据投票信息获取 NayNumber | Get NayNumber based on the voting information. + * @param {Object} votingState 投票信息 | voting information. + */ + NayNumber(votingState) { + let NayNumber = 0 + for (let i = 0; i < votingState.msg.length; i++) { + if (JSON.stringify(votingState.msg[i].vote) == '"0x00"') { + NayNumber = NayNumber + 1 + } + } + return NayNumber + } + + /** + * @description 根据投票信息获取 Aye balance | Get Aye balance based on the voting information. + * @param {Object} votingState 投票信息 | voting information. + */ + Aye(votingState) { + let balance = 0 + for (let i = 0; i < votingState.msg.length; i++) { + if (JSON.stringify(votingState.msg[i].vote) == '"0xff"') { + balance = balance + Number(votingState.msg[i].balance) + } + } + return balance + } + + /** + * @description 根据投票信息获取AyeNumber | Get AyeNumber based on the voting information. + * @param {Object} votingState 投票信息 | voting information. + */ + AyeNumber(votingState) { + let AyeNumber = 0 + for (let i = 0; i < votingState.msg.length; i++) { + if (JSON.stringify(votingState.msg[i].vote) == '"0xff"') { + AyeNumber = AyeNumber + 1 + } + } + return AyeNumber + } + + /** + * @description 获取所有的投票信息 | Get all the voting information. + */ + votingState() { + ;(async () => { + this.state.votingState = [] + let ifNewIndex = false + let l = 0 + for (let i = 0; i < this.state.votingIndex.length; i++) { + await polkadotAPI.referendumVotesFor(this.state.votingIndex[i], result => { + if (result[0] != null) { + if (this.state.votingState[0] != null) { + for (let k = 0; k < this.state.votingState.length; k++) { + if (this.state.votingState[k][0].referendumId == result[0].referendumId) { + this.state.votingState[k] = result + l-- + break + } else if (l == this.state.votingState.length) { + ifNewIndex = true + l = 0 + break + } + l++ + } + if (ifNewIndex == true) { + this.state.votingState.push(result) + ifNewIndex = false + } + this.setState({}) + } else { + this.state.votingState.push(result) + } + } + }) + } + })() + } + + /** + * @description 初始化页面 加载相关数据 | Initializes page load related data. + */ + load() { + ;(async () => { + await polkadotAPI.bestNumber(bestNumber => { + this.setState({ votingCountdown: bestNumber }) + }) + await polkadotAPI.referendums(result => { + this.setState({ + referendums: [], + Actives_Nofixed: [], + Actives_Nofixedvalue: [], + Actives_Title: [], + votingIndex: [], + votingState: [] + }) + result.map((item, index) => { + let info = item.unwrapOr(null) + try { + if (info.proposal.args.proposal) { + info = info.proposal.args + } + } catch (e) {} + if (info) { + let { meta, method, section } = Method.findFunction(info.proposal.callIndex) + let have = 0 + this.state.Actives_Title.push({ section: section, method: method }) + this.state.Actives_Nofixedvalue.push(info.proposal.args) + this.state.Actives_Nofixed.push(meta.args) + this.state.referendums.push(info) + this.state.votingIndex.push(info.index) + if (have == 0) { + this.state.votingState.push({ index: info.index, msg: [] }) + } + const index = info.index + polkadotAPI.referendumVotesFor(index, result => { + this.props.rootStore.stateStore.have = 0 + for (let i = 0; i < this.state.votingState.length; i++) { + if (this.state.votingState[i].index == index) { + this.props.rootStore.stateStore.have = 1 + this.state.votingState[i].msg = result + this.setState({}) + } + } + }) + } + }) + }) + })() + } + + componentWillMount() { + this.load() + } + + /** + * @description 刷新 | Refresh. + */ + refresh() { + this.setState({ + isrefresh: true + }) + this.load() + setTimeout(() => { + this.setState({ + isrefresh: false + }) + }, 2000) + } + + render() { + return ( + + + } + > + {this.state.referendums[0] == null || this.props.num == 0 ? ( + + {i18n.t('Democracy.noReferendums')} + + ) : ( + this.state.referendums.map((item, index) => { + return ( + + + + + + {this.state.Actives_Title[index].section + '.' + this.state.Actives_Title[index].method} + + + + + {Number(item.end) - Number(this.state.votingCountdown) - 1} + + {i18n.t('Democracy.blocksEnd')} + + {this.state.Actives_Nofixed[index].map((itemNo, indexNo) => { + return ( + + + {itemNo.name + ' : ' + itemNo.type} + + + + {String(this.state.Actives_Nofixedvalue[index][indexNo])} + + + + ) + })} + + + + {'#' + item.index} + + + + + + {this.Aye(this.state.votingState[index]) == 0 && + this.NayNumber(this.state.votingState[index]) == 0 ? ( + + ) : ( + + + + {i18n.t('Democracy.Threshold')} + {': ' + item.threshold} + + + + + + + + + + {i18n.t('Democracy.Aye')} + {' ' + formatBalance(this.Aye(this.state.votingState[index]))} + + + {( + (this.Aye(this.state.votingState[index]) / + (this.Aye(this.state.votingState[index]) + this.Nay(this.state.votingState[index]))) * + 100 + ).toFixed(2) + '%'} + + + {'(' + this.AyeNumber(this.state.votingState[index]) + ')'} + + + + + + {i18n.t('Democracy.Nay')} + {' ' + formatBalance(this.Nay(this.state.votingState[index]))} + + + {( + (this.Nay(this.state.votingState[index]) / + (this.Aye(this.state.votingState[index]) + this.Nay(this.state.votingState[index]))) * + 100 + ).toFixed(2) + '%'} + + + {'(' + this.NayNumber(this.state.votingState[index]) + ')'} + + + + + )} + + {/* Nay or Aye */} + + + { + this.props.p.navigation.navigate('Vote', { + choose: 'Nay', + index: item.index + }) + }} + > + {i18n.t('Democracy.Nay')} + + { + this.props.p.navigation.navigate('Vote', { + choose: 'Aye', + index: item.index + }) + }} + > + {i18n.t('Democracy.Aye')} + + + + + + ) + }) + )} + + + ) + } +} +export default Active diff --git a/src/components/CoinRow.js b/src/components/CoinRow.js index 30e9711c..fa5853d2 100755 --- a/src/components/CoinRow.js +++ b/src/components/CoinRow.js @@ -1,71 +1,72 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Image, View, TouchableOpacity, Text } from 'react-native' -import moment from 'moment/moment' -import { formatBalance } from '@polkadot/util' -import { ScreenWidth } from '../util/Common' - -export default class CoinRow extends Component { - render() { - const { item, index, navigation } = this.props - return ( - { - navigation.navigate('Transfer_details', { data: item }) - }} - style={{ - alignItems: 'center', - flexDirection: 'row', - height: 64, - borderBottomWidth: 1, - borderColor: '#F0F0F0' - }} - > - - - {item.tx_address} - - - {moment(item.tx_timestamp).format('DD/MM/YYYY HH:mm:ss')} - - - {/* 余额 | Balance */} - - {item.tx_type == 'Receive' - ? `+ ${formatBalance(String(item.tx_value))}` - : `- ${formatBalance(String(item.tx_value))}`} - - - - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Image, View, TouchableOpacity, Text } from 'react-native' +import moment from 'moment/moment' +import { formatBalance } from '@polkadot/util' +import { ScreenWidth } from '../util/Common' + +export default class CoinRow extends Component { + render() { + const { item, index, navigation } = this.props + return ( + { + navigation.navigate('Transfer_details', { data: item }) + }} + style={{ + alignItems: 'center', + flexDirection: 'row', + height: 64, + borderBottomWidth: 1, + borderColor: '#F0F0F0' + }} + > + + + {item.tx_address} + + + {moment(item.tx_timestamp).format('DD/MM/YYYY HH:mm:ss')} + + + {/* 余额 | Balance */} + + {item.tx_type == 'Receive' + ? `+ ${formatBalance(String(item.tx_value))}` + : `- ${formatBalance(String(item.tx_value))}`} + + + + ) + } +} diff --git a/src/components/Header.js b/src/components/Header.js index 38fce0e6..22c9b5f8 100755 --- a/src/components/Header.js +++ b/src/components/Header.js @@ -1,78 +1,87 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Image, View, TouchableOpacity, Text } from 'react-native' -import { ScreenWidth } from '../util/Common' - -export default class Header extends Component { - back() { - this.props.navigation.goBack() - } - - render() { - const { title, rightIcon, rightPress, backPress } = this.props - const theme = this.props.theme || 'light' - return ( - - - {/* */} - - {/* */} - - - {title} - - {rightIcon ? ( - { - rightPress() - }} - > - - - ) : ( - - - - )} - - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Image, View, TouchableOpacity, Text } from 'react-native' +import { ScreenWidth } from '../util/Common' + +export default class Header extends Component { + /** + * @description 返回上一页 | Go back to the previous page. + */ + back() { + this.props.navigation.goBack() + } + + render() { + const { title, rightIcon, rightPress, backPress } = this.props + const theme = this.props.theme || 'light' + return ( + + + {/* */} + + {/* */} + + + {title} + + {rightIcon ? ( + { + rightPress() + }} + activeOpacity={0.7} + > + + + ) : ( + + + + )} + + ) + } +} diff --git a/src/components/Loading.js b/src/components/Loading.js index 10e41c56..25e1137f 100755 --- a/src/components/Loading.js +++ b/src/components/Loading.js @@ -1,105 +1,112 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React from 'react' -import { ActivityIndicator, StyleSheet, Text, View, Dimensions } from 'react-native' -import i18n from '../locales/i18n' - -const { width } = Dimensions.get('window') -const { height } = Dimensions.get('window') - -const styles = StyleSheet.create({ - loading: { - backgroundColor: '#10101099', - height: 80, - width: 100, - borderRadius: 10, - justifyContent: 'center', - alignItems: 'center', - position: 'absolute', - top: (height - 80) / 2, - left: (width - 100) / 2 - }, - - loadingTitle: { - marginTop: 10, - fontSize: 14, - color: 'white' - } -}) -export default class Loading extends React.Component { - constructor(props) { - super(props) - this.minShowingTime = 200 - this.state = { - isLoading: false, - setIsLoading: isLoading => { - if (isLoading != this.state.isLoading) { - const curTimeLong = new Date().getTime() - if (isLoading) { - this.startTime = curTimeLong - this.setState({ - isLoading - }) - } else { - const hasShowingTimeLong = curTimeLong - this.startTime - if (hasShowingTimeLong < this.minShowingTime) { - setTimeout(() => { - this.setState({ - isLoading - }) - }, this.minShowingTime - hasShowingTimeLong) - } else { - this.setState({ - isLoading - }) - } - } - } - } - } - } - - showLoading = () => { - this.state.setIsLoading(true) - } - - dismissLoading = () => { - this.state.setIsLoading(false) - } - - render() { - if (!this.state.isLoading) { - return null - } - return ( - - - - - {i18n.t('TAB.loading')} - ... - - - - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React from 'react' +import { ActivityIndicator, StyleSheet, Text, View, Dimensions } from 'react-native' +import i18n from '../locales/i18n' + +const { width } = Dimensions.get('window') +const { height } = Dimensions.get('window') + +const styles = StyleSheet.create({ + loading: { + backgroundColor: '#10101099', + height: 80, + width: 100, + borderRadius: 10, + justifyContent: 'center', + alignItems: 'center', + position: 'absolute', + top: (height - 80) / 2, + left: (width - 100) / 2 + }, + + loadingTitle: { + marginTop: 10, + fontSize: 14, + color: 'white' + } +}) +export default class Loading extends React.Component { + constructor(props) { + super(props) + this.minShowingTime = 200 + this.state = { + isLoading: false, + setIsLoading: isLoading => { + if (isLoading != this.state.isLoading) { + const curTimeLong = new Date().getTime() + if (isLoading) { + this.startTime = curTimeLong + this.setState({ + isLoading + }) + } else { + const hasShowingTimeLong = curTimeLong - this.startTime + if (hasShowingTimeLong < this.minShowingTime) { + setTimeout(() => { + this.setState({ + isLoading + }) + }, this.minShowingTime - hasShowingTimeLong) + } else { + this.setState({ + isLoading + }) + } + } + } + } + } + } + + /** + * @description 展示loading框 | Show the loading frame. + */ + showLoading = () => { + this.state.setIsLoading(true) + } + + /** + * @description 隐藏loading框 | Hide the loading frame. + * + */ + dismissLoading = () => { + this.state.setIsLoading(false) + } + + render() { + if (!this.state.isLoading) { + return null + } + return ( + + + + + {i18n.t('TAB.loading')} + ... + + + + ) + } +} diff --git a/src/components/LoadingUtil.js b/src/components/LoadingUtil.js index 992cbd8f..bc86c7d7 100755 --- a/src/components/LoadingUtil.js +++ b/src/components/LoadingUtil.js @@ -1,28 +1,35 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -const LoadingUtil = { - showLoading(timeOut = 30000) { - global.LoadingTip = true - global.mLoadingComponentRef && global.mLoadingComponentRef.showLoading() - this.timerLoading = setTimeout(() => { - this.dismissLoading() - }, timeOut) - }, - dismissLoading() { - global.LoadingTip = false - global.mLoadingComponentRef && global.mLoadingComponentRef.dismissLoading() - this.timerLoading && clearTimeout(this.timerLoading) - } -} - -export default LoadingUtil +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +const LoadingUtil = { + /** + * @description 展示loading框 | Show the loading frame. + * @param {Number} timeOut 超时时间 默认3000 (3s) | Timeout default 3000 (3s). + */ + showLoading(timeOut = 30000) { + global.LoadingTip = true + global.mLoadingComponentRef && global.mLoadingComponentRef.showLoading() + this.timerLoading = setTimeout(() => { + this.dismissLoading() + }, timeOut) + }, + /** + * @description 隐藏loading框 | Hide the loading frame. + */ + dismissLoading() { + global.LoadingTip = false + global.mLoadingComponentRef && global.mLoadingComponentRef.dismissLoading() + this.timerLoading && clearTimeout(this.timerLoading) + } +} + +export default LoadingUtil diff --git a/src/components/ProposalsRow.js b/src/components/ProposalsRow.js index 76917abb..4f9dab88 100755 --- a/src/components/ProposalsRow.js +++ b/src/components/ProposalsRow.js @@ -1,142 +1,167 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Text, View, Image } from 'react-native' -import { ScreenWidth, ScreenHeight } from '../util/Common' -import i18n from '../locales/i18n' - -export default class ProposalsRow extends Component { - render() { - const { publicProps, Actives_Nofixed, Actives_Title, Actives_Nofixedvalue, launchCountdown, balances } = this.props - return publicProps.map((item, index) => ( - - - - - - {`${Actives_Title[index].section}.${Actives_Title[index].method}`} - - - - {launchCountdown + 9 * index} - {i18n.t('Democracy.blocksLaunch')} - - {Actives_Nofixed[index].map((itemNo, indexNo) => ( - - {`${itemNo.name} : ${itemNo.type}`} - - - {String(Actives_Nofixedvalue[index][indexNo])} - - - - ))} - - - {`#${item[0]}`} - - - {/* 虚线 | Dotted line */} - - - {/* 确定个数 | Determine the number */} - - - {i18n.t('Democracy.depositors')} - - - {String(item[2])} - - - - - {i18n.t('Democracy.balance')} - - - {String(balances[index])} - - - - - - - - - )) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Text, View, Image } from 'react-native' +import { formatBalance } from '@polkadot/util' +import { ScreenWidth, ScreenHeight } from '../util/Common' +import i18n from '../locales/i18n' + +export default class ProposalsRow extends Component { + render() { + const { publicProps, Actives_Nofixed, Actives_Title, Actives_Nofixedvalue, launchCountdown, balances } = this.props + return publicProps.map((item, index) => ( + + + + + + {`${Actives_Title[index].section}.${Actives_Title[index].method}`} + + + + {launchCountdown + 9 * index} + {i18n.t('Democracy.blocksLaunch')} + + {Actives_Nofixed[index].map((itemNo, indexNo) => ( + + {`${itemNo.name} : ${itemNo.type}`} + + + {String(Actives_Nofixedvalue[index][indexNo]) || ''} + + + + ))} + + + {`#${item[0]}`} + + + {/* 虚线 | Dotted line */} + + + {/* 确定个数 | Determine the number */} + + + {i18n.t('Democracy.depositors')} + + + {String(item[2] || 0)} + + + + + {i18n.t('Democracy.balance')} + + + {String(formatBalance(balances[index] || 0))} + + + + + + + + + )) + } +} diff --git a/src/components/RNKeyboardAvoidView.js b/src/components/RNKeyboardAvoidView.js index 4b095c7d..df2a8fa4 100755 --- a/src/components/RNKeyboardAvoidView.js +++ b/src/components/RNKeyboardAvoidView.js @@ -1,26 +1,26 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { KeyboardAvoidingView, ScrollView, Platform } from 'react-native' - -export default class RNKeyboardAvoidView extends Component { - render() { - return Platform.OS == 'ios' ? ( - - {this.props.children} - - ) : ( - {this.props.children} - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { KeyboardAvoidingView, ScrollView, Platform } from 'react-native' + +export default class RNKeyboardAvoidView extends Component { + render() { + return Platform.OS == 'ios' ? ( + + {this.props.children} + + ) : ( + {this.props.children} + ) + } +} diff --git a/src/components/RNPicker.js b/src/components/RNPicker.js index 0dad1746..5f45c6ce 100755 --- a/src/components/RNPicker.js +++ b/src/components/RNPicker.js @@ -1,132 +1,140 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Platform, Picker, Text, ActionSheetIOS, TouchableOpacity, Image } from 'react-native' -import i18n from '../locales/i18n' - -const defaultData = [ - { - title: 'femto', - value: 'femto' - }, - { - title: 'pico', - value: 'pico' - }, - { - title: 'nano', - value: 'nano' - }, - { - title: 'micro', - value: 'micro' - }, - { - title: 'milli', - value: 'milli' - }, - { - title: 'DOT', - value: 'DOT' - }, - { - title: 'Kilo', - value: 'Kilo' - }, - { - title: 'Mega', - value: 'Mega' - }, - { - title: 'Giga', - value: 'Giga' - }, - { - title: 'Tera', - value: 'Tera' - }, - { - title: 'Peta', - value: 'Peta' - }, - { - title: 'Exa', - value: 'Exa' - }, - { - title: 'Zeta', - value: 'Zeta' - }, - { - title: 'Yotta', - value: 'Yotta' - } -] -export default class RNPicker extends Component { - sheet(data) { - let paramas = [] - const _this = this - data.map(v => { - paramas.push(v.label ? i18n.t(v.label) : v.title) - }) - paramas.push(i18n.t('TAB.Cancel')) - ActionSheetIOS.showActionSheetWithOptions( - { - options: paramas, - cancelButtonIndex: paramas.length - 1 - // destructiveButtonIndex: 0 - }, - function(index) { - if (index != paramas.length) { - _this.props.onValueChange(data[index].value) - } - } - ) - } - - render() { - const { style, selectedValue, onValueChange } = this.props - const data = this.props.data || defaultData - let showLable = '' - data.map(v => { - if (v.value == selectedValue) { - showLable = v.label ? i18n.t(v.label) : v.title - } - }) - return Platform.OS == 'ios' ? ( - - {showLable} - - - ) : ( - - {data && - data.map((v, i) => )} - - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Platform, Picker, Text, ActionSheetIOS, TouchableOpacity, Image } from 'react-native' +import i18n from '../locales/i18n' +import { doubleClick } from '../util/Common' + +const defaultData = [ + { + title: 'femto', + value: 'femto' + }, + { + title: 'pico', + value: 'pico' + }, + { + title: 'nano', + value: 'nano' + }, + { + title: 'micro', + value: 'micro' + }, + { + title: 'milli', + value: 'milli' + }, + { + title: 'DOT', + value: 'DOT' + }, + { + title: 'Kilo', + value: 'Kilo' + }, + { + title: 'Mega', + value: 'Mega' + }, + { + title: 'Giga', + value: 'Giga' + }, + { + title: 'Tera', + value: 'Tera' + }, + { + title: 'Peta', + value: 'Peta' + }, + { + title: 'Exa', + value: 'Exa' + }, + { + title: 'Zeta', + value: 'Zeta' + }, + { + title: 'Yotta', + value: 'Yotta' + } +] +export default class RNPicker extends Component { + /** + * @description IOS ActionSheet + * @param {Array} data 要展示的选项 | The options to show. + */ + sheet(data) { + let paramas = [] + const _this = this + data.map(v => { + paramas.push(v.label ? i18n.t(v.label) : v.title) + }) + paramas.push(i18n.t('TAB.Cancel')) + ActionSheetIOS.showActionSheetWithOptions( + { + options: paramas, + cancelButtonIndex: paramas.length - 1 + // destructiveButtonIndex: 0 + }, + function(index) { + if (index != paramas.length) { + _this.props.onValueChange(data[index].value) + } + } + ) + } + + render() { + const { style, selectedValue, onValueChange } = this.props + const data = this.props.data || defaultData + let showLable = '' + data.map(v => { + if (v.value == selectedValue) { + showLable = v.label ? i18n.t(v.label) : v.title + } + }) + return Platform.OS == 'ios' ? ( + { + doubleClick(this.sheet.bind(this, data)) + }} + activeOpacity={0.7} + style={[ + style, + { + justifyContent: 'space-between', + alignItems: 'center', + paddingLeft: 10, + flexDirection: 'row' + } + ]} + > + {showLable} + + + ) : ( + + {data && + data.map((v, i) => )} + + ) + } +} diff --git a/src/components/bottom.js b/src/components/bottom.js index 75afc370..b2050d1a 100755 --- a/src/components/bottom.js +++ b/src/components/bottom.js @@ -1,26 +1,26 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { Image, Dimensions } from 'react-native' - -const ScreenHeight = Dimensions.get('screen').height -export default class TabBarItem extends Component { - render() { - return ( - - ) - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { Image, Dimensions } from 'react-native' + +const ScreenHeight = Dimensions.get('screen').height +export default class TabBarItem extends Component { + render() { + return ( + + ) + } +} diff --git a/src/locales/en-US/Assets/index.js b/src/locales/en-US/Assets/index.js index b5644060..150d8972 100755 --- a/src/locales/en-US/Assets/index.js +++ b/src/locales/en-US/Assets/index.js @@ -1,96 +1,96 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-21 20:09:00 - */ -export default { - Alexander: 'Alexander TestNet', - Receive: 'Receive', - Account: 'Account', - AssetsList: 'Assets list', - Scan: 'Scan', - Menu: 'Menu', - CreateAccount: 'Create Account', - // Create_Account 页面 - balance: 'balance', - Createfrom: 'Create from mnemonic,seed or import keystore', - WordMnemonic12: '12 Word Mnemonic', - WordMnemonic24: '24 Word Mnemonic', - RawSeed: 'Raw Seed', - ImportKeystore: 'import keystore', - NameTheAccount: 'name the account', - Password: 'encrypt it using a password', - EnterName: 'Please enter your name', - EnterPassword: 'Please enter your password', - EnterPassword_d: 'Please confirm the password', - CheckPassword: 'The two passwords do not match. Please re-enter them', - ExistingAddress: 'The address already exists!', - // Backup_Account 页面 - Warning: 'Warning', - BeforeSafe: 'Before you continue,make sure you have properly backed up your seed in a safe place as', - Restore: 'It is needed ro restore your account', - // camera 页面 - QRCodeTip: 'Put the QR code into the box you can scan it automatically', - Flashlight: 'Click on/off the flashlight', - // coin_details 页面 - AssetsOption: 'Assets change record, Unit(xxx)', - AssetsOption_new: 'Assets change record, Unit', - // make_transfer 页面 - Transfer: 'Transfer DOT', - TransferFailed: 'Transfer Failed.', - TransferSuccess: 'Transfer Success.', - SubmitTransaction: 'Submit Transaction', - recipientAddress: 'to the recipient address', - sendOf: 'send a value of ', - send: 'Send', - PleaseEnterAddress: 'Please enter address', - creationFee: 'creationFee', - existentialDeposit: 'existentialDeposit', - transactionBaseFee: 'transactionBaseFee', - transactionByteFee: 'transactionByteFee', - transferFee: 'transferFee', - MakeTransfer: 'Make Transfer', - // Transfer 页面 - enterValue: 'Please enter Send a value', - enterInformation: 'Please enter the correct information.', - // Transfer_details 页面 - Details: 'Details', - Successed: 'Successed', - Balance: 'Balance', - Fees: 'Fees', - To: 'To', - From: 'From', - Block: 'Block', - BlockHash: 'BlockHash', - // make_transfer 页面 - TransferDOT: 'Transfer DOT', - calling: 'calling', - withIndex: 'with an index of ', - SignAndSubmit: 'Sign and Submit', - // Receive - CopyAddress: 'Copy address', - // MnemonicWord.js - MWTitle: 'Backup prom', - MWTip1: 'Getting a mnemonic equals ownership of a wallet asset', - MWTip2: 'Backup mnemonic', - MWTip3: 'Use paper and pen to correctly copy mnemonics', - MWTip4: 'If your phone is lost, stolen or damaged, the mnemonic will restore your assets.', - MWTip5: 'Offline storage', - MWTip6: 'Keep it safe to a safe place on the isolated network', - MWTip7: - 'Do not share and store mnemonics in a networked environment, such as emails, photo albums, social applications', - MWTip9: 'Do not take screenshots', - MWTip10: 'Do not screen capture and storage, which may be collected by third-party malware, resulting in asset loss', - MWTip11: 'cancel', - MWTip12: 'Got it', - MWTip13: 'Please accurately copy and safely backup the mnemonic', - MWTip14: 'Please click on mnemonics in order to confirm that you have backed up correctly', - MWTip15: 'The order of the mnemonic is incorrect,please proofread' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + Alexander: 'Alexander TestNet', + Receive: 'Receive', + Account: 'Account', + AssetsList: 'Assets list', + Scan: 'Scan', + Menu: 'Menu', + CreateAccount: 'Create Account', + // Create_Account 页面 + balance: 'balance', + Createfrom: 'Create from mnemonic,seed or import keystore', + WordMnemonic12: '12 Word Mnemonic', + WordMnemonic24: '24 Word Mnemonic', + RawSeed: 'Raw Seed', + ImportKeystore: 'import keystore', + NameTheAccount: 'name the account', + Password: 'encrypt it using a password', + EnterName: 'Please enter your name', + EnterPassword: 'Please enter your password', + EnterPassword_d: 'Please confirm the password', + CheckPassword: 'The two passwords do not match. Please re-enter them', + ExistingAddress: 'The address already exists!', + // Backup_Account 页面 + Warning: 'Warning', + BeforeSafe: 'Before you continue,make sure you have properly backed up your seed in a safe place as', + Restore: 'It is needed ro restore your account', + // camera 页面 + QRCodeTip: 'Put the QR code into the box you can scan it automatically', + Flashlight: 'Click on/off the flashlight', + // coin_details 页面 + AssetsOption: 'Assets change record, Unit(xxx)', + AssetsOption_new: 'Assets change record, Unit', + // make_transfer 页面 + Transfer: 'Transfer DOT', + TransferFailed: 'Transfer Failed.', + TransferSuccess: 'Transfer Success.', + SubmitTransaction: 'Submit Transaction', + recipientAddress: 'to the recipient address', + sendOf: 'send a value of ', + send: 'Send', + PleaseEnterAddress: 'Please enter address', + creationFee: 'creationFee', + existentialDeposit: 'existentialDeposit', + transactionBaseFee: 'transactionBaseFee', + transactionByteFee: 'transactionByteFee', + transferFee: 'transferFee', + MakeTransfer: 'Make Transfer', + // Transfer 页面 + enterValue: 'Please enter Send a value', + enterInformation: 'Please enter the correct information.', + // Transfer_details 页面 + Details: 'Details', + Successed: 'Successed', + Balance: 'Balance', + Fees: 'Fees', + To: 'To', + From: 'From', + Block: 'Block', + BlockHash: 'BlockHash', + // make_transfer 页面 + TransferDOT: 'Transfer DOT', + calling: 'calling', + withIndex: 'with an index of ', + SignAndSubmit: 'Sign and Submit', + // Receive + CopyAddress: 'Copy address', + // MnemonicWord.js + MWTitle: 'Backup prom', + MWTip1: 'Getting a mnemonic equals ownership of a wallet asset', + MWTip2: 'Backup mnemonic', + MWTip3: 'Use paper and pen to correctly copy mnemonics', + MWTip4: 'If your phone is lost, stolen or damaged, the mnemonic will restore your assets.', + MWTip5: 'Offline storage', + MWTip6: 'Keep it safe to a safe place on the isolated network', + MWTip7: + 'Do not share and store mnemonics in a networked environment, such as emails, photo albums, social applications', + MWTip9: 'Do not take screenshots', + MWTip10: 'Do not screen capture and storage, which may be collected by third-party malware, resulting in asset loss', + MWTip11: 'cancel', + MWTip12: 'Got it', + MWTip13: 'Please accurately copy and safely backup the mnemonic', + MWTip14: 'Please click on mnemonics in order to confirm that you have backed up correctly', + MWTip15: 'The order of the mnemonic is incorrect,please proofread' +} diff --git a/src/locales/en-US/Democracy/index.js b/src/locales/en-US/Democracy/index.js index eb06839e..2fd7d5da 100755 --- a/src/locales/en-US/Democracy/index.js +++ b/src/locales/en-US/Democracy/index.js @@ -1,36 +1,36 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -export default { - // Democracy.js - proposals: 'proposals', - referendums: 'referendums', - // proposals.js - noProposals: 'no available proposals', - depositors: 'depositors', - balance: 'balance', - blocksLaunch: 'blocks launch', - // referendums.js - Active: 'Active', - // referendums/Active.js - noReferendums: 'no available referendums', - blocksEnd: 'blocks end', - Threshold: 'Threshold', - Aye: 'Aye', - Nay: 'Nay', - // secondary/NayorAye.js - VoteSuccess: 'Vote success', - VoteFailed: 'Vote Failed', - Voting: 'Voting', - vote: 'vote', - referendumIndex: 'referendum index' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + // Democracy.js + proposals: 'proposals', + referendums: 'referendums', + // proposals.js + noProposals: 'no available proposals', + depositors: 'depositors', + balance: 'balance', + blocksLaunch: 'blocks launch', + // referendums.js + Active: 'Active', + // referendums/Active.js + noReferendums: 'no available referendums', + blocksEnd: 'blocks end', + Threshold: 'Threshold', + Aye: 'Aye', + Nay: 'Nay', + // secondary/Vote.js + VoteSuccess: 'Vote success', + VoteFailed: 'Vote Failed', + Voting: 'Voting', + vote: 'vote', + referendumIndex: 'referendum index' +} diff --git a/src/locales/en-US/Profile/index.js b/src/locales/en-US/Profile/index.js index bdc576c0..314bb487 100755 --- a/src/locales/en-US/Profile/index.js +++ b/src/locales/en-US/Profile/index.js @@ -1,97 +1,97 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-22 00:27:44 - */ -export default { - Setting: 'Setting', - ManageAccount: 'Manage Account', - // secondary/About.js - About: 'About', - PolkadotApp: 'Mobile wallet for Polkadot.', - Version: 'Version', - // secondary/add_address.js - addAddresses: 'Add addresses', - Addresses: 'Addresses', - Save: 'Save', - SaveSuccess: 'Save Success', - - // secondary/address_information.js - DeleteAddress: 'Delete Address', - Name: 'Name', - Memo: 'Memo', - Address: 'Address', - - // secondary/Addressed.js - // Addresses: 'Addresses', - - // secondary/Manage_Account.js - deleteTip: 'Confirm deleting this account ?', - DeleteSuccess: 'Delete success', - ChangeName: 'Change name', - // ChangePassword: 'Change password', - ExportKeystore: 'Export Keystore', - DeleteAccount: 'Delete Account', - unlockPassword: 'Please enter your password to unlock', - saveInformation: 'Please save your information', - Continue: 'Continue', - Copy: 'Copy', - - // secondary/Setting.js - restartApp: 'Download finished, whether to restart the application?', - UpdateFailed: 'Update failed.', - toAppStore: - 'Your application version has been updated, please go to the official website to download the new version.', - appV: 'Your application version is up to date.', - checkNewV: 'Check the new version:', - download: 'whether to download?', - nextTime: 'Next startup time', - gestureCanceled: 'The gesture password has been canceled', - Settings: 'Settings', - Gesture: 'Gesture', - RemoteNode: 'Remote Node', - CheckUpdate: 'Check Update', - deleteGP: 'Delete gesture password ?', - // secondary/Change/Change_Name.js - // CurrentPassword: 'Current password', - NewName: 'New name', - entPwd: 'Please enter your current password', - entName: 'Please enter your new name', - - // secondary/Change/Change_Password.js - - CurrentPassword: 'Current password', - NewPassword: 'New password', - RepeatPassword: 'Repeat password', - differentPassword: 'The two passwords are different', - Modify: 'Modify the success', - PasswordMistake: 'Password mistake', - ChangePassword: 'Change Password', - Change: 'Change', - - // secondary/Settings/Gesture.js - setGesture: 'Please set the gesture password.', - confirmGesture: 'Please confirm the gesture password.', - gestureSuccess: 'Confirmed, password set successfully.', - gestureFailed: 'Confirmation failed, please reset.', - inputPWD: 'Please input your password.', - inputPWD_d: 'Please input your password (again).', - - // secondary/Settings/Set_Node.js - SetNode: 'Set Node', - SelectNode: 'Select your Node', - Custom: 'Custom', - changeNode: 'Make sure you change Node to:', - Confirm: 'Confirm', - Cancel: 'Cancel', - NOTETip_1: 'import remote node,if not is Alexander,not have the chart function', - NOTETip_2: 'NOTE: Exit the app,will return to the default', - enterNode: 'Please enter your custom Node' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + Setting: 'Setting', + ManageAccount: 'Manage Account', + // secondary/About.js + About: 'About', + PolkadotApp: 'Mobile wallet for Polkadot.', + Version: 'Version', + // secondary/add_address.js + addAddresses: 'Add addresses', + Addresses: 'Addresses', + Save: 'Save', + SaveSuccess: 'Save Success', + + // secondary/address_information.js + DeleteAddress: 'Delete Address', + Name: 'Name', + Memo: 'Memo', + Address: 'Address', + + // secondary/Addressed.js + // Addresses: 'Addresses', + + // secondary/Manage_Account.js + deleteTip: 'Confirm deleting this account ?', + DeleteSuccess: 'Delete success', + ChangeName: 'Change name', + // ChangePassword: 'Change password', + ExportKeystore: 'Export Keystore', + DeleteAccount: 'Delete Account', + unlockPassword: 'Please enter your password to unlock', + saveInformation: 'Please save your information', + Continue: 'Continue', + Copy: 'Copy', + + // secondary/Setting.js + restartApp: 'Download finished, whether to restart the application?', + UpdateFailed: 'Update failed.', + toAppStore: + 'Your application version has been updated, please go to the official website to download the new version.', + appV: 'Your application version is up to date.', + checkNewV: 'Check the new version:', + download: 'whether to download?', + nextTime: 'Next startup time', + gestureCanceled: 'The gesture password has been canceled', + Settings: 'Settings', + Gesture: 'Gesture', + RemoteNode: 'Remote Node', + CheckUpdate: 'Check Update', + deleteGP: 'Delete gesture password ?', + // secondary/Change/Change_Name.js + // CurrentPassword: 'Current password', + NewName: 'New name', + entPwd: 'Please enter your current password', + entName: 'Please enter your new name', + + // secondary/Change/Change_Password.js + + CurrentPassword: 'Current password', + NewPassword: 'New password', + RepeatPassword: 'Repeat password', + differentPassword: 'The two passwords are different', + Modify: 'Password changed successfully', + PasswordMistake: 'Password mistake', + ChangePassword: 'Change Password', + Change: 'Change', + + // secondary/Settings/Gesture.js + setGesture: 'Please set the gesture password.', + confirmGesture: 'Please confirm the gesture password.', + gestureSuccess: 'Confirmed, password set successfully.', + gestureFailed: 'Confirmation failed, please reset.', + inputPWD: 'Please input your password.', + inputPWD_d: 'Please input your password (again).', + + // secondary/Settings/Set_Node.js + SetNode: 'Set Node', + SelectNode: 'Select your Node', + Custom: 'Custom', + changeNode: 'Make sure you change Node to:', + Confirm: 'Confirm', + Cancel: 'Cancel', + NOTETip_1: 'import remote node,if not is Alexander,not have the chart function', + NOTETip_2: 'NOTE: Exit the app,will return to the default', + enterNode: 'Please enter your custom Node' +} diff --git a/src/locales/en-US/Staking/index.js b/src/locales/en-US/Staking/index.js index a5a6637c..e5789088 100755 --- a/src/locales/en-US/Staking/index.js +++ b/src/locales/en-US/Staking/index.js @@ -1,103 +1,103 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -export default { - // Staking.js - stakingOverview: 'Staking Overview', - AccountActions: 'Account Actions', - // Staking Overview 版块 - validatorsNum: 'validators', - intentions: 'intentions', - session: 'session', - era: 'era', - validators: 'Validators', - nextUp: 'Next up', - NoValidator: '- Not have Validator.', - NoNextUp: 'Not have Next up', - // Account Actions 版块 - stakingOption: 'Staking slash record, Unit(xxx)', - stakingOption_new: 'Staking slash record, Unit', - controller: 'controller', - stash: 'stash', - balance: 'balance', - locked: 'locked', - eraLeft: 'era left', - BondAdditional: 'Bond Additional', - BondFunds: 'Bond Funds', - validate: 'validate', - Nominate: 'Nominate', - Unvalidate: 'Unvalidate', - Unnominate: 'Unnominate', - SlashRecords: 'Slash Records', - Nominating: 'Nominating', - MyNominators: 'MyNominators', - noNominating: '-You are not nominating.', - noNominee: "-You don't have nominee", - SetSessionKey: 'SetSessionKey', - Unbond: 'Unbond', - PleaseChoose: 'Please choose', - // Validator_Info.js - Nominators: 'Nominators', - ValidatorInfo: 'Validator Info', - V_no_Nominator: '- Not have Nominator.', - V_no_SR: '- Not have Slash Record.', - // BondAdditional.js - BondExtraFailed: 'Bond Extra Failed', - BondExtraSuccess: 'Bond Extra success', - BondExtra: 'Bond Extra', - BondingPreferences: 'Bonding Preferences', - calling: 'calling', - additionalValue: 'max additional value', - // BondFunds.js - BondSuccess: 'Bond success', - BondFailed: 'Bond Failed', - Bonding: 'Bonding', - Controller: 'Controller', - payee: 'payee', - valueBonded: 'value bonded', - // nominate.js - NominateSuccess: 'Nominate success', - NominateFailed: 'Nominate Failed', - NominateValidator: 'Nominate Validator', - // Nominate: 'Nominate', - multipleAddresses: 'If there are multiple addresses, separate them with a ","', - nominateAddress: 'nominate the following address (validator or intention) ', - // setSessionKey.js - SessionKeyFailed: 'Set SessionKey Failed', - SessionKeySuccess: 'Set SessionKey success', - setSessionKey: 'Set SessionKey', - SessionKey: 'SessionKey', - Set: 'Set', - // stake.js - ValidateSuccess: 'Validate success', - ValidateFailed: 'Validate Failed', - Validate: 'Validate', - unstakeThreshold: 'unstake Threshold', - validatorPayment: 'validator Payment', - // Unbond.js - UnbondFailed: 'Unbond Failed', - UnbondSuccess: 'Unbond success', - unbondAmount: 'unbond amount', - UnBond: 'UnBond', - // unniminate.js - UnnominateFailed: 'Unnominate Failed', - UnnominateSuccess: 'Unnominate success', - // Unnominate: 'Unnominate', - nominateTip: - "Will panic if called when source isn't currently nominating target. Updates Nominating, NominatorsFor and NominationBalance.", - // unstake.js - UnvalidateSuccess: 'Unvalidate success', - UnvalidateFailed: 'Unvalidate Failed', - // Unvalidate: 'Unvalidate', - UnvalidateTip: - 'Retract the desire to stake for the transactor. Effects will be felt at the beginning of the next era.' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + // Staking.js + stakingOverview: 'Staking Overview', + AccountActions: 'Account Actions', + // Staking Overview 版块 + validatorsNum: 'validators', + intentions: 'intentions', + session: 'session', + era: 'era', + validators: 'Validators', + nextUp: 'Next up', + NoValidator: '- Not have Validator.', + NoNextUp: 'Not have Next up', + // Account Actions 版块 + stakingOption: 'Staking slash record, Unit(xxx)', + stakingOption_new: 'Staking slash record, Unit', + controller: 'controller', + stash: 'stash', + balance: 'balance', + locked: 'locked', + eraLeft: 'era left', + BondAdditional: 'Bond Additional', + BondFunds: 'Bond Funds', + validate: 'validate', + Nominate: 'Nominate', + Unvalidate: 'Unvalidate', + Unnominate: 'Unnominate', + SlashRecords: 'Slash Records', + Nominating: 'Nominating', + MyNominators: 'MyNominators', + noNominating: '-You are not nominating.', + noNominee: "-You don't have nominee", + SetSessionKey: 'SetSessionKey', + Unbond: 'Unbond', + PleaseChoose: 'Please choose', + // Validator_Info.js + Nominators: 'Nominators', + ValidatorInfo: 'Validator Info', + V_no_Nominator: '- Not have Nominator.', + V_no_SR: '- Not have Slash Record.', + // BondAdditional.js + BondExtraFailed: 'Bond Extra Failed', + BondExtraSuccess: 'Bond Extra success', + BondExtra: 'Bond Extra', + BondingPreferences: 'Bonding Preferences', + calling: 'calling', + additionalValue: 'max additional value', + // BondFunds.js + BondSuccess: 'Bond success', + BondFailed: 'Bond Failed', + Bonding: 'Bonding', + Controller: 'Controller', + payee: 'payee', + valueBonded: 'value bonded', + // nominate.js + NominateSuccess: 'Nominate success', + NominateFailed: 'Nominate Failed', + NominateValidator: 'Nominate Validator', + // Nominate: 'Nominate', + multipleAddresses: 'If there are multiple addresses, separate them with a ","', + nominateAddress: 'nominate the following address (validator or intention) ', + // setSessionKey.js + SessionKeyFailed: 'Set SessionKey Failed', + SessionKeySuccess: 'Set SessionKey success', + setSessionKey: 'Set SessionKey', + SessionKey: 'SessionKey', + Set: 'Set', + // stake.js + ValidateSuccess: 'Validate success', + ValidateFailed: 'Validate Failed', + Validate: 'Validate', + unstakeThreshold: 'unstake Threshold', + validatorPayment: 'validator Payment', + // Unbond.js + UnbondFailed: 'Unbond Failed', + UnbondSuccess: 'Unbond success', + unbondAmount: 'unbond amount', + UnBond: 'UnBond', + // unniminate.js + UnnominateFailed: 'Unnominate Failed', + UnnominateSuccess: 'Unnominate success', + // Unnominate: 'Unnominate', + nominateTip: + "Will panic if called when source isn't currently nominating target. Updates Nominating, NominatorsFor and NominationBalance.", + // unstake.js + UnvalidateSuccess: 'Unvalidate success', + UnvalidateFailed: 'Unvalidate Failed', + // Unvalidate: 'Unvalidate', + UnvalidateTip: + 'Retract the desire to stake for the transactor. Effects will be felt at the beginning of the next era.' +} diff --git a/src/locales/en-US/index.js b/src/locales/en-US/index.js index 818a08c9..67aba4b6 100755 --- a/src/locales/en-US/index.js +++ b/src/locales/en-US/index.js @@ -1,58 +1,58 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import Assets from './Assets/index' -import Staking from './Staking/index' -import Democracy from './Democracy/index' -import Profile from './Profile/index' - -export default { - TAB: { - Assets: 'Assets', - Staking: 'Staking', - Democracy: 'Democracy', - Profile: 'Profile', - ChangeLanguages: 'Change Languages', - PasswordMistake: 'Password mistake.', - PasswordCorrect: 'Password is correct.', - Reset: 'Reset', - Save: 'Save', - Exit: 'Exit', - Copy: 'Copy', - Continue: 'Continue', - Cancel: 'Cancel', - StakingOption: 'Assets change record, Unit(xxx) ', - Receive: 'Receive', - Received: 'Received', - Send: 'Send', - loadMore: 'To load more ~', - Bottom: '~ Bottom', - noResponse: 'Long time no response, please try again.', - enterInformation: 'Please enter relevant information.', - signMess: 'You are about to sign a message from', - unlockPassword: 'unlock account using password', - loading: 'loading', - CopySuccess: 'Copy success' - }, - Assets: { - ...Assets - }, - Staking: { - ...Staking - }, - Democracy: { - ...Democracy - }, - Profile: { - ...Profile - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import Assets from './Assets/index' +import Staking from './Staking/index' +import Democracy from './Democracy/index' +import Profile from './Profile/index' + +export default { + TAB: { + Assets: 'Assets', + Staking: 'Staking', + Democracy: 'Democracy', + Profile: 'Profile', + ChangeLanguages: 'Change Languages', + PasswordMistake: 'Password mistake.', + PasswordCorrect: 'Password is correct.', + Reset: 'Reset', + Save: 'Save', + Exit: 'Exit', + Copy: 'Copy', + Continue: 'Continue', + Cancel: 'Cancel', + StakingOption: 'Assets change record, Unit(xxx) ', + Receive: 'Receive', + Received: 'Received', + Send: 'Send', + loadMore: 'To load more ~', + Bottom: '~ Bottom', + noResponse: 'Long time no response, please try again.', + enterInformation: 'Please enter relevant information.', + signMess: 'You are about to sign a message from', + unlockPassword: 'unlock account using password', + loading: 'loading', + CopySuccess: 'Copy success' + }, + Assets: { + ...Assets + }, + Staking: { + ...Staking + }, + Democracy: { + ...Democracy + }, + Profile: { + ...Profile + } +} diff --git a/src/locales/i18n.js b/src/locales/i18n.js index b8149f59..487b79d6 100755 --- a/src/locales/i18n.js +++ b/src/locales/i18n.js @@ -1,37 +1,37 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import i18n from 'react-native-i18n' -import en from './en-US/index' -import zh from './zh-CN/index' -import DataRepository from '../util/DataRepository' - -i18n.defaultLocale = 'en' -i18n.fallbacks = true -i18n.translations = { - zh, - en -} -i18n.localeLanguage = () => { - new DataRepository() - .fetchLocalRepository('localLanguage') - .then(res => { - i18n.locale = res - }) - .catch(() => { - i18n.locale = 'en' - }) - - return i18n.locale -} -i18n.locale = 'en' -export default i18n +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import i18n from 'react-native-i18n' +import en from './en-US/index' +import zh from './zh-CN/index' +import DataRepository from '../util/DataRepository' + +i18n.defaultLocale = 'en' +i18n.fallbacks = true +i18n.translations = { + zh, + en +} +i18n.localeLanguage = () => { + new DataRepository() + .fetchLocalRepository('localLanguage') + .then(res => { + i18n.locale = res + }) + .catch(() => { + i18n.locale = 'en' + }) + + return i18n.locale +} +i18n.locale = 'en' +export default i18n diff --git a/src/locales/zh-CN/Assets/index.js b/src/locales/zh-CN/Assets/index.js index 382863ab..1939526a 100755 --- a/src/locales/zh-CN/Assets/index.js +++ b/src/locales/zh-CN/Assets/index.js @@ -1,96 +1,96 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-21 20:09:00 - */ -export default { - Alexander: 'Alexander 测试网', - Receive: '接收', - Account: '账户', - AssetsList: '资产列表', - Menu: '菜单', - Scan: '扫描', - CreateAccount: '创建账户', - // Create_Account 页面 - balance: '余额', - Createfrom: '用助记词、种子创建,或导入keystore', - WordMnemonic12: '12词助记词', - WordMnemonic24: '24词助记词', - RawSeed: '密钥种子', - ImportKeystore: '导入keystore', - NameTheAccount: '账户名字', - Password: '密码', - EnterName: '请输入名称', - EnterPassword: '请输入密码', - EnterPassword_d: '请确认密码', - CheckPassword: '两次密码不一致,请再次输入', - ExistingAddress: '该地址已存在!', - // Backup_Account 页面 - Warning: '注意', - BeforeSafe: '请确保已经备份了信息在安全的地方。', - Restore: '用于以后恢复账户', - // camera 页面 - QRCodeTip: '将二维码放入框中,即可自动扫描', - Flashlight: '照明开关', - // coin_details 页面 - AssetsOption: '资产变化记录,单位(xxx)', - AssetsOption_new: '资产变化记录,单位', - // make_transfer 页面 - - Transfer: 'DOT 交易', - TransferFailed: '交易失败', - TransferSuccess: '交易成功', - SubmitTransaction: '发起交易', - recipientAddress: '接收地址', - sendOf: '发送数量', - send: '发送', - PleaseEnterAddress: '请输入地址', - creationFee: '创建账户手续费', - existentialDeposit: '账户存在最低存额', - transactionBaseFee: '交易基础手续费', - transactionByteFee: '交易字节费', - transferFee: '转账费', - MakeTransfer: '发送交易', - - // Transfer 页面 - enterValue: '请输入发送数量', - enterInformation: '请输入正确的信息', - // Transfer_details 页面 - Details: '交易详情', - Successed: '成功', - Balance: '金额', - Fees: '手续费', - To: '接收方', - From: '发送方', - Block: '区块高度', - BlockHash: '区块哈希', - // make_transfer 页面 - calling: '调用', - withIndex: '账户交易编号', - SignAndSubmit: '签名并提交', - // Receive - CopyAddress: '复制地址', - // MnemonicWord.js - MWTitle: '备份提示', - MWTip1: '获得助记词等于拥有钱包资产所有权', - MWTip2: '备份助记词', - MWTip3: '使用纸和笔正确抄写助记词', - MWTip4: '如果你的手机丢失、被盗、损坏,助记词将可以恢复你的资产', - MWTip5: '离线保存', - MWTip6: '妥善保管至隔离网络的安全地方', - MWTip7: '请勿将助记词在联网环境下分享和储存,比如邮件、相册、社交应用等', - MWTip9: '请勿截屏', - MWTip10: '请勿截屏分享和存储,这将可能被第三方恶意软件手机,造成资产损坏', - MWTip11: '取消', - MWTip12: '知道了', - MWTip13: '请准确抄写并安全备份助记词。', - MWTip14: '请按顺序点击助记词,以确认您正确备份。', - MWTip15: '助记词顺序不正确,请校对' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + Alexander: 'Alexander 测试网', + Receive: '接收', + Account: '账户', + AssetsList: '资产列表', + Menu: '菜单', + Scan: '扫描', + CreateAccount: '创建账户', + // Create_Account 页面 + balance: '余额', + Createfrom: '用助记词、种子创建,或导入keystore', + WordMnemonic12: '12词助记词', + WordMnemonic24: '24词助记词', + RawSeed: '密钥种子', + ImportKeystore: '导入keystore', + NameTheAccount: '账户名字', + Password: '密码', + EnterName: '请输入名称', + EnterPassword: '请输入密码', + EnterPassword_d: '请确认密码', + CheckPassword: '两次密码不一致,请再次输入', + ExistingAddress: '该地址已存在!', + // Backup_Account 页面 + Warning: '注意', + BeforeSafe: '请确保已经备份了信息在安全的地方。', + Restore: '用于以后恢复账户', + // camera 页面 + QRCodeTip: '将二维码放入框中,即可自动扫描', + Flashlight: '照明开关', + // coin_details 页面 + AssetsOption: '资产变化记录,单位(xxx)', + AssetsOption_new: '资产变化记录,单位', + // make_transfer 页面 + + Transfer: 'DOT 交易', + TransferFailed: '交易失败', + TransferSuccess: '交易成功', + SubmitTransaction: '发起交易', + recipientAddress: '接收地址', + sendOf: '发送数量', + send: '发送', + PleaseEnterAddress: '请输入地址', + creationFee: '创建账户手续费', + existentialDeposit: '账户存在最低存额', + transactionBaseFee: '交易基础手续费', + transactionByteFee: '交易字节费', + transferFee: '转账费', + MakeTransfer: '发送交易', + + // Transfer 页面 + enterValue: '请输入发送数量', + enterInformation: '请输入正确的信息', + // Transfer_details 页面 + Details: '交易详情', + Successed: '成功', + Balance: '金额', + Fees: '手续费', + To: '接收方', + From: '发送方', + Block: '区块高度', + BlockHash: '区块哈希', + // make_transfer 页面 + calling: '调用', + withIndex: '账户交易编号', + SignAndSubmit: '签名并提交', + // Receive + CopyAddress: '复制地址', + // MnemonicWord.js + MWTitle: '备份提示', + MWTip1: '获得助记词等于拥有钱包资产所有权', + MWTip2: '备份助记词', + MWTip3: '使用纸和笔正确抄写助记词', + MWTip4: '如果你的手机丢失、被盗、损坏,助记词将可以恢复你的资产', + MWTip5: '离线保存', + MWTip6: '妥善保管至隔离网络的安全地方', + MWTip7: '请勿将助记词在联网环境下分享和储存,比如邮件、相册、社交应用等', + MWTip9: '请勿截屏', + MWTip10: '请勿截屏分享和存储,这将可能被第三方恶意软件手机,造成资产损坏', + MWTip11: '取消', + MWTip12: '知道了', + MWTip13: '请准确抄写并安全备份助记词。', + MWTip14: '请按顺序点击助记词,以确认您正确备份。', + MWTip15: '助记词顺序不正确,请校对' +} diff --git a/src/locales/zh-CN/Democracy/index.js b/src/locales/zh-CN/Democracy/index.js index 523478dd..770768cd 100755 --- a/src/locales/zh-CN/Democracy/index.js +++ b/src/locales/zh-CN/Democracy/index.js @@ -1,36 +1,36 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -export default { - // Democracy.js - proposals: '提案', - referendums: '公投', - // proposals.js - noProposals: '没有可用的提案', - depositors: '寄托人', - balance: '金额', - blocksLaunch: '区块后发起', - // referendums.js - Active: '正在进行', - // referendums/Active.js - noReferendums: '没有正在进行的公投', - blocksEnd: '区块后结束', - Threshold: '阀值', - Aye: '赞成', - Nay: '反对', - // secondary/NayorAye.js - VoteSuccess: '投票成功!', - VoteFailed: '投票失败!', - Voting: '投票', - vote: '投票', - referendumIndex: '公投编号' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + // Democracy.js + proposals: '提案', + referendums: '公投', + // proposals.js + noProposals: '没有可用的提案', + depositors: '寄托人', + balance: '金额', + blocksLaunch: '区块后发起', + // referendums.js + Active: '正在进行', + // referendums/Active.js + noReferendums: '没有正在进行的公投', + blocksEnd: '区块后结束', + Threshold: '阀值', + Aye: '赞成', + Nay: '反对', + // secondary/NayorAye.js + VoteSuccess: '投票成功!', + VoteFailed: '投票失败!', + Voting: '投票', + vote: '投票', + referendumIndex: '公投编号' +} diff --git a/src/locales/zh-CN/Profile/index.js b/src/locales/zh-CN/Profile/index.js index d0c03a0a..81e0d17b 100755 --- a/src/locales/zh-CN/Profile/index.js +++ b/src/locales/zh-CN/Profile/index.js @@ -1,95 +1,95 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-22 00:28:12 - */ -export default { - ManageAccount: '账户管理', - Setting: '设置', - // secondary/About.js - About: '关于', - PolkadotApp: 'Polkadot生态移动端钱包。', - Version: '版本', - // secondary/add_address.js - Addresses: '地址薄', - Save: '保存', - SaveSuccess: '保存成功', - - // secondary/address_information.js - - addAddresses: '添加地址', - DeleteAddress: '删除地址', - Name: '名称', - Memo: '备注', - Address: '地址', - - // secondary/Addressed.js - - // secondary/Manage_Account.js - deleteTip: '确认删除此账户?', - DeleteSuccess: '账户删除成功!', - ChangeName: '修改名称', - ChangePassword: '修改密码', - ExportKeystore: '导出 Keystore', - DeleteAccount: '删除账户', - unlockPassword: '请输入密码解锁账户', - saveInformation: '请保存你的信息', - Continue: '继续', - Copy: '复制', - - // secondary/Setting.js - restartApp: '下载完成,是否重启应用?', - UpdateFailed: '更新失败', - toAppStore: '应用版本有更新,请去官网下载新版本', - appV: '已经是最新版本', - checkNewV: '检查到新版本', - download: '是否下载?', - nextTime: '下次再说', - gestureCanceled: '手势密码修改成功', - Settings: '配置', - Gesture: '手势', - RemoteNode: '远程节点', - CheckUpdate: '检查更新', - deleteGP: '删除手势密码?', - // secondary/Change/Change_Name.js - CurrentPassword: '输入密码', - NewName: '新名称', - entPwd: '请输入当前密码', - entName: '请输入新名称', - // secondary/Change/Change_Password.js - - // CurrentPassword: '当前密码', - NewPassword: '新密码', - RepeatPassword: '确认密码', - differentPassword: '两次密码输入不一致', - Modify: '修改成功!', - PasswordMistake: '密码错误', - // ChangePassword: '修改密码', - Change: '修改', - - // secondary/Settings/Gesture.js - setGesture: '请设置手势密码', - confirmGesture: '请确认手势密码', - gestureSuccess: '手势密码设置成功!', - gestureFailed: '手势密码设置失败,请重新设置', - inputPWD: '请输入手势密码', - inputPWD_d: '请再次输入手势密码', - - // secondary/Settings/Set_Node.js - SetNode: '设置节点', - SelectNode: '选择连接节点', - Custom: '自定义', - changeNode: '确认节点连接:', - Confirm: '确认', - Cancel: '取消', - NOTETip_1: '导入节点连接,如果不是Alexander,则没有图表功能。', - NOTETip_2: '注:退出app,将返回默认节点', - enterNode: '请输入自定义节点' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + ManageAccount: '账户管理', + Setting: '设置', + // secondary/About.js + About: '关于', + PolkadotApp: 'Polkadot生态移动端钱包。', + Version: '版本', + // secondary/add_address.js + Addresses: '地址薄', + Save: '保存', + SaveSuccess: '保存成功', + + // secondary/address_information.js + + addAddresses: '添加地址', + DeleteAddress: '删除地址', + Name: '名称', + Memo: '备注', + Address: '地址', + + // secondary/Addressed.js + + // secondary/Manage_Account.js + deleteTip: '确认删除此账户?', + DeleteSuccess: '账户删除成功!', + ChangeName: '修改名称', + ChangePassword: '修改密码', + ExportKeystore: '导出 Keystore', + DeleteAccount: '删除账户', + unlockPassword: '请输入密码解锁账户', + saveInformation: '请保存你的信息', + Continue: '继续', + Copy: '复制', + + // secondary/Setting.js + restartApp: '下载完成,是否重启应用?', + UpdateFailed: '更新失败', + toAppStore: '应用版本有更新,请去官网下载新版本', + appV: '已经是最新版本', + checkNewV: '检查到新版本', + download: '是否下载?', + nextTime: '下次再说', + gestureCanceled: '手势密码修改成功', + Settings: '配置', + Gesture: '手势', + RemoteNode: '远程节点', + CheckUpdate: '检查更新', + deleteGP: '删除手势密码?', + // secondary/Change/Change_Name.js + CurrentPassword: '输入密码', + NewName: '新名称', + entPwd: '请输入当前密码', + entName: '请输入新名称', + // secondary/Change/Change_Password.js + + // CurrentPassword: '当前密码', + NewPassword: '新密码', + RepeatPassword: '确认密码', + differentPassword: '两次密码输入不一致', + Modify: '修改成功!', + PasswordMistake: '密码错误', + // ChangePassword: '修改密码', + Change: '修改', + + // secondary/Settings/Gesture.js + setGesture: '请设置手势密码', + confirmGesture: '请确认手势密码', + gestureSuccess: '手势密码设置成功!', + gestureFailed: '手势密码设置失败,请重新设置', + inputPWD: '请输入手势密码', + inputPWD_d: '请再次输入手势密码', + + // secondary/Settings/Set_Node.js + SetNode: '设置节点', + SelectNode: '选择连接节点', + Custom: '自定义', + changeNode: '确认节点连接:', + Confirm: '确认', + Cancel: '取消', + NOTETip_1: '导入节点连接,如果不是Alexander,则没有图表功能。', + NOTETip_2: '注:退出app,将返回默认节点', + enterNode: '请输入自定义节点' +} diff --git a/src/locales/zh-CN/Staking/index.js b/src/locales/zh-CN/Staking/index.js index dccb0b60..e46c0f6b 100755 --- a/src/locales/zh-CN/Staking/index.js +++ b/src/locales/zh-CN/Staking/index.js @@ -1,100 +1,100 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -export default { - // Staking.js - stakingOverview: '抵押概况', - AccountActions: '账户操作', - // Staking Overview 版块 - validatorsNum: '验证者数量', - intentions: '意图者数量', - session: '会话周期', - era: '时代周期', - validators: '验证者', - nextUp: '候选人', - NoValidator: '没有验证者,或网络延时', - NoNextUp: '没有候选人,或网络延时', - // Account Actions 版块 - stakingOption: '削减历史记录,单位(xxx)', - stakingOption_new: '削减历史记录,单位', - controller: '控制账户', - stash: '存储账户', - balance: '余额', - locked: '锁定', - eraLeft: '剩下时代数', - BondAdditional: '追加绑定', - BondFunds: '绑定', - validate: '验证', - Nominate: '提名', - Unvalidate: '取消验证', - Unnominate: '取消提名', - SlashRecords: '削减记录', - Nominating: '我正在提名', - MyNominators: '提名我的', - noNominating: '没有正在提名', - noNominee: '没有提名者', - SetSessionKey: '设置会话账户', - Unbond: '解绑', - PleaseChoose: '请选择', - // Validator_Info.js - Nominators: '提名者', - ValidatorInfo: '验证者详情', - V_no_Nominator: '没有提名人', - V_no_SR: '没有削减记录', - // BondAdditional.js - BondExtraFailed: '追加绑定失败!', - BondExtraSuccess: '追加绑定成功!', - BondExtra: '追加绑定', - BondingPreferences: '绑定参数', - calling: '调用', - additionalValue: '追加金额', - // BondFunds.js - BondSuccess: '绑定成功!', - BondFailed: '绑定失败!', - Bonding: '绑定', - Controller: '控制账户', - payee: '受益人', - valueBonded: '绑定金额', - // nominate.js - NominateSuccess: '提名成功!', - NominateFailed: '提名失败!', - NominateValidator: '提名验证者', - nominateAddress: '提名地址(验证者或意图者)', - multipleAddresses: '如果有多个地址,请用","隔开', - // setSessionKey.js - SessionKeyFailed: '设置会话账户失败!', - SessionKeySuccess: '设置会话账户成功!', - setSessionKey: '设置会话账户', - SessionKey: '会话账户', - Set: '设置', - // stake.js - ValidateSuccess: '发起验证成功!', - ValidateFailed: '发起验证失败!', - Validate: '验证', - unstakeThreshold: '自动取消阀值', - validatorPayment: '保留奖励', - // Unbond.js - UnbondFailed: '解绑失败!', - UnbondSuccess: '解绑成功!', - unbondAmount: '解绑总额', - UnBond: '解绑', - // unniminate.js - UnnominateFailed: '取消提名失败!', - UnnominateSuccess: '取消提名成功!', - // Unnominate: '取消提名', - nominateTip: '如果没有正在提名却调用该方法会引起错误。', - // unstake.js - UnvalidateSuccess: '取消验证成功!', - UnvalidateFailed: '取消验证失败!', - // Unvalidate: '取消验证', - UnvalidateTip: '撤回验证意愿,将在下一个时代生效。' -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +export default { + // Staking.js + stakingOverview: '抵押概况', + AccountActions: '账户操作', + // Staking Overview 版块 + validatorsNum: '验证者数量', + intentions: '意图者数量', + session: '会话周期', + era: '时代周期', + validators: '验证者', + nextUp: '候选人', + NoValidator: '没有验证者,或网络延时', + NoNextUp: '没有候选人,或网络延时', + // Account Actions 版块 + stakingOption: '削减历史记录,单位(xxx)', + stakingOption_new: '削减历史记录,单位', + controller: '控制账户', + stash: '存储账户', + balance: '余额', + locked: '锁定', + eraLeft: '剩下时代数', + BondAdditional: '追加绑定', + BondFunds: '绑定', + validate: '验证', + Nominate: '提名', + Unvalidate: '取消验证', + Unnominate: '取消提名', + SlashRecords: '削减记录', + Nominating: '我正在提名', + MyNominators: '提名我的', + noNominating: '没有正在提名', + noNominee: '没有提名者', + SetSessionKey: '设置会话账户', + Unbond: '解绑', + PleaseChoose: '请选择', + // Validator_Info.js + Nominators: '提名者', + ValidatorInfo: '验证者详情', + V_no_Nominator: '没有提名人', + V_no_SR: '没有削减记录', + // BondAdditional.js + BondExtraFailed: '追加绑定失败!', + BondExtraSuccess: '追加绑定成功!', + BondExtra: '追加绑定', + BondingPreferences: '绑定参数', + calling: '调用', + additionalValue: '追加金额', + // BondFunds.js + BondSuccess: '绑定成功!', + BondFailed: '绑定失败!', + Bonding: '绑定', + Controller: '控制账户', + payee: '受益人', + valueBonded: '绑定金额', + // nominate.js + NominateSuccess: '提名成功!', + NominateFailed: '提名失败!', + NominateValidator: '提名验证者', + nominateAddress: '提名地址(验证者或意图者)', + multipleAddresses: '如果有多个地址,请用","隔开', + // setSessionKey.js + SessionKeyFailed: '设置会话账户失败!', + SessionKeySuccess: '设置会话账户成功!', + setSessionKey: '设置会话账户', + SessionKey: '会话账户', + Set: '设置', + // stake.js + ValidateSuccess: '发起验证成功!', + ValidateFailed: '发起验证失败!', + Validate: '验证', + unstakeThreshold: '自动取消阀值', + validatorPayment: '保留奖励', + // Unbond.js + UnbondFailed: '解绑失败!', + UnbondSuccess: '解绑成功!', + unbondAmount: '解绑总额', + UnBond: '解绑', + // unniminate.js + UnnominateFailed: '取消提名失败!', + UnnominateSuccess: '取消提名成功!', + // Unnominate: '取消提名', + nominateTip: '如果没有正在提名却调用该方法会引起错误。', + // unstake.js + UnvalidateSuccess: '取消验证成功!', + UnvalidateFailed: '取消验证失败!', + // Unvalidate: '取消验证', + UnvalidateTip: '撤回验证意愿,将在下一个时代生效。' +} diff --git a/src/locales/zh-CN/index.js b/src/locales/zh-CN/index.js index 08ba7b6e..694d12db 100755 --- a/src/locales/zh-CN/index.js +++ b/src/locales/zh-CN/index.js @@ -1,57 +1,57 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import Assets from './Assets/index' -import Staking from './Staking/index' -import Democracy from './Democracy/index' -import Profile from './Profile/index' - -export default { - TAB: { - Assets: '资产', - Staking: '抵押', - Democracy: '民主', - Profile: '设置', - ChangeLanguages: '更换语言', - PasswordMistake: '密码错误', - PasswordCorrect: '密码正确', - Reset: '重置', - Save: '保存', - Continue: '继续', - Cancel: '取消', - StakingOption: '资产变化记录,单位(xxx) ', - Receive: '接收', - Received: '接收', - Send: '发送', - loadMore: '加载更多', - Bottom: '到底啦', - noResponse: '反应超时,请再次尝试。', - enterInformation: '请输入相关信息', - signMess: '正在用该账户进行签名', - unlockPassword: '输入密码解锁账户', - loading: '加载中', - CopySuccess: '复制成功', - Copy: '复制' - }, - Assets: { - ...Assets - }, - Staking: { - ...Staking - }, - Democracy: { - ...Democracy - }, - Profile: { - ...Profile - } -} +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import Assets from './Assets/index' +import Staking from './Staking/index' +import Democracy from './Democracy/index' +import Profile from './Profile/index' + +export default { + TAB: { + Assets: '资产', + Staking: '抵押', + Democracy: '民主', + Profile: '设置', + ChangeLanguages: '更换语言', + PasswordMistake: '密码错误', + PasswordCorrect: '密码正确', + Reset: '重置', + Save: '保存', + Continue: '继续', + Cancel: '取消', + StakingOption: '资产变化记录,单位(xxx) ', + Receive: '接收', + Received: '接收', + Send: '发送', + loadMore: '加载更多', + Bottom: '到底啦', + noResponse: '反应超时,请再次尝试。', + enterInformation: '请输入相关信息', + signMess: '正在用该账户进行签名', + unlockPassword: '输入密码解锁账户', + loading: '加载中', + CopySuccess: '复制成功', + Copy: '复制' + }, + Assets: { + ...Assets + }, + Staking: { + ...Staking + }, + Democracy: { + ...Democracy + }, + Profile: { + ...Profile + } +} diff --git a/src/mobx/mobx.js b/src/mobx/mobx.js index 64fd50ce..ef486b15 100755 --- a/src/mobx/mobx.js +++ b/src/mobx/mobx.js @@ -1,136 +1,137 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-21 22:42:42 - */ -import { observable } from 'mobx' - -class StateStore { - // 被观察的字段 - // Observed field - @observable name = 'Zoey' - - // 被观察的字段 - // Observed field - @observable API = {} - - // wss - // @observable ENDPOINT = 'wss://poc3-rpc.polkadot.io/' - @observable ENDPOINT = 'ws://45.32.115.98:9944/' - - // 是否是第一次登陆 - // first time to use - @observable isfirst = 0 - - // 所有账户 - // All accounts - @observable Accounts = [{ account: 'NeedCreate', address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' }] - - // 通讯录 - // Addresses - @observable Addresses = [] - - // 正在登陆的账户 - // Using account - @observable Account = 0 - - // 账户数量(除默认账户以外) - // Account number (except default account) - @observable Accountnum = 0 - - // 刷新前登陆的账户 - // Refresh previously used accounts - @observable refreshBefore = 0 - - // 交易信息 - // Transaction infomation - @observable transactions = {} - - // 当前交易信息是否是最后一页 - // Whether the current transaction information is the last page - @observable hasNextPage - - // 当前账户在balances中的位置 - // Index of current account's balance in the balances - @observable balanceIndex = 0 - - // 所有账户balance - // All accounts balance - @observable balances = [{ address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', balance: 0 }] - - // 所有账户中有没有这个用户地址 - // Address duplicate exists - @observable have = 0 - - // balance - @observable balance = '0' - - // 转账地址 - // Transfer address - @observable inaddress = '' - - // 转账金额 - // Transfer value - @observable value = 0 - - // 第几笔交易 - // Transfer nonce - @observable accountNonce = 0 - - //* ****************** */Democracy界面******************* - // referendumCount - @observable referendumCount = '0' - - // 转到通讯录 - // Go to the address book - @observable transfer_address = 0 - - // 选中地址 - // Selected address - @observable t_address = '' - - // 是否是从通讯录中选出的地址 - // Is selected from the address book? - @observable isaddresses = 0 - - // 判断是从哪里进入的nominate - // 0代表从Account Actions界面,1代表Staking Overview - // Determine which page to nominate; 0: from Account Actions; 1: from Staking Overview; - @observable tonominate = 0 - - // 判断是从哪里扫过来的 - // 0代表从Assets界面,1代表transfer,2代表通讯录 - // Determine where it Scan Qr from; 0: from Assets page; 1: from Addresses page; - @observable tocamera = 0 - - // 是否是扫码得到的地址 - // Got address from scan Qr? - @observable iscamera = 0 - - // 二维码扫描到的地址 - // The address from scan Qr - @observable QRaddress = '' - - //* **************************** 设置 *********************************** - // 手势密码 - // Gestures password - @observable Gesture = '' - - // 手势密码的模式:0 代表无密码,1 代表确认密码,2 代表验证密码 - // The pattern of the gesture password; 0: no password, 1:confirm password, 2: verify password - @observable GestureState = 0 -} - -class RootStore { - constructor() { - this.stateStore = new StateStore() - } -} -export default new RootStore() +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import { observable } from 'mobx' + +class StateStore { + // 被观察的字段 + // Observed field + @observable name = 'Zoey' + + // 被观察的字段 + // Observed field + @observable API = {} + + // wss + // @observable ENDPOINT = 'wss://poc3-rpc.polkadot.io/' + // @observable ENDPOINT = 'ws://45.32.115.98:9944/' + @observable ENDPOINT = 'ws://140.82.35.183:9944/' + + // 是否是第一次登陆 + // first time to use + @observable isfirst = 0 + + // 所有账户 + // All accounts + @observable Accounts = [{ account: 'NeedCreate', address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' }] + + // 通讯录 + // Addresses + @observable Addresses = [] + + // 正在登陆的账户 + // Using account + @observable Account = 0 + + // 账户数量(除默认账户以外) + // Account number (except default account) + @observable Accountnum = 0 + + // 刷新前登陆的账户 + // Refresh previously used accounts + @observable refreshBefore = 0 + + // 交易信息 + // Transaction infomation + @observable transactions = {} + + // 当前交易信息是否是最后一页 + // Whether the current transaction information is the last page + @observable hasNextPage + + // 当前账户在balances中的位置 + // Index of current account's balance in the balances + @observable balanceIndex = 0 + + // 所有账户balance + // All accounts balance + @observable balances = [{ address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', balance: 0 }] + + // 所有账户中有没有这个用户地址 + // Address duplicate exists + @observable have = 0 + + // balance + @observable balance = '0' + + // 转账地址 + // Transfer address + @observable inaddress = '' + + // 转账金额 + // Transfer value + @observable value = 0 + + // 第几笔交易 + // Transfer nonce + @observable accountNonce = 0 + + //* ****************** */Democracy界面******************* + // referendumCount + @observable referendumCount = '0' + + // 转到通讯录 + // Go to the address book + @observable transfer_address = 0 + + // 选中地址 + // Selected address + @observable t_address = '' + + // 是否是从通讯录中选出的地址 + // Is selected from the address book? + @observable isaddresses = 0 + + // 判断是从哪里进入的nominate + // 0代表从Account Actions界面,1代表Staking Overview + // Determine which page to nominate; 0: from Account Actions; 1: from Staking Overview; + @observable tonominate = 0 + + // 判断是从哪里扫过来的 + // 0代表从Assets界面,1代表transfer,2代表通讯录 + // Determine where it Scan Qr from; 0: from Assets page; 1: from Addresses page; + @observable tocamera = 0 + + // 是否是扫码得到的地址 + // Got address from scan Qr? + @observable iscamera = 0 + + // 二维码扫描到的地址 + // The address from scan Qr + @observable QRaddress = '' + + //* **************************** 设置 *********************************** + // 手势密码 + // Gestures password + @observable Gesture = '' + + // 手势密码的模式:0 代表无密码,1 代表确认密码,2 代表验证密码 + // The pattern of the gesture password; 0: no password, 1:confirm password, 2: verify password + @observable GestureState = 0 +} + +class RootStore { + constructor() { + this.stateStore = new StateStore() + } +} +export default new RootStore() diff --git a/src/page/Assets/Assets.js b/src/page/Assets/Assets.js index 63eeab62..1c5893c3 100755 --- a/src/page/Assets/Assets.js +++ b/src/page/Assets/Assets.js @@ -1,746 +1,796 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-21 21:14:28 - */ -import React, { Component } from 'react' -import { - Text, - View, - Image, - TouchableOpacity, - SafeAreaView, - StatusBar, - AsyncStorage, - AppState, - Alert, - Animated, - Platform, - ImageBackground, - StyleSheet, - Modal -} from 'react-native' -import { - isFirstTime, - checkUpdate, - downloadUpdate, - switchVersion, - switchVersionLater, - markSuccess -} from 'react-native-update' -import Api from '@polkadot/api/promise' -import WsProvider from '@polkadot/rpc-provider/ws' -import { NavigationActions, StackActions } from 'react-navigation' -import JPushModule from 'jpush-react-native' -import Identicon from 'polkadot-identicon-react-native' -import SInfo from 'react-native-sensitive-info' -import { formatBalance } from '@polkadot/util' -import { observer, inject } from 'mobx-react' -import Right_menu from './secondary/RightMenu' -import { ScreenWidth, ScreenHeight, axios } from '../../util/Common' -import _updateConfig from '../../../update.json' -import i18n from '../../locales/i18n' -import polkadotAPI from '../../util/polkadotAPI.js' -import Loading from '../../components/Loading' -import LoadingUtil from '../../components/LoadingUtil' -import DataRepository from '../../util/DataRepository' - -function judgeObj(obj) { - for (let attr in obj) { - return false - } - return true -} -@inject('rootStore') -@observer -class Assets extends Component { - constructor(props) { - super(props) - this.state = { - is: false, - name: '0', - address: '0', - isfirst: 0, - isrefresh: false, - color: 'rgb(0,255,0)' - } - this.QR_Code = this.QR_Code.bind(this) - this.Coin_details = this.Coin_details.bind(this) - this.refresh = this.refresh.bind(this) - this.Loading = this.Loading.bind(this) - this.checkApi = this.checkApi.bind(this) - this.interval = null - this.handleAppStateChange = this.handleAppStateChange.bind(this) - this.doUpdate = this.doUpdate.bind(this) - - this.animatedValue = new Animated.Value(0) - this.movingMargin = this.animatedValue.interpolate({ - inputRange: [0, 1], - outputRange: [ScreenWidth * 0.57, 0] - }) - } - - // 跳转二维码页面 - // Jump to Qr_code page - QR_Code() { - this.props.navigation.navigate('QR_Code') - } - - Coin_details() { - this.props.navigation.navigate('Coin_details') - } - - checkApi() { - ;(async () => { - new DataRepository() - .fetchLocalRepository('localLanguage') - .then(res => { - i18n.locale = res - }) - .catch(error => { - i18n.locale = 'en' - }) - if (judgeObj(this.props.rootStore.stateStore.API)) { - LoadingUtil.showLoading() - const api = await Api.create(new WsProvider(this.props.rootStore.stateStore.ENDPOINT)) - this.props.rootStore.stateStore.API = api - LoadingUtil.dismissLoading() - } - })() - } - - // 初始加载函数 - // Londing function - Loading() { - SInfo.getAllItems({ - sharedPreferencesName: 'Polkawallet', - keychainService: 'PolkawalletKey' - }).then(result => { - if (JSON.stringify(result).length < 10) { - const resetAction = StackActions.reset({ - index: 0, - actions: [NavigationActions.navigate({ routeName: 'Create_Account' }, { t: this })] - }) - this.props.navigation.dispatch(resetAction) - } else { - this.setState({ - isfirst: 1 - }) - this.props.rootStore.stateStore.refreshBefore = this.props.rootStore.stateStore.Account - this.props.rootStore.stateStore.balanceIndex = 0 - this.props.rootStore.stateStore.Account = 0 - this.props.rootStore.stateStore.Accountnum = 0 - this.props.rootStore.stateStore.isfirst = 1 - this.props.rootStore.stateStore.Accounts = [{ account: 'NeedCreate', address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' }] - this.props.rootStore.stateStore.balances = [{ address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', balance: 0 }] - if (Platform.OS == 'android') { - // android - let noticeTags = [] - for (let o in result) { - this.props.rootStore.stateStore.Accounts.push({ - account: JSON.parse(result[o]).meta.name, - address: JSON.parse(result[o]).address - }) - this.props.rootStore.stateStore.Account++ - this.props.rootStore.stateStore.Accountnum++ - // 创建查询每个账户余额的进程 - // Create a process to query each account balance - ;(async () => { - const _address = o - await polkadotAPI.freeBalance(_address, balance => { - this.props.rootStore.stateStore.have = 0 - this.props.rootStore.stateStore.balances.map((item, index) => { - if (item.address == _address) { - this.props.rootStore.stateStore.have = 1 - this.props.rootStore.stateStore.balances[index].balance = balance - } - }) - if (this.props.rootStore.stateStore.have == 0) { - this.props.rootStore.stateStore.balances.push({ - address: _address, - balance - }) - } - }) - })() - // 截取地址前25字符作为推送标签 - // Capture the first 25 characters of the address as the push tag - noticeTags.push(o.slice(0, 25)) - } - // 设置通知推送标签 - // Set notification push tages - JPushModule.setTags(noticeTags, map => { - if (map.errorCode === 0) { - // console.warn('Set tags succeed, tags: ' + map.tags) - } else { - console.warn('Set tags failed, error code: ' + map.errorCode) - } - }) - } else { - // ios - let noticeTags = [] - result.map((item, index) => { - item.map((item, index) => { - // 添加用户到mobx - // Add account to mobx - this.props.rootStore.stateStore.Accounts.push({ - account: JSON.parse(item.value).meta.name, - address: item.key - }) - this.props.rootStore.stateStore.Account++ - this.props.rootStore.stateStore.Accountnum++ - // 创建查询每个账户的进程 - // Create a process to query each account balance - ;(async () => { - await polkadotAPI.freeBalance(item.key, balance => { - const _address = item.key - this.props.rootStore.stateStore.have = 0 - this.props.rootStore.stateStore.balances.map((item, index) => { - if (item.address == _address) { - this.props.rootStore.stateStore.have = 1 - this.props.rootStore.stateStore.balances[index].balance = balance - } - }) - if (this.props.rootStore.stateStore.have == 0) { - this.props.rootStore.stateStore.balances.push({ - address: _address, - balance - }) - } - }) - })() - // 截取地址前25字符作为推送标签 - // Capture the first 25 characters of the address as the push tag - noticeTags.push(item.key.slice(0, 25)) - }) - }) - // 设置通知推送标签 - // Set notification push tages - JPushModule.setTags(noticeTags, map => { - if (map.errorCode === 0) { - // console.warn('Set tags succeed, tags: ' + map.tags) - } else { - console.warn('Set tags failed, error code: ' + map.errorCode) - } - }) - } - } - }) - setTimeout(() => { - if (this.props.rootStore.stateStore.isfirst == 1) { - this.props.rootStore.stateStore.Account = 1 - } - this.props.rootStore.stateStore.Account = - this.props.rootStore.stateStore.refreshBefore == 0 && this.props.rootStore.stateStore.isfirst == 1 - ? 1 - : this.props.rootStore.stateStore.refreshBefore - if (this.props.rootStore.stateStore.Account != 0) { - // Query Balance - ;(async () => { - const props = await polkadotAPI.properties() - this.props.rootStore.stateStore.balances.map((item, index) => { - if ( - item.address == this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address - ) { - this.props.rootStore.stateStore.balanceIndex = index - } - }) - formatBalance.setDefaults({ - decimals: props.get('tokenDecimals'), - unit: props.get('tokenSymbol') - }) - clearInterval(this.interval) - this.interval = setInterval(async () => { - let myDate = new Date() - let blockdate = await polkadotAPI.timestampNow() - let lastBlockTime = Number(myDate) - Number(blockdate) - let a - let b - let c - if (lastBlockTime > 120000) { - a = 192 - b = 192 - c = 192 - } else { - let colorPara = (lastBlockTime / 1000) * (255 / 18) - a = 0 - b = 255 - c = 0 - for (let i = 0; i < colorPara; i++) { - if (b >= 255 && a < 255) { - a++ - } - if (a >= 255) b-- - if (a >= 255 && b <= 0) { - a = 255 - b = 0 - } - } - } - this.setState({ - color: `rgb(${a},${b},${c})` - }) - }, 500) - })() - } - - // 清除缓存 - // Clear the cache - const REQUEST_URL = 'https://api.polkawallet.io:8080/tx_list_for_redis' - const params = `{"user_address":"${this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address}","pageNum":"1","pageSize":"10"}` - axios(REQUEST_URL, params, 'post', true).then(() => { - // 获取交易记录 - // Access to transaction records - const REQUEST_URL = 'https://api.polkawallet.io:8080/tx_list' - const params = `{"user_address":"${this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address}","pageNum":"1","pageSize":"10"}` - axios(REQUEST_URL, params).then(result => { - this.props.rootStore.stateStore.hasNextPage = result.tx_list.hasNextPage - this.props.rootStore.stateStore.transactions = result - }) - }) - }, 100) - } - - // 刷新 - // refresh - refresh() { - this.setState({ - isrefresh: true - }) - this.checkApi() - this.Loading() - setTimeout(() => { - this.setState({ - isrefresh: false - }) - }, 2000) - } - - handleAppStateChange(appState) { - if (appState == 'background' && this.props.rootStore.stateStore.GestureState == 2) { - const resetAction = StackActions.reset({ - index: 0, - actions: [NavigationActions.navigate({ routeName: 'Gesture' })] - }) - this.props.navigation.dispatch(resetAction) - } - } - - doUpdate(info) { - downloadUpdate(info) - .then(hash => { - Alert.alert('', i18n.t('Profile.restartApp'), [ - { - text: 'Yes', - onPress: () => { - switchVersion(hash) - } - }, - { text: 'No' }, - { - text: i18n.t('Profile.nextTime'), - onPress: () => { - switchVersionLater(hash) - } - } - ]) - }) - .catch(() => { - Alert.alert('', i18n.t('Profile.UpdateFailed')) - }) - } - - checkUpdate = () => { - const { appKey } = _updateConfig[Platform.OS] - checkUpdate(appKey) - .then(info => { - if (info.expired) { - Alert.alert('', i18n.t('Profile.toAppStore'), [ - { - text: 'OK', - onPress: () => { - // info.downloadUrl && Linking.openURL(info.downloadUrl) - } - } - ]) - } else if (info.upToDate) { - // Alert.alert('提示', '您的应用版本已是最新.'); - } else { - Alert.alert( - '', - `${i18n.t('Profile.checkNewV') + info.name},${i18n.t('Profile.download')}\n${info.description}`, - [ - { - text: 'OK', - onPress: () => { - this.doUpdate(info) - } - } - ] - ) - } - }) - .catch(() => { - Alert.alert('', i18n.t('Profile.UpdateFailed')) - }) - } - - // 侧边栏Modal显示 - // Modal display in the sidebar - show() { - this.setState({ - is: true - }) - this.animatedValue.setValue(0) - Animated.timing(this.animatedValue, { - toValue: 1, - duration: 600 - }).start() - } - - // 侧边栏Modal隐藏 - // Modal hidden sidebar - hide() { - Animated.timing(this.animatedValue, { - toValue: 0, - duration: 600 - }).start() - setTimeout( - function() { - this.changeAccount() - this.setState({ is: false }) - }.bind(this), - 600 - ) - } - - changeAccount() { - this.props.rootStore.stateStore.balances.map((item, index) => { - if (item.address == this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address) { - this.props.rootStore.stateStore.balanceIndex = index - } - }) - } - - componentDidMount() { - // 通过addListener开启监听,可以使用上面的四个属性 - // With addListener to enable listening, use the four properties above - this._didBlurSubscription = this.props.navigation.addListener('didFocus', payload => { - if (Platform.OS == 'android') { - StatusBar.setBackgroundColor('#F14B79') - } - StatusBar.setBarStyle(Platform.OS == 'android' ? 'light-content' : 'dark-content') - this.setState({}) - this.checkApi() - this.Loading() - this.changeAccount() - }) - // 通知推送初始化 - // Notification push initialization - JPushModule.initPush() - JPushModule.addReceiveNotificationListener(this.receiveNotificationListener) - } - - componentWillUnmount() { - // 在页面消失的时候,取消监听 - // Unlisten when the page disappears - this._didBlurSubscription && this._didBlurSubscription.remove() - } - - componentWillMount() { - this.checkApi() - if (isFirstTime) { - markSuccess() - } - - if (Platform.OS == 'android') { - StatusBar.setBackgroundColor('#F14B79') - } - StatusBar.setBarStyle(Platform.OS == 'android' ? 'light-content' : 'dark-content') - AppState.addEventListener('change', this.handleAppStateChange) - // 判断用户是否设置手势密码 - // Determines whether the user has set a gesture password - AsyncStorage.getItem('Gesture').then(result => { - if (result == null) { - // 没有设置 - // Not set gesture password - // this.checkUpdate (); - this.props.rootStore.stateStore.GestureState = 0 - } else { - // 设置了手势密码 - // The gesture password has been set - if (this.props.rootStore.stateStore.GestureState != 2) { - this.props.rootStore.stateStore.Gesture = result - this.props.rootStore.stateStore.GestureState = 2 - const resetAction = StackActions.reset({ - index: 0, - actions: [NavigationActions.navigate({ routeName: 'Gesture' })] - }) - this.props.navigation.dispatch(resetAction) - } else { - // this.checkUpdate (); - } - } - }) - this.Loading() - } - - render() { - return ( - - - - - ) - } -} -const styles = StyleSheet.create({ - container: { - flex: 1, - paddingBottom: 98, - backgroundColor: '#F6F6F6' - }, - navBar: { - height: 44, - width: ScreenWidth, - justifyContent: 'center', - alignItems: 'center', - top: 0 - }, - - navContent: { - width: ScreenWidth, - height: 157, - alignItems: 'center', - flex: 1, - paddingTop: 15 - }, - TopBar: { - borderRadius: 16, - width: ScreenWidth - 40, - height: 140, - backgroundColor: 'white', - marginTop: 32 - } -}) -export default Assets +/* + * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED + * This file is part of Polkawallet. + + It under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License. + You should have received a copy of the GNU General Public License + along with Polkawallet. If not, see . + + * @Autor: POLKAWALLET LIMITED + * @Date: 2019-06-18 21:08:00 + */ +import React, { Component } from 'react' +import { + Text, + View, + Image, + TouchableOpacity, + SafeAreaView, + StatusBar, + AsyncStorage, + AppState, + Alert, + Animated, + Platform, + ImageBackground, + StyleSheet, + Modal, + Linking, + InteractionManager +} from 'react-native' +import { + isFirstTime, + checkUpdate, + downloadUpdate, + switchVersion, + switchVersionLater, + markSuccess +} from 'react-native-update' +import Api from '@polkadot/api/promise' +import WsProvider from '@polkadot/rpc-provider/ws' +import { NavigationActions, StackActions } from 'react-navigation' +import JPushModule from 'jpush-react-native' +import Identicon from 'polkadot-identicon-react-native' +import SInfo from 'react-native-sensitive-info' +import { formatBalance } from '@polkadot/util' +import { observer, inject } from 'mobx-react' +import Right_menu from './secondary/RightMenu' +import { ScreenWidth, ScreenHeight, axios } from '../../util/Common' +import _updateConfig from '../../../update.json' +import i18n from '../../locales/i18n' +import polkadotAPI from '../../util/polkadotAPI.js' +import Loading from '../../components/Loading' +import LoadingUtil from '../../components/LoadingUtil' +import DataRepository from '../../util/DataRepository' + +function judgeObj(obj) { + for (let attr in obj) { + return false + } + return true +} +@inject('rootStore') +@observer +class Assets extends Component { + constructor(props) { + super(props) + this.state = { + is: false, + name: '0', + address: '0', + isfirst: 0, + isrefresh: false, + color: 'rgb(0,255,0)' + } + this.QR_Code = this.QR_Code.bind(this) + this.Coin_details = this.Coin_details.bind(this) + this.refresh = this.refresh.bind(this) + this.Loading = this.Loading.bind(this) + this.checkApi = this.checkApi.bind(this) + this.interval = null + this.handleAppStateChange = this.handleAppStateChange.bind(this) + this.doUpdate = this.doUpdate.bind(this) + + this.animatedValue = new Animated.Value(0) + this.movingMargin = this.animatedValue.interpolate({ + inputRange: [0, 1], + outputRange: [ScreenWidth * 0.57, 0] + }) + } + + /** + * @description 跳转二维码页面|Jump to Qr_code page + */ + QR_Code() { + this.props.navigation.navigate('QR_Code') + } + + /** + * @description 跳转交易页面|Jump to Coin_details page + */ + Coin_details() { + this.props.navigation.navigate('Coin_details') + } + + /** + * @description 检查创建的API是否还存在|Check that the created API still exists + */ + checkApi() { + ;(async () => { + new DataRepository() + .fetchLocalRepository('localLanguage') + .then(res => { + i18n.locale = res + }) + .catch(error => { + i18n.locale = 'en' + }) + if (judgeObj(this.props.rootStore.stateStore.API)) { + LoadingUtil.showLoading() + const api = await Api.create(new WsProvider(this.props.rootStore.stateStore.ENDPOINT)) + this.props.rootStore.stateStore.API = api + LoadingUtil.dismissLoading() + } + })() + } + + /** + * @description 初始加载函数|Londing function + */ + Loading() { + SInfo.getAllItems({ + sharedPreferencesName: 'Polkawallet', + keychainService: 'PolkawalletKey' + }).then(result => { + if (JSON.stringify(result).length < 10) { + const resetAction = StackActions.reset({ + index: 0, + actions: [NavigationActions.navigate({ routeName: 'Create_Account' }, { t: this })] + }) + this.props.navigation.dispatch(resetAction) + } else { + this.setState({ + isfirst: 1 + }) + this.props.rootStore.stateStore.refreshBefore = this.props.rootStore.stateStore.Account + this.props.rootStore.stateStore.balanceIndex = 0 + this.props.rootStore.stateStore.Account = 0 + this.props.rootStore.stateStore.Accountnum = 0 + this.props.rootStore.stateStore.isfirst = 1 + this.props.rootStore.stateStore.Accounts = [{ account: 'NeedCreate', address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx' }] + this.props.rootStore.stateStore.balances = [{ address: 'xxxxxxxxxxxxxxxxxxxxxxxxxxx', balance: 0 }] + if (Platform.OS == 'android') { + // android + let noticeTags = [] + for (let o in result) { + this.props.rootStore.stateStore.Accounts.push({ + account: JSON.parse(result[o]).meta.name, + address: JSON.parse(result[o]).address + }) + this.props.rootStore.stateStore.Account++ + this.props.rootStore.stateStore.Accountnum++ + // 创建查询每个账户余额的进程 + // Create a process to query each account balance + ;(async () => { + const _address = o + await polkadotAPI.freeBalance(_address, balance => { + this.props.rootStore.stateStore.have = 0 + this.props.rootStore.stateStore.balances.map((item, index) => { + if (item.address == _address) { + this.props.rootStore.stateStore.have = 1 + this.props.rootStore.stateStore.balances[index].balance = balance + } + }) + if (this.props.rootStore.stateStore.have == 0) { + this.props.rootStore.stateStore.balances.push({ + address: _address, + balance + }) + } + }) + })() + // 截取地址前25字符作为推送标签 + // Capture the first 25 characters of the address as the push tag + noticeTags.push(o.slice(0, 25)) + } + // 设置通知推送标签 + // Set notification push tages + JPushModule.setTags(noticeTags, map => { + if (map.errorCode === 0) { + // console.warn('Set tags succeed, tags: ' + map.tags) + } else { + // console.warn('Set tags failed, error code: ' + map.errorCode) + } + }) + } else { + // ios + let noticeTags = [] + result.map((item, index) => { + item.map((item, index) => { + // 添加用户到mobx + // Add account to mobx + this.props.rootStore.stateStore.Accounts.push({ + account: JSON.parse(item.value).meta.name, + address: item.key + }) + this.props.rootStore.stateStore.Account++ + this.props.rootStore.stateStore.Accountnum++ + // 创建查询每个账户的进程 + // Create a process to query each account balance + ;(async () => { + await polkadotAPI.freeBalance(item.key, balance => { + const _address = item.key + this.props.rootStore.stateStore.have = 0 + this.props.rootStore.stateStore.balances.map((item, index) => { + if (item.address == _address) { + this.props.rootStore.stateStore.have = 1 + this.props.rootStore.stateStore.balances[index].balance = balance + } + }) + if (this.props.rootStore.stateStore.have == 0) { + this.props.rootStore.stateStore.balances.push({ + address: _address, + balance + }) + } + }) + })() + // 截取地址前25字符作为推送标签 + // Capture the first 25 characters of the address as the push tag + noticeTags.push(item.key.slice(0, 25)) + }) + }) + // 设置通知推送标签 + // Set notification push tages + JPushModule.setTags(noticeTags, map => { + if (map.errorCode === 0) { + // console.warn('Set tags succeed, tags: ' + map.tags) + } else { + // console.warn('Set tags failed, error code: ' + map.errorCode) + } + }) + } + } + }) + setTimeout(() => { + if (this.props.rootStore.stateStore.isfirst == 1) { + this.props.rootStore.stateStore.Account = 1 + } + this.props.rootStore.stateStore.Account = + this.props.rootStore.stateStore.refreshBefore == 0 && this.props.rootStore.stateStore.isfirst == 1 + ? 1 + : this.props.rootStore.stateStore.refreshBefore + if (this.props.rootStore.stateStore.Account != 0) { + // Query Balance + ;(async () => { + const props = await polkadotAPI.properties() + this.props.rootStore.stateStore.balances.map((item, index) => { + if ( + item.address == this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address + ) { + this.props.rootStore.stateStore.balanceIndex = index + } + }) + formatBalance.setDefaults({ + decimals: props.get('tokenDecimals'), + unit: props.get('tokenSymbol') + }) + clearInterval(this.interval) + this.interval = setInterval(async () => { + let myDate = new Date() + let blockdate = await polkadotAPI.timestampNow() + let lastBlockTime = Number(myDate) - Number(blockdate) + let a + let b + let c + if (lastBlockTime > 120000) { + a = 192 + b = 192 + c = 192 + } else { + let colorPara = (lastBlockTime / 1000) * (255 / 18) + a = 0 + b = 255 + c = 0 + for (let i = 0; i < colorPara; i++) { + if (b >= 255 && a < 255) { + a++ + } + if (a >= 255) b-- + if (a >= 255 && b <= 0) { + a = 255 + b = 0 + } + } + } + this.setState({ + color: `rgb(${a},${b},${c})` + }) + }, 500) + })() + } + + // 清除缓存 + // Clear the cache + const REQUEST_URL = 'https://api.polkawallet.io:8080/tx_list_for_redis' + const params = `{"user_address":"${this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address}","pageNum":"1","pageSize":"10"}` + axios(REQUEST_URL, params, 'post', true).then(() => { + // 获取交易记录 + // Access to transaction records + const REQUEST_URL = 'https://api.polkawallet.io:8080/tx_list' + const params = `{"user_address":"${this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address}","pageNum":"1","pageSize":"10"}` + axios(REQUEST_URL, params).then(result => { + this.props.rootStore.stateStore.hasNextPage = result.tx_list.hasNextPage + this.props.rootStore.stateStore.transactions = result + }) + }) + }, 100) + } + + /** + * @description 刷新|refresh + */ + refresh() { + this.setState({ + isrefresh: true + }) + this.checkApi() + this.Loading() + setTimeout(() => { + this.setState({ + isrefresh: false + }) + }, 2000) + } + + /** + * @description APP 前后台切换|APP front and background switching + * @param {String} appState 切换状态|Switch state + */ + handleAppStateChange(appState) { + if (appState == 'background') { + this.props.rootStore.stateStore.api = {} + } else if (appState == 'active') { + this.checkApi() + } + if (appState == 'background' && this.props.rootStore.stateStore.GestureState == 2) { + const resetAction = StackActions.reset({ + index: 0, + actions: [NavigationActions.navigate({ routeName: 'Gesture' })] + }) + this.props.navigation.dispatch(resetAction) + } + } + + /** + * @description 更新app|Update the app + * @param {*} info 更新信息|update information + */ + doUpdate(info) { + downloadUpdate(info) + .then(hash => { + Alert.alert('', i18n.t('Profile.restartApp'), [ + { + text: 'Yes', + onPress: () => { + switchVersion(hash) + } + }, + { text: 'No' }, + { + text: i18n.t('Profile.nextTime'), + onPress: () => { + switchVersionLater(hash) + } + } + ]) + }) + .catch(() => { + // Alert.alert('', i18n.t('Profile.UpdateFailed')) + }) + } + + /** + * @description 检查更新|Check the update + */ + checkUpdate = () => { + const { appKey } = _updateConfig[Platform.OS] + checkUpdate(appKey) + .then(info => { + if (info.expired) { + Alert.alert('', i18n.t('Profile.toAppStore'), [ + { + test: 'No', + style: 'cancel' + }, + { + text: 'Yes', + onPress: () => { + Linking.openURL('https://polkawallet.io/#download') + } + } + ]) + } else if (info.upToDate) { + // Alert.alert('提示', '您的应用版本已是最新.'); + } else { + Alert.alert( + '', + `${i18n.t('Profile.checkNewV') + info.name},${i18n.t('Profile.download')}\n${info.description}`, + [ + { + text: 'OK', + onPress: () => { + this.doUpdate(info) + } + } + ] + ) + } + }) + .catch(() => { + // Alert.alert('', i18n.t('Profile.UpdateFailed')) + }) + } + + /** + * @description 侧边栏Modal显示|Modal display in the sidebar + */ + show() { + this.setState({ + is: true + }) + this.animatedValue.setValue(0) + Animated.timing(this.animatedValue, { + toValue: 1, + duration: 500, + useNativeDriver: true + }).start() + } + + /** + * @description 侧边栏Modal隐藏|Modal hidden sidebar + */ + hide() { + Animated.timing(this.animatedValue, { + toValue: 0, + duration: 500, + useNativeDriver: true + }).start() + setTimeout( + function() { + this.changeAccount() + this.setState({ is: false }) + }.bind(this), + 500 + ) + } + + /** + * @description 切换账户|Switch account + */ + changeAccount() { + this.props.rootStore.stateStore.balances.map((item, index) => { + if (item.address == this.props.rootStore.stateStore.Accounts[this.props.rootStore.stateStore.Account].address) { + this.props.rootStore.stateStore.balanceIndex = index + } + }) + } + + componentDidMount() { + InteractionManager.runAfterInteractions(() => { + // 通过addListener开启监听,可以使用上面的四个属性 + // With addListener to enable listening, use the four properties above + this._didBlurSubscription = this.props.navigation.addListener('didFocus', payload => { + if (Platform.OS == 'android') { + StatusBar.setBackgroundColor('#F14B79') + } + StatusBar.setBarStyle(Platform.OS == 'android' ? 'light-content' : 'dark-content') + this.setState({}) + this.checkApi() + this.Loading() + this.changeAccount() + }) + // 通知推送初始化 + // Notification push initialization + JPushModule.initPush() + JPushModule.addReceiveNotificationListener(this.receiveNotificationListener) + }) + } + + componentWillUnmount() { + // 在页面消失的时候,取消监听 + // Unlisten when the page disappears + this._didBlurSubscription && this._didBlurSubscription.remove() + } + + componentWillMount() { + InteractionManager.runAfterInteractions(() => { + this.checkApi() + if (isFirstTime) { + markSuccess() + } + + if (Platform.OS == 'android') { + StatusBar.setBackgroundColor('#F14B79') + } + StatusBar.setBarStyle(Platform.OS == 'android' ? 'light-content' : 'dark-content') + AppState.addEventListener('change', this.handleAppStateChange) + // 判断用户是否设置手势密码 + // Determines whether the user has set a gesture password + AsyncStorage.getItem('Gesture').then(result => { + if (result == null) { + // 没有设置 + // Not set gesture password + this.checkUpdate() + this.props.rootStore.stateStore.GestureState = 0 + } else { + // 设置了手势密码 + // The gesture password has been set + if (this.props.rootStore.stateStore.GestureState != 2) { + this.props.rootStore.stateStore.Gesture = result + this.props.rootStore.stateStore.GestureState = 2 + const resetAction = StackActions.reset({ + index: 0, + actions: [NavigationActions.navigate({ routeName: 'Gesture' })] + }) + this.props.navigation.dispatch(resetAction) + } else { + this.checkUpdate() + } + } + }) + this.Loading() + }) + } + + render() { + return ( + + + + + ) + } +} +const styles = StyleSheet.create({ + container: { + flex: 1, + paddingBottom: 98, + backgroundColor: '#F6F6F6' + }, + navBar: { + height: 44, + width: ScreenWidth, + justifyContent: 'center', + alignItems: 'center', + top: 0 + }, + + navContent: { + width: ScreenWidth, + height: 157, + alignItems: 'center', + flex: 1, + paddingTop: 15 + }, + TopBar: { + borderRadius: 16, + width: ScreenWidth - 40, + height: 140, + backgroundColor: 'white', + marginTop: 32 + } +}) +export default Assets diff --git a/src/page/Assets/secondary/BackupAccount.js b/src/page/Assets/secondary/BackupAccount.js index e1c5f53e..63a85f93 100755 --- a/src/page/Assets/secondary/BackupAccount.js +++ b/src/page/Assets/secondary/BackupAccount.js @@ -1,218 +1,232 @@ -/* - * @Description: COPYRIGHT © 2018 POLKAWALLET (HK) LIMITED - * This file is part of Polkawallet. - - It under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License. - You should have received a copy of the GNU General Public License - along with Polkawallet. If not, see . - - * @Autor: POLKAWALLET LIMITED - * @Date: 2019-06-18 21:08:00 - */ -import React, { Component } from 'react' -import { - StyleSheet, - Text, - View, - Image, - TouchableOpacity, - Clipboard, - StatusBar, - SafeAreaView, - ScrollView, - Alert -} from 'react-native' -import { NavigationActions, StackActions } from 'react-navigation' -import { observer, inject } from 'mobx-react' -import { ScreenWidth, ScreenHeight } from '../../../util/Common' -import Header from '../../../components/Header' -import polkadotAPI from '../../../util/polkadotAPI' -import i18n from '../../../locales/i18n' - -@inject('rootStore') -@observer -class BackupAccount extends Component { - constructor(props) { - super(props) - this.state = { - text: this.props.navigation.state.params.key, - address: this.props.navigation.state.params.address - } - this.copy = this.copy.bind(this) - this.Cancel = this.Cancel.bind(this) - this.Continue = this.Continue.bind(this) - } - - // 点击取消 - // Click cancel - Cancel() { - // 创建查询每个账户的进程 - // Create a process to query each account - ;(async () => { - await polkadotAPI.freeBalance(this.state.address, balance => { - let _address = this.state.address - this.props.rootStore.stateStore.have = 0 - this.props.rootStore.stateStore.balances.map((item, index) => { - if (item.address == _address) { - this.props.rootStore.stateStore.have = 1 - this.props.rootStore.stateStore.balances[index].balance = balance - } - }) - if (this.props.rootStore.stateStore.have == 0) { - this.props.rootStore.stateStore.balances.push({ - address: _address, - balance: balance - }) - } - }) - })() - this.props.navigation.navigate('Create_Account') - } - - // 点击确认 - // Click Continue - Continue() { - // 创建查询每个账户的进程 - // Create a process to query each account - ;(async () => { - await polkadotAPI.freeBalance(this.state.address, balance => { - let _address = this.state.address - this.props.rootStore.stateStore.have = 0 - this.props.rootStore.stateStore.balances.map((item, index) => { - if (item.address == _address) { - this.props.rootStore.stateStore.have = 1 - this.props.rootStore.stateStore.balances[index].balance = balance - } - }) - if (this.props.rootStore.stateStore.have == 0) { - this.props.rootStore.stateStore.balances.push({ - address: _address, - balance: balance - }) - } - }) - })() - let resetAction = StackActions.reset({ - index: 0, - actions: [NavigationActions.navigate({ routeName: 'Tabbed_Navigation' })] - }) - this.props.navigation.dispatch(resetAction) - } - - // 拷贝 - // Click Copy - async copy() { - Alert.alert('', i18n.t('TAB.CopySuccess')) - Clipboard.setString(this.state.text) - } - - render() { - return ( - -