ConnectWalletfunction from the SDK.
connectProtonfunction can be used instead. The arguments that connectProton takes are identical to that of
connectWallet. However, one more key is required in linkOptions.
ConnectWallet, call the
loginmethod with the appName as an argument. Not supplying an appName will cause the login request to display 'Unknown requestor' as the requestor.
session.authcontains authentication information required to approve a transaction and other ConnectWallet methods.
session.accountDatacontains the user's information including name and avatar. This object also contains information about identity verification. With every
restoreSession, the SDK is checking the identity information users have previously sent up against a list of valid KYC providers. The flag
isLightKYCVerifiedwill be added to the accountData information as a boolean if users have their first name, last name, date of birth and address verified.
actionskey takes in an Array of transactions to send to the client for approval. The
broadcastkey determines if the transaction is to be broadcasted, or to simply return the signature.
accountvalue is the token contract for the token being exchanged. In the example above, the token being exchanged is XUSDT for which the token contract is
memovalue serves as additional details attached to the transaction, but does not affect the transaction.
restoreSessionkey as true in
linkOptions. Since it is not necessary to show wallet selector modal when restoring a session, this function will not display the modal selector.
yarnand the npm packages
tsdx. Upon navigating to the ProtonWeb repository, run the following command:
yarn watchin the root folder of ProtonWeb and you should see that each of the dependencies have been compiled successfully. To see the built in example, run
yarn starton a separate terminal.
yarn link. Navigate to the proton-web-sdk in the packages folder in ProtonWeb and run
yarn link. After, navigate to your project and run
yarn link @proton/web-sdkto link your project to your local proton-web-sdk repository.