@gvnrdao/dh-lit-actions 0.0.311 → 0.0.312
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.
- package/dist/a_dev_address-probe-signer.meta.json +1 -1
- package/dist/a_dev_address-probe.meta.json +1 -1
- package/dist/a_dev_always-signer.meta.json +1 -1
- package/dist/a_dev_authorization-dummy-b.meta.json +1 -1
- package/dist/a_dev_authorization-dummy.meta.json +1 -1
- package/dist/a_dev_ethers-version-probe.meta.json +1 -1
- package/dist/a_dev_process-payment-sign-only.meta.json +1 -1
- package/dist/btc-address-balance.meta.json +1 -1
- package/dist/btc-transaction-signer.meta.json +1 -1
- package/dist/btc-utxo-invalidator.meta.json +1 -1
- package/dist/btc-withdrawal.meta.json +1 -1
- package/dist/encrypt-parameter.meta.json +1 -1
- package/dist/extend-position-validator.meta.json +1 -1
- package/dist/liquidation-validator.meta.json +1 -1
- package/dist/loan-vault-btc-balance.meta.json +1 -1
- package/dist/pkp-validator.action.js +1 -1
- package/dist/pkp-validator.hash +1 -1
- package/dist/pkp-validator.meta.json +5 -5
- package/dist/price-oracle.meta.json +1 -1
- package/dist/process-payment-validator.meta.json +1 -1
- package/dist/stale-spend-recovery-validator.meta.json +1 -1
- package/dist/ucd-mint-validator.meta.json +1 -1
- package/package.json +1 -1
- package/pkg-dist/pkg-src/index.js +5 -5
- package/pkg-dist/pkg-src/index.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var _LIT_ACTION_=(()=>{var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i={};async function main(e){const t=e.pkpId,r=e.targetPkpTokenId,o=e.expectedCid,n=e.network,i=e.ipfsId,s=e.borrowerAddress,a=e.pkpValidationContract;if(!t)throw new Error("pkpId is required (Chipotle wallet ID for user PKP)");if(!o)throw new Error("expectedCid is required");if(!i)throw new Error("ipfsId is required to derive the validator signing key");if(!s)throw new Error("borrowerAddress is required for EIP-712 attestation");if(!a)throw new Error("pkpValidationContract is required for EIP-712 domain");let l=e.chainId;if(null==l&&"chipotle"===n&&(l=11155111),null==l)throw new Error("chainId is required for EIP-712 domain");console.log("[PKP Validator] Step 1: Getting user PKP key...");const c=await Lit.Actions.getPrivateKey({pkpId:t}),d="string"==typeof c?c.startsWith("0x")?c:`0x${c}`:String(c);console.log("[PKP Validator] Step 2: Deriving public key...");const f=ethers.utils.computePublicKey(d,!1);function u(e,t){const r=e.startsWith("0x")?e.slice(2):e;if(130!==r.length)throw new Error(`Invalid public key length: ${r.length}`);const o=r.slice(2,66),n=r.slice(66,130),i=(BigInt("0x"+n)%2n===0n?"02":"03")+o,s=ethers.utils.sha256("0x"+i);let a;return a="mainnet"===t?"bc":"testnet"===t?"tb":"bcrt",function(e,t,r){const o="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substr(e,2),16));const i=[t].concat(function(e,t,r,o){let n=0,i=0;const s=[],a=(1<<r)-1;for(const o of e){if(o<0||o>>t)throw new Error("Invalid data for bit conversion");for(n=n<<t|o,i+=t;i>=r;)i-=r,s.push(n>>i&a)}if(o)i>0&&s.push(n<<r-i&a);else if(i>=t||n<<r-i&a)throw new Error("Invalid padding in bit conversion");return s}(n,8,5,!0)),s=function(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r)>>5);t.push(0);for(let r=0;r<e.length;r++)t.push(31&e.charCodeAt(r));return t}(e).concat(t).concat([0,0,0,0,0,0]),o=1^function(e){const t=[996825010,642813549,513874426,1027748829,705979059];let r=1;for(const o of e){const e=r>>25;r=(33554431&r)<<5^o;for(let o=0;o<5;o++)e>>o&1&&(r^=t[o])}return r}(r),n=[];for(let e=0;e<6;e++)n.push(o>>5*(5-e)&31);return n}(e,i),a=i.concat(s);let l=e+"1";for(const e of a)l+=o[e];return l}(a,0,ethers.utils.ripemd160(s).slice(2))}console.log("[PKP Validator] Step 3: Deriving Bitcoin addresses...");const p=u(f,"mainnet"),h=u(f,"regtest");if(console.log(`[PKP Validator] Mainnet: ${p}`),console.log(`[PKP Validator] Regtest: ${h}`),console.log("[PKP Validator] Step 4: Signing attestation..."),!r)throw new Error("targetPkpTokenId is required for PKP validator attestation (the on-chain verifier reconstructs from the NFT token id; the keccak fallback produces an unverifiable signature)");const g=`PKP::${ethers.BigNumber.from(r).toString()}::CID::${o.toLowerCase()}::MAINNET::${p}::REGTEST::${h}::SECURE`,P=ethers.utils.toUtf8Bytes(g),w=ethers.utils.hashMessage(P);console.log(`[PKP Validator] Message: ${g}`),console.log(`[PKP Validator] Message hash: ${w}`);const I=e.validatorWalletAddress||globalThis.validatorWalletAddress;if(!I||!I.startsWith("0x"))throw new Error("validatorWalletAddress required \u2014 must be a createWallet-derived address");const b=await Lit.Actions.getPrivateKey({pkpId:I}),v="string"==typeof b?b.startsWith("0x")?b:`0x${b}`:String(b),k=new ethers.Wallet(v),m=await k.signMessage(P);return console.log("[PKP Validator] \u2705 Complete"),{success:!0,pkpPublicKey:f,bitcoinAddresses:{mainnet:p,regtest:h},validatorPkp:k.address,signature:m,timestamp:Date.now(),network:n,expectedCid:o}}return((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(i,{main:()=>main}),e=i,((e,i,s,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of o(i))n.call(e,l)||l===s||t(e,l,{get:()=>i[l],enumerable:!(a=r(i,l))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e)})();if("object"==typeof _LIT_ACTION_)if("function"==typeof _LIT_ACTION_.main)var main=_LIT_ACTION_.main;else"function"==typeof _LIT_ACTION_.go&&_LIT_ACTION_.go();
|
|
1
|
+
var _LIT_ACTION_=(()=>{var e,t=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,n=Object.prototype.hasOwnProperty,i={};async function main(e){const t=e.pkpId,r=e.targetPkpTokenId,o=e.expectedCid,n=e.network,i=e.ipfsId,s=e.borrowerAddress,a=e.pkpValidationContract;if(!t)throw new Error("pkpId is required (Chipotle wallet ID for user PKP)");if(!o)throw new Error("expectedCid is required");if(!i)throw new Error("ipfsId is required to derive the validator signing key");if(!s)throw new Error("borrowerAddress is required for EIP-712 attestation");if(!a)throw new Error("pkpValidationContract is required for EIP-712 domain");let l=e.chainId;if(null==l&&"chipotle"===n&&(l=11155111),null==l)throw new Error("chainId is required for EIP-712 domain");console.log("[PKP Validator] Step 1: Getting user PKP key...");const c=await Lit.Actions.getPrivateKey({pkpId:t}),d="string"==typeof c?c.startsWith("0x")?c:`0x${c}`:String(c);console.log("[PKP Validator] Step 2: Deriving public key...");const f=ethers.utils.computePublicKey(d,!1);function u(e,t){const r=e.startsWith("0x")?e.slice(2):e;if(130!==r.length)throw new Error(`Invalid public key length: ${r.length}`);const o=r.slice(2,66),n=r.slice(66,130),i=(BigInt("0x"+n)%2n===0n?"02":"03")+o,s=ethers.utils.sha256("0x"+i);let a;return a="mainnet"===t?"bc":"testnet"===t?"tb":"bcrt",function(e,t,r){const o="qpzry9x8gf2tvdw0s3jn54khce6mua7l",n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substr(e,2),16));const i=[t].concat(function(e,t,r,o){let n=0,i=0;const s=[],a=(1<<r)-1;for(const o of e){if(o<0||o>>t)throw new Error("Invalid data for bit conversion");for(n=n<<t|o,i+=t;i>=r;)i-=r,s.push(n>>i&a)}if(o)i>0&&s.push(n<<r-i&a);else if(i>=t||n<<r-i&a)throw new Error("Invalid padding in bit conversion");return s}(n,8,5,!0)),s=function(e,t){const r=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r)>>5);t.push(0);for(let r=0;r<e.length;r++)t.push(31&e.charCodeAt(r));return t}(e).concat(t).concat([0,0,0,0,0,0]),o=1^function(e){const t=[996825010,642813549,513874426,1027748829,705979059];let r=1;for(const o of e){const e=r>>25;r=(33554431&r)<<5^o;for(let o=0;o<5;o++)e>>o&1&&(r^=t[o])}return r}(r),n=[];for(let e=0;e<6;e++)n.push(o>>5*(5-e)&31);return n}(e,i),a=i.concat(s);let l=e+"1";for(const e of a)l+=o[e];return l}(a,0,ethers.utils.ripemd160(s).slice(2))}console.log("[PKP Validator] Step 3: Deriving Bitcoin addresses...");const p=u(f,"mainnet"),h=u(f,"regtest");if(console.log(`[PKP Validator] Mainnet: ${p}`),console.log(`[PKP Validator] Regtest: ${h}`),console.log("[PKP Validator] Step 4: Signing attestation..."),!r)throw new Error("targetPkpTokenId is required for PKP validator attestation (the on-chain verifier reconstructs from the NFT token id; the keccak fallback produces an unverifiable signature)");const g=`PKP::${ethers.BigNumber.from(r).toString()}::CID::${o.toLowerCase()}::MAINNET::${p}::REGTEST::${h}::BORROWER::${s.toLowerCase()}::SECURE`,P=ethers.utils.toUtf8Bytes(g),w=ethers.utils.hashMessage(P);console.log(`[PKP Validator] Message: ${g}`),console.log(`[PKP Validator] Message hash: ${w}`);const I=e.validatorWalletAddress||globalThis.validatorWalletAddress;if(!I||!I.startsWith("0x"))throw new Error("validatorWalletAddress required \u2014 must be a createWallet-derived address");const b=await Lit.Actions.getPrivateKey({pkpId:I}),v="string"==typeof b?b.startsWith("0x")?b:`0x${b}`:String(b),k=new ethers.Wallet(v),m=await k.signMessage(P);return console.log("[PKP Validator] \u2705 Complete"),{success:!0,pkpPublicKey:f,bitcoinAddresses:{mainnet:p,regtest:h},validatorPkp:k.address,signature:m,timestamp:Date.now(),network:n,expectedCid:o}}return((e,r)=>{for(var o in r)t(e,o,{get:r[o],enumerable:!0})})(i,{main:()=>main}),e=i,((e,i,s,a)=>{if(i&&"object"==typeof i||"function"==typeof i)for(let l of o(i))n.call(e,l)||l===s||t(e,l,{get:()=>i[l],enumerable:!(a=r(i,l))||a.enumerable});return e})(t({},"__esModule",{value:!0}),e)})();if("object"==typeof _LIT_ACTION_)if("function"==typeof _LIT_ACTION_.main)var main=_LIT_ACTION_.main;else"function"==typeof _LIT_ACTION_.go&&_LIT_ACTION_.go();
|
package/dist/pkp-validator.hash
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
4c0d65bf1f33cdac22a78fd8c4764319cc3fe00650e0fe7fa8a6090d9a318a7b
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"actionName": "pkp-validator",
|
|
3
|
-
"originalSize":
|
|
4
|
-
"minifiedSize":
|
|
5
|
-
"compressionRatio": 0.
|
|
6
|
-
"hash": "
|
|
7
|
-
"buildTime":
|
|
3
|
+
"originalSize": 8457,
|
|
4
|
+
"minifiedSize": 4140,
|
|
5
|
+
"compressionRatio": 0.5104647037956722,
|
|
6
|
+
"hash": "4c0d65bf1f33cdac22a78fd8c4764319cc3fe00650e0fe7fa8a6090d9a318a7b",
|
|
7
|
+
"buildTime": 1783336874829,
|
|
8
8
|
"version": "0.1.0"
|
|
9
9
|
}
|
package/package.json
CHANGED
|
@@ -657,17 +657,17 @@ var DH_LIT_ACTIONS_CHIPOTLE = {
|
|
|
657
657
|
hash: "d6eb8665fa4f1fe19b6a2bc81fbf729af68a1daf30117f40e37705381978a7ce"
|
|
658
658
|
},
|
|
659
659
|
pkpValidator: {
|
|
660
|
-
cid: "
|
|
660
|
+
cid: "QmRfPvd7R7MoEnShds28Y4ovdV8RoDCGkYWTcF1JHZVTQa",
|
|
661
661
|
authorizedCidHex: cidToHex(
|
|
662
|
-
"
|
|
662
|
+
"QmRfPvd7R7MoEnShds28Y4ovdV8RoDCGkYWTcF1JHZVTQa"
|
|
663
663
|
),
|
|
664
664
|
name: "Pkp Validator",
|
|
665
665
|
description: "Production Pkp Validator",
|
|
666
666
|
version: "1.0.0",
|
|
667
667
|
deployed: true,
|
|
668
|
-
deployedAt:
|
|
669
|
-
size:
|
|
670
|
-
hash: "
|
|
668
|
+
deployedAt: 1783106284785,
|
|
669
|
+
size: 4140,
|
|
670
|
+
hash: "4c0d65bf1f33cdac22a78fd8c4764319cc3fe00650e0fe7fa8a6090d9a318a7b",
|
|
671
671
|
validatorWalletAddress: "0x82db9f515957aa380b596c6ea2bd30cef181f236",
|
|
672
672
|
pkp: {
|
|
673
673
|
publicKey: "0x04ec0e3acc40884e3f366ca469d08899eb640ad5259fa196b0238075086208a9f8732a3175704f35f0bcc28e07406cfb24c254efd1e7355640577330f0d2dd755f",
|