Skip to content

Commit 40becfe

Browse files
committed
update sdk
1 parent d405f1f commit 40becfe

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"dependencies": {
66
"@bitcoin-js/tiny-secp256k1-asmjs": "^2.2.3",
77
"@mintlayer/entropy-generator": "^1.0.4",
8-
"@mintlayer/sdk": "^1.0.16",
8+
"@mintlayer/sdk": "^1.0.17",
99
"bip32": "^4.0.0",
1010
"bip39": "^3.1.0",
1111
"bitcoinjs-lib": "^6.1.7",

src/pages/SDKTestPage/SDKTestPage.js

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { Client } from '@mintlayer/sdk'
33
import { useContext, useEffect, useState } from 'react'
44
import { AccountContext, SettingsContext } from '@Contexts'
55
import { AppInfo } from '@Constants'
6-
import { useNavigate } from 'react-router-dom'
76

87
class InMemoryAccountProvider {
98
constructor(addresses) {
@@ -28,6 +27,7 @@ class InMemoryAccountProvider {
2827
}
2928

3029
async request(params) {
30+
console.log('params', params)
3131
throw new Error('Signing not supported in InMemoryAccountProvider')
3232
}
3333
}
@@ -37,7 +37,6 @@ export const SignTransactionPage = () => {
3737
const [to, setTo] = useState('')
3838
const [amount, setAmount] = useState('')
3939

40-
const navigate = useNavigate()
4140
const { addresses } = useContext(AccountContext)
4241
const { networkType } = useContext(SettingsContext)
4342

@@ -69,19 +68,11 @@ export const SignTransactionPage = () => {
6968
}, [currentMlAddresses.mlReceivingAddresses])
7069

7170
const handleSend = async () => {
72-
const transaction = await client.buildTransaction({
73-
type: 'Transfer',
74-
params: {
75-
to: to,
76-
amount: amount, // Example amount in satoshis
77-
},
78-
})
79-
navigate('/wallet/Mintlayer/sign-transaction', {
80-
state: {
81-
action: 'signTransaction',
82-
request: { action: 'signTransaction', data: { txData: transaction } },
83-
},
71+
const transaction_signed = await client.transfer({
72+
to: to,
73+
amount: amount,
8474
})
75+
console.log('transaction_signed', transaction_signed)
8576
}
8677

8778
return (

0 commit comments

Comments
 (0)