From c9a553a4774e4f0e65812661e46be328e9fed057 Mon Sep 17 00:00:00 2001 From: Josh Stevens Date: Wed, 27 Jan 2021 13:29:28 +0000 Subject: [PATCH] change sample code for 3.0.0 wallet release --- package-lock.json | 18 +++++++++--------- package.json | 2 +- public/index.html | 2 +- src/services/wallet-service.js | 9 +++++---- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index b52f26f..ba31ed3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1290,18 +1290,18 @@ } }, "@funfair-tech/wallet-sdk": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@funfair-tech/wallet-sdk/-/wallet-sdk-2.2.0.tgz", - "integrity": "sha512-uUySp33pZkJ8KN8Q7zk42cIPaAlmQp2aty2ASDolEQjKMXac/dkn56nqmT1v8e9MU10rXQlJDtRlOjxd6JiRtQ==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@funfair-tech/wallet-sdk/-/wallet-sdk-3.0.3.tgz", + "integrity": "sha512-0voT5i1YWv12PzIN523O6SCF8TNw2Ae9E9SduCkTEsWpVwCVKQ6PdtU6yAQH/rWafWFLPvam6UObzDTQRw0BGQ==", "requires": { "@types/node": "^11.13.0", "iframe-resizer": "^4.1.1" }, "dependencies": { "@types/node": { - "version": "11.15.25", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.15.25.tgz", - "integrity": "sha512-ImUmwl8cncnnUAPn8WtmLqv+MPRJScDGHEgBxHltofp7h0olFKGAT2eOswkYF9U9G3jNtPl+dE7AytIIafexlQ==" + "version": "11.15.44", + "resolved": "https://registry.npmjs.org/@types/node/-/node-11.15.44.tgz", + "integrity": "sha512-fHAcNn2FlzDMA9rV5KP73r1cMZdbommWic2foHAEWoa/LITi91AueHDsJpnqjBEJ7bYoT2WC+KN1RL0vsM20zA==" } } }, @@ -6805,9 +6805,9 @@ "dev": true }, "iframe-resizer": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.2.11.tgz", - "integrity": "sha512-fj5vX5kkpRbMb5Qje6veIDzqoJpnCEqUDdSOwASOeQHYmb8hLYX6Ev2yXf3jjMs2MclwcYY3chyZ3diGKcr8DA==" + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/iframe-resizer/-/iframe-resizer-4.3.1.tgz", + "integrity": "sha512-PkoTPNF6EYhTbDjogdKu7JVgKqRwwNBXMeywZaQyzEYM3BNltA8O9fIIrtUkmj+8VZGckXpwtXsWsaQ5lrhd0w==" }, "ignore": { "version": "4.0.6", diff --git a/package.json b/package.json index fa7886d..83956a7 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { - "@funfair-tech/wallet-sdk": "^2.2.0", + "@funfair-tech/wallet-sdk": "^3.0.3", "@funfair-tech/wallet-vue": "^1.1.0", "core-js": "^3.6.5", "rxjs": "^6.6.3", diff --git a/public/index.html b/public/index.html index b6f46d4..6256a5e 100644 --- a/public/index.html +++ b/public/index.html @@ -7,7 +7,7 @@ <%= htmlWebpackPlugin.options.title %> diff --git a/src/services/wallet-service.js b/src/services/wallet-service.js index 0aa5e76..02a2034 100644 --- a/src/services/wallet-service.js +++ b/src/services/wallet-service.js @@ -73,7 +73,7 @@ export function login() { } export function logout() { - window.funwallet.sdk.logout(); + window.funwallet.sdk.auth.logout(); isAuthenticated$.next(false); } @@ -88,7 +88,7 @@ function web3Instance() { } export async function signAMessage(messageText) { - const ethereumAddress = await window.funwallet.sdk.ethereumAddress(); + const ethereumAddress = await window.funwallet.sdk.eth.address(); const result = await web3Instance().eth.personal.sign( messageText, @@ -99,7 +99,8 @@ export async function signAMessage(messageText) { } export async function sendTransaction(tx) { - const ethereumAddress = await window.funwallet.sdk.ethereumAddress(); + const ethereumAddress = await window.funwallet.sdk.eth.address(); + tx.from = ethereumAddress; web3Instance() @@ -113,5 +114,5 @@ export async function sendTransaction(tx) { } export async function openKycProcess() { - await window.funwallet.sdk.kycModalOpen(); + await window.funwallet.sdk.kyc.start(); }