chore: updated the @multiversx/sdk-core library (#289)

This commit is contained in:
Radu Mojic 2023-09-07 13:12:41 +03:00 committed by GitHub
parent 5b33ad0e6b
commit c3af6c0ec0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 100 additions and 54 deletions

View File

@ -15,7 +15,7 @@
"@kadena/client": "^0.5.0",
"@kadena/cryptography-utils": "^0.3.3",
"@kadena/types": "^0.3.3",
"@multiversx/sdk-core": "11.6.0",
"@multiversx/sdk-core": "12.8.0",
"@multiversx/sdk-wallet": "4.2.0",
"@polkadot/util-crypto": "^10.1.2",
"@solana/web3.js": "^1.36.0",

View File

@ -975,7 +975,7 @@ export function JsonRpcContextProvider({
const transaction = testTransaction.toPlainObject();
try {
const result = await client!.request<{ signature: Buffer }>({
const result = await client!.request<{ signature: string }>({
chainId,
topic: session!.topic,
request: {
@ -987,8 +987,8 @@ export function JsonRpcContextProvider({
});
const valid = verifier.verify(
testTransaction.serializeForSigning(Address.fromBech32(address)),
result.signature
testTransaction.serializeForSigning(),
Buffer.from(result.signature, "hex")
);
return {
@ -1055,7 +1055,7 @@ export function JsonRpcContextProvider({
try {
const result = await client!.request<{
signatures: { signature: Buffer }[];
signatures: { signature: string }[];
}>({
chainId,
topic: session!.topic,
@ -1075,8 +1075,8 @@ export function JsonRpcContextProvider({
return (
acc &&
verifier.verify(
current.serializeForSigning(Address.fromBech32(address)),
result.signatures[index].signature
current.serializeForSigning(),
Buffer.from(result.signatures[index].signature, "hex")
)
);
}, true);
@ -1110,7 +1110,7 @@ export function JsonRpcContextProvider({
});
try {
const result = await client!.request<{ signature: Buffer }>({
const result = await client!.request<{ signature: string }>({
chainId,
topic: session!.topic,
request: {
@ -1124,7 +1124,7 @@ export function JsonRpcContextProvider({
const valid = verifier.verify(
testMessage.serializeForSigning(),
result.signature
Buffer.from(result.signature, "hex")
);
return {

View File

@ -2167,10 +2167,10 @@
resolved "https://registry.yarnpkg.com/@multiversx/sdk-bls-wasm/-/sdk-bls-wasm-0.3.5.tgz#2e83308fdc7a0928c6d5a7f910d796fd8eb2d90b"
integrity sha512-c0tIdQUnbBLSt6NYU+OpeGPYdL0+GV547HeHT8Xc0BKQ7Cj0v82QUoA2QRtWrR1G4MNZmLsIacZSsf6DrIS2Bw==
"@multiversx/sdk-core@11.6.0":
version "11.6.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-11.6.0.tgz#31dff80f7734e57f0af62aa92027f248da5ec4f7"
integrity sha512-bP1fmp84iEAJEdaprvw8M9FeqJVOWTmv8vhhiaYW6YTV/ztlB+niv1CFsYk0dWFWIfKzn+eT4CvQjl8OTwBC/A==
"@multiversx/sdk-core@12.8.0":
version "12.8.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-12.8.0.tgz#a30687bc562f1bcd9f95e75fa2857409cb8e777f"
integrity sha512-+XtnwQ/dUaXrpu/GCNud7r5AaQtNKRVqeKnjVUoKKHr14ohXbg9FW2Xx7IrJvehEMupjdx+6phR+nAXR60bIbQ==
dependencies:
"@multiversx/sdk-transaction-decoder" "1.0.2"
bech32 "1.1.4"
@ -2179,7 +2179,7 @@
buffer "6.0.3"
json-duplicate-key-handle "1.0.0"
keccak "3.0.2"
protobufjs "6.11.3"
protobufjs "7.2.4"
"@multiversx/sdk-transaction-decoder@1.0.2":
version "1.0.2"
@ -9709,6 +9709,11 @@ long@^4.0.0:
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
@ -11720,10 +11725,10 @@ prop-types@^15.7.2, prop-types@^15.8.1:
object-assign "^4.1.1"
react-is "^16.13.1"
protobufjs@6.11.3:
version "6.11.3"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74"
integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==
protobufjs@7.2.4:
version "7.2.4"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae"
integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
@ -11735,9 +11740,8 @@ protobufjs@6.11.3:
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"
long "^5.0.0"
protobufjs@~6.10.2:
version "6.10.3"

View File

@ -15,7 +15,7 @@
"@json-rpc-tools/utils": "1.7.6",
"@kadena/cryptography-utils": "^0.3.2",
"@kadena/types": "^0.3.2",
"@multiversx/sdk-core": "11.6.0",
"@multiversx/sdk-core": "12.8.0",
"@multiversx/sdk-wallet": "4.2.0",
"@near-wallet-selector/wallet-utils": "^7.0.2",
"@nextui-org/react": "1.0.8-beta.5",

View File

@ -66,7 +66,7 @@ export default class MultiversxLib {
const signTransaction = Transaction.fromPlainObject(transaction)
const signer = new UserSigner(UserSecretKey.fromString(secretKeyHex))
const signature = await signer.sign(signTransaction.serializeForSigning(signer.getAddress()))
const signature = await signer.sign(signTransaction.serializeForSigning())
return { signature: signature.toString('hex') }
}
@ -79,9 +79,7 @@ export default class MultiversxLib {
transactions.map(async (transaction: any): Promise<any> => {
const signTransaction = Transaction.fromPlainObject(transaction)
const signer = new UserSigner(UserSecretKey.fromString(secretKeyHex))
const signature = await signer.sign(
signTransaction.serializeForSigning(signer.getAddress())
)
const signature = await signer.sign(signTransaction.serializeForSigning())
return { signature: signature.toString('hex') }
})

View File

@ -38,7 +38,7 @@ export async function approveMultiversxRequest(
// Sometimes a dApp (and its backend) might want to reliably assign an off-chain user identity to a MultiversX address.
// On this purpose, the signing providers allow a login token to be used within the login flow - this token is signed using the wallet of the user.
// Afterwards, a backend application would normally verify the signature of the token
const message = `${account}${request.params.token}{}`
const message = `${account}${request.params.token}`
const { signature: signedLoginToken } = await wallet.signMessage(message)
return formatJsonRpcResult(id, { signature: signedLoginToken })

View File

@ -804,10 +804,10 @@
resolved "https://registry.yarnpkg.com/@multiversx/sdk-bls-wasm/-/sdk-bls-wasm-0.3.5.tgz#2e83308fdc7a0928c6d5a7f910d796fd8eb2d90b"
integrity sha512-c0tIdQUnbBLSt6NYU+OpeGPYdL0+GV547HeHT8Xc0BKQ7Cj0v82QUoA2QRtWrR1G4MNZmLsIacZSsf6DrIS2Bw==
"@multiversx/sdk-core@11.6.0":
version "11.6.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-11.6.0.tgz#31dff80f7734e57f0af62aa92027f248da5ec4f7"
integrity sha512-bP1fmp84iEAJEdaprvw8M9FeqJVOWTmv8vhhiaYW6YTV/ztlB+niv1CFsYk0dWFWIfKzn+eT4CvQjl8OTwBC/A==
"@multiversx/sdk-core@12.8.0":
version "12.8.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-12.8.0.tgz#a30687bc562f1bcd9f95e75fa2857409cb8e777f"
integrity sha512-+XtnwQ/dUaXrpu/GCNud7r5AaQtNKRVqeKnjVUoKKHr14ohXbg9FW2Xx7IrJvehEMupjdx+6phR+nAXR60bIbQ==
dependencies:
"@multiversx/sdk-transaction-decoder" "1.0.2"
bech32 "1.1.4"
@ -816,7 +816,7 @@
buffer "6.0.3"
json-duplicate-key-handle "1.0.0"
keccak "3.0.2"
protobufjs "6.11.3"
protobufjs "7.2.4"
"@multiversx/sdk-transaction-decoder@1.0.2":
version "1.0.2"
@ -4425,6 +4425,11 @@ long@^4.0.0:
resolved "https://registry.npmjs.org/long/-/long-4.0.0.tgz"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz"
@ -4902,10 +4907,10 @@ property-information@^5.0.0:
dependencies:
xtend "^4.0.0"
protobufjs@6.11.3, protobufjs@~6.11.2:
version "6.11.3"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74"
integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==
protobufjs@7.2.4:
version "7.2.4"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae"
integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
@ -4917,9 +4922,8 @@ protobufjs@6.11.3, protobufjs@~6.11.2:
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"
long "^5.0.0"
protobufjs@~6.10.2:
version "6.10.3"
@ -4940,6 +4944,25 @@ protobufjs@~6.10.2:
"@types/node" "^13.7.0"
long "^4.0.0"
protobufjs@~6.11.2:
version "6.11.3"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74"
integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"
proxy-compare@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.1.0.tgz#5f99b3ed6a265135ce7ec145ce304e6f89b6511b"

View File

@ -12,7 +12,7 @@
"@cosmjs/amino": "0.31.1",
"@cosmjs/encoding": "0.31.1",
"@cosmjs/proto-signing": "0.31.1",
"@multiversx/sdk-core": "11.6.0",
"@multiversx/sdk-core": "12.8.0",
"@multiversx/sdk-wallet": "4.2.0",
"@json-rpc-tools/utils": "1.7.6",
"@near-wallet-selector/wallet-utils": "^7.0.2",

View File

@ -66,7 +66,7 @@ export default class MultiversxLib {
const signTransaction = Transaction.fromPlainObject(transaction)
const signer = new UserSigner(UserSecretKey.fromString(secretKeyHex))
const signature = await signer.sign(signTransaction.serializeForSigning(signer.getAddress()))
const signature = await signer.sign(signTransaction.serializeForSigning())
return { signature: signature.toString('hex') }
}
@ -79,9 +79,7 @@ export default class MultiversxLib {
transactions.map(async (transaction: any): Promise<any> => {
const signTransaction = Transaction.fromPlainObject(transaction)
const signer = new UserSigner(UserSecretKey.fromString(secretKeyHex))
const signature = await signer.sign(
signTransaction.serializeForSigning(signer.getAddress())
)
const signature = await signer.sign(signTransaction.serializeForSigning())
return { signature: signature.toString('hex') }
})

View File

@ -38,7 +38,7 @@ export async function approveMultiversxRequest(
// Sometimes a dApp (and its backend) might want to reliably assign an off-chain user identity to a MultiversX address.
// On this purpose, the signing providers allow a login token to be used within the login flow - this token is signed using the wallet of the user.
// Afterwards, a backend application would normally verify the signature of the token
const message = `${account}${request.params.token}{}`
const message = `${account}${request.params.token}`
const { signature: signedLoginToken } = await wallet.signMessage(message)
return formatJsonRpcResult(id, { signature: signedLoginToken })

View File

@ -789,10 +789,10 @@
resolved "https://registry.yarnpkg.com/@multiversx/sdk-bls-wasm/-/sdk-bls-wasm-0.3.5.tgz#2e83308fdc7a0928c6d5a7f910d796fd8eb2d90b"
integrity sha512-c0tIdQUnbBLSt6NYU+OpeGPYdL0+GV547HeHT8Xc0BKQ7Cj0v82QUoA2QRtWrR1G4MNZmLsIacZSsf6DrIS2Bw==
"@multiversx/sdk-core@11.6.0":
version "11.6.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-11.6.0.tgz#31dff80f7734e57f0af62aa92027f248da5ec4f7"
integrity sha512-bP1fmp84iEAJEdaprvw8M9FeqJVOWTmv8vhhiaYW6YTV/ztlB+niv1CFsYk0dWFWIfKzn+eT4CvQjl8OTwBC/A==
"@multiversx/sdk-core@12.8.0":
version "12.8.0"
resolved "https://registry.yarnpkg.com/@multiversx/sdk-core/-/sdk-core-12.8.0.tgz#a30687bc562f1bcd9f95e75fa2857409cb8e777f"
integrity sha512-+XtnwQ/dUaXrpu/GCNud7r5AaQtNKRVqeKnjVUoKKHr14ohXbg9FW2Xx7IrJvehEMupjdx+6phR+nAXR60bIbQ==
dependencies:
"@multiversx/sdk-transaction-decoder" "1.0.2"
bech32 "1.1.4"
@ -801,7 +801,7 @@
buffer "6.0.3"
json-duplicate-key-handle "1.0.0"
keccak "3.0.2"
protobufjs "6.11.3"
protobufjs "7.2.4"
"@multiversx/sdk-transaction-decoder@1.0.2":
version "1.0.2"
@ -4305,6 +4305,11 @@ long@^4.0.0:
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
long@^5.0.0:
version "5.2.3"
resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1"
integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==
loose-envify@^1.1.0, loose-envify@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
@ -4782,10 +4787,10 @@ property-information@^5.0.0:
dependencies:
xtend "^4.0.0"
protobufjs@6.11.3, protobufjs@~6.11.2:
version "6.11.3"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74"
integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==
protobufjs@7.2.4:
version "7.2.4"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-7.2.4.tgz#3fc1ec0cdc89dd91aef9ba6037ba07408485c3ae"
integrity sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
@ -4797,9 +4802,8 @@ protobufjs@6.11.3, protobufjs@~6.11.2:
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"
long "^5.0.0"
protobufjs@~6.10.2:
version "6.10.3"
@ -4820,6 +4824,25 @@ protobufjs@~6.10.2:
"@types/node" "^13.7.0"
long "^4.0.0"
protobufjs@~6.11.2:
version "6.11.3"
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74"
integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==
dependencies:
"@protobufjs/aspromise" "^1.1.2"
"@protobufjs/base64" "^1.1.2"
"@protobufjs/codegen" "^2.0.4"
"@protobufjs/eventemitter" "^1.1.0"
"@protobufjs/fetch" "^1.1.0"
"@protobufjs/float" "^1.0.2"
"@protobufjs/inquire" "^1.1.0"
"@protobufjs/path" "^1.1.2"
"@protobufjs/pool" "^1.1.0"
"@protobufjs/utf8" "^1.1.0"
"@types/long" "^4.0.1"
"@types/node" ">=13.7.0"
long "^4.0.0"
proxy-compare@2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/proxy-compare/-/proxy-compare-2.1.0.tgz#5f99b3ed6a265135ce7ec145ce304e6f89b6511b"