Skip to content

Commit

Permalink
Merge pull request #215 from MickWang/master
Browse files Browse the repository at this point in the history
update validate messages; update onto service api for testnet
  • Loading branch information
MickWang committed Dec 2, 2019
2 parents 3deae0d + 14e6f36 commit ba9f7a3
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 57 deletions.
119 changes: 68 additions & 51 deletions src/core/consts.js
Expand Up @@ -7,39 +7,39 @@ export const TEST_NET = 'http://polaris1.ont.io';
export const MAIN_NET = 'http://dappnode1.ont.io';

export const TEST_NET_LIST = [
'http://polaris1.ont.io',
'http://polaris2.ont.io',
'http://polaris3.ont.io',
'http://polaris4.ont.io',
'http://polaris5.ont.io'
'http://polaris1.ont.io',
'http://polaris2.ont.io',
'http://polaris3.ont.io',
'http://polaris4.ont.io',
'http://polaris5.ont.io'
]

export const MAIN_NET_LIST = [
'http://dappnode1.ont.io',
'http://dappnode2.ont.io',
'http://dappnode3.ont.io',
'http://dappnode4.ont.io',
'http://dappnode1.ont.io',
'http://dappnode2.ont.io',
'http://dappnode3.ont.io',
'http://dappnode4.ont.io',
]
//test environment
export const ONT_PASS_NODE = 'https://app.ont.io'
export const ONT_PASS_NODE = 'https://service-test.onto.app'
//prod
export const ONT_PASS_NODE_PRD = 'https://service.onto.app'

export const ONT_PASS_URL = {
CreateSharedWallet: '/S1/api/v1/ontpass/SharedWallet/create',
QuerySharedWallet: '/S1/api/v1/ontpass/SharedWallet/getBySharedWalletAddress', //get
CreateSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/create',
SignSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/sign',
SendSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/isSendToChain', //get
QueryPendingTransfer: '/S1/api/v1/ontpass/SharedTransfer/listSigningBeforeTime',
// sharedAddress={sharedAddress}&assetName={assetName}&beforeTimeStamp={beforeTimeStamp},
ExchangeCurrency: '/S1/api/v1/ontpass/api/v1/onto/exchangerate/reckon/'
CreateSharedWallet: '/S1/api/v1/ontpass/SharedWallet/create',
QuerySharedWallet: '/S1/api/v1/ontpass/SharedWallet/getBySharedWalletAddress', //get
CreateSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/create',
SignSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/sign',
SendSharedTransfer: '/S1/api/v1/ontpass/SharedTransfer/isSendToChain', //get
QueryPendingTransfer: '/S1/api/v1/ontpass/SharedTransfer/listSigningBeforeTime',
// sharedAddress={sharedAddress}&assetName={assetName}&beforeTimeStamp={beforeTimeStamp},
ExchangeCurrency: '/S1/api/v1/ontpass/api/v1/onto/exchangerate/reckon/'
///api/v1/onto/exchangerate/reckon/{currency}/{goaltype}/{amount}

//for node stake
,
GetQualifiedState: '/S4/NodePledgeApi/v1/Nodepledge/getQuailifiedState',
// /NodePledgeApi/v1/Nodepledge/getQuailifiedState?ontid={ontid}&address={address}'
GetQualifiedState: '/S4/NodePledgeApi/v1/Nodepledge/getQuailifiedState',
// /NodePledgeApi/v1/Nodepledge/getQuailifiedState?ontid={ontid}&address={address}'
DelegateSendTx: '/S4/NodePledgeApi/v1/Nodepledge/delegateSendTransaction',
SetStakeInfo: '/S4/NodePledgeApi/v1/Nodepledge/setInfo',
GetStakeInfo: '/S4/NodePledgeApi/v1/Nodepledge/info'
Expand All @@ -48,16 +48,16 @@ export const ONT_PASS_URL = {
}

export const WALLET_TYPE = {
CommonWallet: 'CommonWallet',
SharedWallet: 'SharedWallet',
HardwareWallet: 'HardwareWallet'
CommonWallet: 'CommonWallet',
SharedWallet: 'SharedWallet',
HardwareWallet: 'HardwareWallet'
}

export const DEFAULT_SCRYPT = {
cost: 16384, // 除以2时间减半
blockSize: 8,
parallel: 8,
size: 64
cost: 16384, // 除以2时间减半
blockSize: 8,
parallel: 8,
size: 64
};

export const SWAP_ADDRESS = 'AFmseVrdL9f9oyCzZefL9tG6UbvhPbdYzM'
Expand All @@ -70,35 +70,52 @@ export const OFF_CHAIN_NODES = {
}

export const PAX_API = {
Host: 'http://18.138.83.180:20800',
// TestHost: 'http://172.168.3.61:20800',
TestHost: 'http://18.139.19.52:20800',
fetchApprovalList: '/api/v1/approvals',
updateApprovals: '/api/v1/processapplist',
validateTx: '/api/v1/validatetx',
EthScanTest: 'https://ropsten.etherscan.io/tx/',
EthScanMain: 'https://etherscan.io/tx/'
Host: 'http://18.138.83.180:20800',
// TestHost: 'http://172.168.3.61:20800',
TestHost: 'http://18.139.19.52:20800',
fetchApprovalList: '/api/v1/approvals',
updateApprovals: '/api/v1/processapplist',
validateTx: '/api/v1/validatetx',
EthScanTest: 'https://ropsten.etherscan.io/tx/',
EthScanMain: 'https://etherscan.io/tx/'
}

export const PAX_SC_HASH = {
MAIN: '6bbc07bae862db0d7867e4e5b1a13c663e2b4bc8',
TEST: 'b06f8eaf757030c7a944ce2a072017bde1e72308'
}
MAIN: '6bbc07bae862db0d7867e4e5b1a13c663e2b4bc8',
TEST: 'b06f8eaf757030c7a944ce2a072017bde1e72308'
}

