Skip to main content

Payment Security

These are the business components concerning payment security and comprises the following three parts:

  • PaymentSecurity: display the list of tokens whose security settings can be managed.
  • TransferSettings: display the specific transfer limit settings for a single token.
  • TransferSettingsEdit: edit and update the transfer limits for a single token.

PaymentSecurity

Display the list of tokens whose security settings can be managed, with 20 records per page.

Before using this component, please make sure you are logged-in.

Before using this component, we assume that you are already familiar with the basic configuration of Portkey.

Usage

import { PaymentSecurity } from '@portkey/did-ui-react';

const App: React.FC = () => (
<PaymentSecurity
networkType="MAIN"
caHash="your ca hash"
/>
);
export default App;

API

PropertyDescriptionTypeRequiredDefaultVersion
wrapperStyleCustomise inline styleReact.CSSPropertiesfalse-V1.5.1
classNameCustomise class namestringfalse-V1.5.1
networkTypeNetwork typeNetworkType: 'MAIN' | 'TESTNET'true-V1.5.1
caHashPortkey account's caHashstirngtrue-V1.5.1
onBackCallback when the "Back" button on the top is clicked() => voidfalse-V1.5.1
onClickItemCallback when an item is clicked(data: ITransferLimitItem) => voidfalse-V1.5.1

TransferSettings

Display the specific transfer limit settings for a single token.

UI, when no limit is applied
UI, when limits are applied

Usage

import { TransferSettings } from '@portkey/did-ui-react';

const App: React.FC = () => (
<TransferSettings
initData={{
chainId: 'AELF',
symbol: 'ELF',
singleLimit: '20000000000',
dailyLimit: '100000000000',
restricted: true,
decimals: 8,
}}
/>
);
export default App;

API

PropertyDescriptionTypeRequiredDefaultVersion
wrapperStyleCustomise inline styleReact.CSSPropertiesfalse-V1.5.1
classNameCustomise class namestringfalse-V1.5.1
initDataInitialise displayed dataITransferLimitItemtrue-V1.5.1
isShowEditButtonIf the "Edit" button on the bottom is shownbooleanfalsetrueV1.5.1
onEditCallback when the "Edit" button is clicked() => voidfalse-V1.5.1
onBackCallback when the "Back" button on the top is clicked() => voidfalse-V1.5.1

Detailed explanation

ITransferLimitItem

NameDescriptionTypeRequiredDefaultVersion
chainIdChain ID code, eg: 'AELF'ChainIdtrue-V1.5.1
symbolSymbol code, eg: 'ELF'stringtrue-V1.5.1
restrictedIs the transaction restrictedbooleantrue-V1.5.1
singleLimitLimit per transactionstringtrue-V1.5.1
dailyLimitDaily limitstringtrue-V1.5.1
decimalsDecimals, eg: 8number | stringtrue-V1.5.1
defaultSingleLimitDefault limit per transactionstringfalse-V1.5.1
defaultDailyLimitDefault daily limitstringfalse-V1.5.1

TransferSettingsEdit

Edit and update the transfer limits for a single token. After it's updated, transactions in "transfer" and "off-ramp selling" will be verified based on the settings here.

You should first decide whether to apply the limit settings. If yes, you can set limits for a single transaction and for daily transactions respectively.

Tip: the setting of the limits needs to be approved by guardians.

UI, when no limit is applied
UI, when limits are applied

Usage

import { TransferSettingsEdit } from '@portkey/did-ui-react';

const App: React.FC = () => (
<TransferSettingsEdit
caHash="your ca hash"
originChainId="AELF"
initData={{
chainId: 'AELF',
symbol: 'ELF',
singleLimit: '20000000000',
dailyLimit: '100000000000',
restricted: true,
decimals: 8,
}}
/>
);
export default App;

API

PropertyDescriptionTypeRequiredDefaultVersion
wrapperStyleCustomise inline styleReact.CSSPropertiesfalse-V1.5.1
classNameCustomise class namestringfalse-V1.5.1
caHashPortkey account's caHashstringtrue-V1.5.1
originChainIdID of the chain where the account is registeredChainIdtrue-V1.5.1
initDataData displayedITransferLimitItemWithRoutetrue-V1.5.1
networkTypeNetwork typeMAINNET | TESTNETtrue-V2.0.0
isErrorTipIf error message is displayedbooleanfalsetrueV1.5.1
sandboxIdNeed to upload the sandbox ID when running Chrome extensionsstringfalse''V1.5.1
onBackCallback when the "Back" button on the top is clicked(data: ITransferLimitItemWithRoute) => voidfalse-V2.0.0
onSuccessCallback when the token's transfer limit is updated(data: ITransferLimitItemWithRoute) => voidfalse-V1.5.1
onGuardiansApproveErrorCallback when guardian approval failsOnErrorFuncfalse-V1.5.1

Detailed explanation

ITransferLimitItemWithRoute

extends ITransferLimitItem

NameDescriptionTypeRequiredDefaultVersion
extends ITransferLimitItem
businessFromTag of where the business is fromIBusinessFrom: 'ramp-sell' | 'send'false-V1.5.1