@ceramicnetwork/blockchain-utils-validation 2.20.0-rc.0 → 2.21.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../src/blockchains/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../src/blockchains/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,0CAA0C,CAAA;AAOpE,wBAAsB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAO9E;AAED,eAAO,MAAM,OAAO,EAAE,iBAGrB,CAAA"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
|
+
import { ed25519 } from '@noble/curves/ed25519';
|
|
1
2
|
import * as uint8arrays from 'uint8arrays';
|
|
2
|
-
import { verify } from '@stablelib/ed25519';
|
|
3
3
|
import { normalizeAccountId } from '@ceramicnetwork/common';
|
|
4
|
-
const verifySignature = async (pubKey, message, signature) => {
|
|
5
|
-
const verified = verify(pubKey, uint8arrays.fromString(message), signature);
|
|
6
|
-
return verified;
|
|
7
|
-
};
|
|
8
4
|
const namespace = 'solana';
|
|
9
5
|
export async function validateLink(proof) {
|
|
10
6
|
const account = normalizeAccountId(proof.account);
|
|
11
7
|
const pubKey = uint8arrays.fromString(account.address, 'base58btc');
|
|
12
8
|
const msg = proof.message;
|
|
13
9
|
const sig = uint8arrays.fromString(proof.signature, 'base64');
|
|
14
|
-
const
|
|
15
|
-
return
|
|
10
|
+
const isValid = ed25519.verify(sig, uint8arrays.fromString(msg), pubKey);
|
|
11
|
+
return isValid ? proof : null;
|
|
16
12
|
}
|
|
17
13
|
export const handler = {
|
|
18
14
|
namespace,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../src/blockchains/solana.ts"],"names":[],"mappings":"AAEA,OAAO,
|
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../src/blockchains/solana.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAC/C,OAAO,KAAK,WAAW,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAE3D,MAAM,SAAS,GAAG,QAAQ,CAAA;AAE1B,MAAM,CAAC,KAAK,UAAU,YAAY,CAAC,KAAgB;IACjD,MAAM,OAAO,GAAG,kBAAkB,CAAC,KAAK,CAAC,OAAO,CAAC,CAAA;IACjD,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,WAAW,CAAC,CAAA;IACnE,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAA;IACzB,MAAM,GAAG,GAAG,WAAW,CAAC,UAAU,CAAC,KAAK,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;IAC7D,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAA;IACxE,OAAO,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA;AAC/B,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAsB;IACxC,SAAS;IACT,YAAY;CACb,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ceramicnetwork/blockchain-utils-validation",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.21.0-rc.0",
|
|
4
4
|
"description": "Blockchain utils for validation of linked blockchain accounts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ceramic",
|
|
@@ -37,14 +37,14 @@
|
|
|
37
37
|
"clean": "npx rimraf ./lib"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@ceramicnetwork/blockchain-utils-linking": "^2.
|
|
41
|
-
"@ceramicnetwork/common": "^2.
|
|
40
|
+
"@ceramicnetwork/blockchain-utils-linking": "^2.15.0-rc.0",
|
|
41
|
+
"@ceramicnetwork/common": "^2.29.0-rc.0",
|
|
42
42
|
"@ethersproject/contracts": "^5.5.0",
|
|
43
43
|
"@ethersproject/providers": "^5.5.1",
|
|
44
44
|
"@ethersproject/wallet": "^5.5.0",
|
|
45
|
+
"@noble/curves": "^1.1.0",
|
|
45
46
|
"@polkadot/util-crypto": "^7.0.2",
|
|
46
47
|
"@smontero/eosio-signing-tools": "^0.0.6",
|
|
47
|
-
"@stablelib/ed25519": "^1.0.2",
|
|
48
48
|
"@taquito/utils": "^11.2.0",
|
|
49
49
|
"@tendermint/sig": "^0.6.0",
|
|
50
50
|
"@zondax/filecoin-signing-tools": "^0.18.2",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"ganache-core": "^2.13.2",
|
|
68
68
|
"near-api-js": "^0.44.2"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "ce5f42d6a42759cdfa9b311c2cca380c985a5a22"
|
|
71
71
|
}
|