export const VALIDATE_DICTIONARY = {
zh: {
messages: {
required: (field, val) => `字段 ${field} 是必填项`,
min: (field, val) => `字段 ${field} 的长度不能少于${val[0]}`,
length: (field, val) => `字段 ${field} 的长度必须是${val[0]}`
zh: {
messages: {
required: (field, val) => `字段 ${field} 是必填项`,
min: (field, val) => `字段 ${field} 的长度不能少于${val[0]}`,
length: (field, val) => `字段 ${field} 的长度必须是${val[0]}`,
confirmed: (field, val) => `密码两次输入不匹配`
},
attributes: {
password: '密码',
name: '名称',
label: '名称',
rePassword: '确认密码',
keystore: 'keystore',
keystorePassword: ''
}
},
attributes: {
password: '密码',
name: '名称',
label: '名称',
rePassword: '确认密码',
keystore: 'keystore',
keystorePassword: ''
en: {
messages: {
required: (field, val) => `${field} is required`,
min: (field, val) => `The length of ${field} must be larger than ${val[0]}`,
length: (field, val) => `The length of ${field} must be ${val[0]}`,
confirmed: (field, val) => `The passwords didn't match.`
},
attributes: {
password: 'Password',
name: 'Name',
label: 'Label',
rePassword: 'Confirm password',
keystore: 'keystore',
keystorePassword: ''
}
}
}
}
2 changes: 1 addition & 1 deletion src/renderer/components/JsonWallet/Create/BasicInfo.vue
Expand Up @@ -12,7 +12,7 @@
<span class="v-validate-span-errors" v-show="errors.has('password')">{{ errors.first('password') }}</span>

<a-input type="password" class="input input-repassword"
v-validate="{required: true , min:6, is:password}" :data-vv-as="$t('FormField.passwordConfirmation')" name="rePassword"
v-validate="{required: true , min:6, 'confirmed':password}" :data-vv-as="$t('FormField.passwordConfirmation')" name="rePassword"
v-model="rePassword" :placeholder="$t('createJsonWallet.rePassword')"></a-input>
<span class="v-validate-span-errors" v-show="errors.has('rePassword')">{{ errors.first('rePassword') }}</span>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/renderer/main.js
Expand Up @@ -18,12 +18,14 @@ Vue.use(VueClipboard)
import i18n from '../common/lang'
import VeeValidate from 'vee-validate'
import { VALIDATE_DICTIONARY } from '../core/consts'
import validationMessages from 'vee-validate/dist/locale/en';
import validationMessages_en from 'vee-validate/dist/locale/en';
import validationMessages_zh from 'vee-validate/dist/locale/zh_CN';

Vue.use(VeeValidate, {
i18n,
dictionary: {
en: validationMessages,
zh: VALIDATE_DICTIONARY.zh
en: Object.assign({},validationMessages_en, VALIDATE_DICTIONARY.en),
zh: Object.assign({},validationMessages_zh, VALIDATE_DICTIONARY.zh)
}
})
import service from '../core/utils'
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Expand Up @@ -8086,8 +8086,9 @@ vary@~1.1.2:
resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc"

vee-validate@^2.1.0-beta.7:
version "2.1.0-beta.7"
resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-2.1.0-beta.7.tgz#25f275ad94a69e4b50d939430a459b84f40dbc2a"
version "2.2.15"
resolved "https://registry.yarnpkg.com/vee-validate/-/vee-validate-2.2.15.tgz#dc6c925d21e57288d3308fe5a39a0941036c575a"
integrity sha512-4TOsI8XwVkKVLkg8Nhmy+jyoJrR6XcTRDyxBarzcCvYzU61zamipS1WsB6FlDze8eJQpgglS4NXAS6o4NDPs1g==

verror@1.10.0:
version "1.10.0"
Expand Down

0 comments on commit ba9f7a3

Please sign in to comment.