@pufferfinance/puffer-sdk 1.1.0 → 1.2.1

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.
Files changed (35) hide show
  1. package/README.md +1 -1
  2. package/dist/api/puffer-client.d.ts +12 -0
  3. package/dist/{ccip-BERTKE3h.js → ccip-D9sqjqG8.js} +2 -2
  4. package/dist/{ccip-BERTKE3h.js.map → ccip-D9sqjqG8.js.map} +1 -1
  5. package/dist/{ccip-CsTi3xD2.cjs → ccip-x56ET8k8.cjs} +2 -2
  6. package/dist/{ccip-CsTi3xD2.cjs.map → ccip-x56ET8k8.cjs.map} +1 -1
  7. package/dist/contracts/abis/mainnet/PufLocker.d.ts +476 -0
  8. package/dist/contracts/abis/mainnet/PufToken.d.ts +676 -0
  9. package/dist/contracts/abis/mainnet/PufferL2Depositor.d.ts +351 -0
  10. package/dist/contracts/abis/puf-locker-abis.d.ts +480 -0
  11. package/dist/contracts/abis/puf-token-abis.d.ts +680 -0
  12. package/dist/contracts/abis/puffer-depositor-abis.d.ts +355 -0
  13. package/dist/contracts/addresses.d.ts +2 -0
  14. package/dist/contracts/handlers/erc20-permit-handler.d.ts +13909 -0
  15. package/dist/contracts/handlers/puf-locker-handler.d.ts +33842 -0
  16. package/dist/contracts/handlers/puf-locker-handler.test.d.ts +1 -0
  17. package/dist/contracts/handlers/puf-token-handler.test.d.ts +1 -0
  18. package/dist/contracts/handlers/puffer-depositor-handler.d.ts +9866 -4
  19. package/dist/contracts/handlers/puffer-l2-depositor-handler.d.ts +21769 -0
  20. package/dist/contracts/handlers/puffer-l2-depositor-handler.test.d.ts +1 -0
  21. package/dist/contracts/tokens.d.ts +35 -1
  22. package/dist/main-BqWpl7pY.cjs +41 -0
  23. package/dist/main-BqWpl7pY.cjs.map +1 -0
  24. package/dist/{main-CjjW4BLK.js → main-DXvt8xU1.js} +4783 -2610
  25. package/dist/main-DXvt8xU1.js.map +1 -0
  26. package/dist/main.cjs +1 -1
  27. package/dist/main.d.ts +1 -0
  28. package/dist/main.js +8 -6
  29. package/package.json +1 -1
  30. package/dist/contracts/handlers/puffer-vault-handler.d.ts +0 -62
  31. package/dist/contracts/handlers/tokens-handler.d.ts +0 -46
  32. package/dist/main-C4aA8dQe.cjs +0 -41
  33. package/dist/main-C4aA8dQe.cjs.map +0 -1
  34. package/dist/main-CjjW4BLK.js.map +0 -1
  35. /package/dist/contracts/handlers/{tokens-handler.test.d.ts → erc20-permit-handler.test.d.ts} +0 -0
package/README.md CHANGED
@@ -44,7 +44,7 @@ const balance = await pufferClient.vault.balanceOf(walletAddress);
44
44
  - Deposit ETH to mint pufETH.
45
45
  - Deposit stETH to mint pufETH.
46
46
  - Check pufETH balance.
47
- - Get latest rate of pufETH compared to ETH.
47
+ - Get the latest rate of pufETH compared to ETH.
48
48
  - and much more.
49
49
 
50
50
  ## Documentation
@@ -2,6 +2,10 @@ import { PublicClient, WalletClient } from 'viem';
2
2
  import { Chain } from '../chains/constants';
3
3
  import { PufferVaultHandler } from '../contracts/handlers/puffer-vault-handler';
4
4
  import { PufferDepositorHandler } from '../contracts/handlers/puffer-depositor-handler';
5
+ import { PufTokenHandler } from '../contracts/handlers/puf-token-handler';
6
+ import { PufferL2DepositorHandler } from '../contracts/handlers/puffer-l2-depositor-handler';
7
+ import { ERC20PermitHandler } from '../contracts/handlers/erc20-permit-handler';
8
+ import { PufLockerHandler } from '../contracts/handlers/puf-locker-handler';
5
9
 
6
10
  /**
7
11
  * The core class and the main entry point of the Puffer SDK.
@@ -9,10 +13,18 @@ import { PufferDepositorHandler } from '../contracts/handlers/puffer-depositor-h
9
13
  export declare class PufferClient {
10
14
  private walletClient;
11
15
  private publicClient;
16
+ /** Handler for the `ERC20Permit` contract. */
17
+ erc20Permit: ERC20PermitHandler;
12
18
  /** Handler for the `PufferVaultV2` contract. */
13
19
  vault: PufferVaultHandler;
14
20
  /** Handler for the `PufferDepositor` contract. */
15
21
  depositor: PufferDepositorHandler;
22
+ /** Handler for the `PufferL2Depositor` contract. */
23
+ l2Depositor: PufferL2DepositorHandler;
24
+ /** Handler for the `PufToken` contract. */
25
+ pufToken: PufTokenHandler;
26
+ /** Handler for the `PufLocker` contract. */
27
+ pufLocker: PufLockerHandler;
16
28
  /**
17
29
  * Create the Puffer Client.
18
30
  *
@@ -1,4 +1,4 @@
1
- import { B as p, g as m, s as y, d as w, i as k, c as O, a as E, e as L, H as h, b as x } from "./main-CjjW4BLK.js";
1
+ import { B as p, g as m, s as y, d as w, i as k, c as O, a as E, e as L, H as h, b as x } from "./main-DXvt8xU1.js";
2
2
  class M extends p {
3
3
  constructor({ callbackSelector: s, cause: e, data: n, extraData: c, sender: u, urls: t }) {
4
4
  var i;
@@ -155,4 +155,4 @@ export {
155
155
  S as offchainLookupAbiItem,
156
156
  j as offchainLookupSignature
157
157
  };
158
- //# sourceMappingURL=ccip-BERTKE3h.js.map
158
+ //# sourceMappingURL=ccip-D9sqjqG8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ccip-BERTKE3h.js","sources":["../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":";AAGO,MAAMA,UAA4BC,E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,EAAS;AAAA,UAClB,QAAQA,EAAS;AAAA,UACjB,KAAA7B;AAAA,QACpB,CAAiB;AACD;AAAA,MACH;AACD,UAAI,CAAC+B,EAAM5B,CAAM,GAAG;AAChB,QAAAsB,IAAQ,IAAIvB,EAAqC;AAAA,UAC7C,QAAAC;AAAA,UACA,KAAAH;AAAA,QACpB,CAAiB;AACD;AAAA,MACH;AACD,aAAOG;AAAA,IACV,SACMqB,GAAK;AACR,MAAAC,IAAQ,IAAIK,EAAiB;AAAA,QACzB,MAAAF;AAAA,QACA,SAASJ,EAAI;AAAA,QACb,KAAAxB;AAAA,MAChB,CAAa;AAAA,IACJ;AAAA,EACJ;AACD,QAAMyB;AACV;","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"ccip-D9sqjqG8.js","sources":["../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":";AAGO,MAAMA,UAA4BC,EAAU;AAAA,EAC/C,YAAY,EAAE,kBAAAC,GAAkB,OAAAC,GAAO,MAAAC,GAAM,WAAAC,GAAW,QAAAC,GAAQ,MAAAC,KAAS;;AACrE,UAAMJ,EAAM,gBACR,4DAA4D;AAA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IvB,EAAqC;AAAA,UAC7C,QAAAC;AAAA,UACA,KAAAH;AAAA,QACpB,CAAiB;AACD;AAAA,MACH;AACD,aAAOG;AAAA,IACV,SACMqB,GAAK;AACR,MAAAC,IAAQ,IAAIK,EAAiB;AAAA,QACzB,MAAAF;AAAA,QACA,SAASJ,EAAI;AAAA,QACb,KAAAxB;AAAA,MAChB,CAAa;AAAA,IACJ;AAAA,EACJ;AACD,QAAMyB;AACV;","x_google_ignoreList":[0,1]}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-C4aA8dQe.cjs");class g extends e.BaseError{constructor({callbackSelector:o,cause:t,data:n,extraData:i,sender:f,urls:r}){var u;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(u=t.metaMessages)!=null&&u.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(l=>` ${e.getUrl(l)}`)],` Sender: ${f}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${i}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class w extends e.BaseError{constructor({result:o,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(t)}`,`Response: ${e.stringify(o)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class k extends e.BaseError{constructor({sender:o,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${o}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const O="0x556f1830",h={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(c,{blockNumber:o,blockTag:t,data:n,to:i}){const{args:f}=e.decodeErrorResult({data:n,abi:[h]}),[r,u,l,a,s]=f,{ccipRead:d}=c,y=d&&typeof(d==null?void 0:d.request)=="function"?d.request:m;try{if(!e.isAddressEqual(i,r))throw new k({sender:r,to:i});const p=await y({data:l,sender:r,urls:u}),{data:b}=await e.call(c,{blockNumber:o,blockTag:t,data:e.concat([a,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:i});return b}catch(p){throw new g({callbackSelector:a,cause:p,data:n,extraData:s,sender:r,urls:u})}}async function m({data:c,sender:o,urls:t}){var i;let n=new Error("An unknown error occurred.");for(let f=0;f<t.length;f++){const r=t[f],u=r.includes("{data}")?"GET":"POST",l=u==="POST"?{data:c,sender:o}:void 0;try{const a=await fetch(r.replace("{sender}",o).replace("{data}",c),{body:JSON.stringify(l),method:u});let s;if((i=a.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await a.json()).data:s=await a.text(),!a.ok){n=new e.HttpRequestError({body:l,details:s!=null&&s.error?e.stringify(s.error):a.statusText,headers:a.headers,status:a.status,url:r});continue}if(!e.isHex(s)){n=new w({result:s,url:r});continue}return s}catch(a){n=new e.HttpRequestError({body:l,details:a.message,url:r})}}throw n}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=O;
2
- //# sourceMappingURL=ccip-CsTi3xD2.cjs.map
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BqWpl7pY.cjs");class g extends e.BaseError{constructor({callbackSelector:o,cause:t,data:n,extraData:i,sender:f,urls:r}){var u;super(t.shortMessage||"An error occurred while fetching for an offchain result.",{cause:t,metaMessages:[...t.metaMessages||[],(u=t.metaMessages)!=null&&u.length?"":[],"Offchain Gateway Call:",r&&[" Gateway URL(s):",...r.map(l=>` ${e.getUrl(l)}`)],` Sender: ${f}`,` Data: ${n}`,` Callback selector: ${o}`,` Extra data: ${i}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class w extends e.BaseError{constructor({result:o,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${e.getUrl(t)}`,`Response: ${e.stringify(o)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class k extends e.BaseError{constructor({sender:o,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${o}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}const O="0x556f1830",h={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function E(c,{blockNumber:o,blockTag:t,data:n,to:i}){const{args:f}=e.decodeErrorResult({data:n,abi:[h]}),[r,u,l,a,s]=f,{ccipRead:d}=c,y=d&&typeof(d==null?void 0:d.request)=="function"?d.request:m;try{if(!e.isAddressEqual(i,r))throw new k({sender:r,to:i});const p=await y({data:l,sender:r,urls:u}),{data:b}=await e.call(c,{blockNumber:o,blockTag:t,data:e.concat([a,e.encodeAbiParameters([{type:"bytes"},{type:"bytes"}],[p,s])]),to:i});return b}catch(p){throw new g({callbackSelector:a,cause:p,data:n,extraData:s,sender:r,urls:u})}}async function m({data:c,sender:o,urls:t}){var i;let n=new Error("An unknown error occurred.");for(let f=0;f<t.length;f++){const r=t[f],u=r.includes("{data}")?"GET":"POST",l=u==="POST"?{data:c,sender:o}:void 0;try{const a=await fetch(r.replace("{sender}",o).replace("{data}",c),{body:JSON.stringify(l),method:u});let s;if((i=a.headers.get("Content-Type"))!=null&&i.startsWith("application/json")?s=(await a.json()).data:s=await a.text(),!a.ok){n=new e.HttpRequestError({body:l,details:s!=null&&s.error?e.stringify(s.error):a.statusText,headers:a.headers,status:a.status,url:r});continue}if(!e.isHex(s)){n=new w({result:s,url:r});continue}return s}catch(a){n=new e.HttpRequestError({body:l,details:a.message,url:r})}}throw n}exports.ccipRequest=m;exports.offchainLookup=E;exports.offchainLookupAbiItem=h;exports.offchainLookupSignature=O;
2
+ //# sourceMappingURL=ccip-x56ET8k8.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ccip-CsTi3xD2.cjs","sources":["../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"uHAGO,MAAMA,UAA4BC,EAAAA,SAAU,CAC/C,YAAY,CAAE,iBAAAC,EAAkB,MAAAC,EAAO,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,KAAAC,GAAS,OACrE,MAAMJ,EAAM,cACR,2DAA4D,CAC5D,MAAAA,EACA,aAAc,CACV,GAAIA,EAAM,cAAgB,CAAE,GAC5BK,EAAAL,EAAM,eAAN,MAAAK,EAAoB,OAAS,GAAK,CAAE,EACpC,yBACAD,GAAQ,CACJ,oBACA,GAAGA,EAAK,IAAKE,GAAQ,OAAOC,EAAM,OAACD,CAA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,KAAM,KAAK,UAAUiC,CAAI,EACzB,OAAAD,CAChB,CAAa,EACD,IAAIxB,EAOJ,IANIJ,EAAA8B,EAAS,QAAQ,IAAI,cAAc,IAAnC,MAAA9B,EAAsC,WAAW,oBACjDI,GAAU,MAAM0B,EAAS,KAAI,GAAI,KAGjC1B,EAAU,MAAM0B,EAAS,KAAI,EAE7B,CAACA,EAAS,GAAI,CACdJ,EAAQ,IAAIK,EAAAA,iBAAiB,CACzB,KAAAF,EACA,QAASzB,GAAA,MAAAA,EAAQ,MACXC,EAAS,UAACD,EAAO,KAAK,EACtB0B,EAAS,WACf,QAASA,EAAS,QAClB,OAAQA,EAAS,OACjB,IAAA7B,CACpB,CAAiB,EACD,QACH,CACD,GAAI,CAAC+B,EAAAA,MAAM5B,CAAM,EAAG,CAChBsB,EAAQ,IAAIvB,EAAqC,CAC7C,OAAAC,EACA,IAAAH,CACpB,CAAiB,EACD,QACH,CACD,OAAOG,CACV,OACMqB,EAAK,CACRC,EAAQ,IAAIK,EAAAA,iBAAiB,CACzB,KAAAF,EACA,QAASJ,EAAI,QACb,IAAAxB,CAChB,CAAa,CACJ,CACJ,CACD,MAAMyB,CACV","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"ccip-x56ET8k8.cjs","sources":["../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/errors/ccip.js","../node_modules/.pnpm/viem@2.14.0_typescript@5.4.5_zod@3.23.8/node_modules/viem/_esm/utils/ccip.js"],"sourcesContent":["import { stringify } from '../utils/stringify.js';\nimport { BaseError } from './base.js';\nimport { getUrl } from './utils.js';\nexport class OffchainLookupError extends BaseError {\n constructor({ callbackSelector, cause, data, extraData, sender, urls, }) {\n super(cause.shortMessage ||\n 'An error occurred while fetching for an offchain result.', {\n cause,\n metaMessages: [\n ...(cause.metaMessages || []),\n cause.metaMessages?.length ? '' : [],\n 'Offchain Gateway Call:',\n urls && [\n ' Gateway URL(s):',\n ...urls.map((url) => ` ${getUrl(url)}`),\n ],\n ` Sender: ${sender}`,\n ` Data: ${data}`,\n ` Callback selector: ${callbackSelector}`,\n ` Extra data: ${extraData}`,\n ].flat(),\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupError'\n });\n }\n}\nexport class OffchainLookupResponseMalformedError extends BaseError {\n constructor({ result, url }) {\n super('Offchain gateway response is malformed. Response data must be a hex value.', {\n metaMessages: [\n `Gateway URL: ${getUrl(url)}`,\n `Response: ${stringify(result)}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupResponseMalformedError'\n });\n }\n}\nexport class OffchainLookupSenderMismatchError extends BaseError {\n constructor({ sender, to }) {\n super('Reverted sender address does not match target contract address (`to`).', {\n metaMessages: [\n `Contract address: ${to}`,\n `OffchainLookup sender address: ${sender}`,\n ],\n });\n Object.defineProperty(this, \"name\", {\n enumerable: true,\n configurable: true,\n writable: true,\n value: 'OffchainLookupSenderMismatchError'\n });\n }\n}\n//# sourceMappingURL=ccip.js.map","import { call } from '../actions/public/call.js';\nimport { OffchainLookupError, OffchainLookupResponseMalformedError, OffchainLookupSenderMismatchError, } from '../errors/ccip.js';\nimport { HttpRequestError, } from '../errors/request.js';\nimport { decodeErrorResult } from './abi/decodeErrorResult.js';\nimport { encodeAbiParameters } from './abi/encodeAbiParameters.js';\nimport { isAddressEqual } from './address/isAddressEqual.js';\nimport { concat } from './data/concat.js';\nimport { isHex } from './data/isHex.js';\nimport { stringify } from './stringify.js';\nexport const offchainLookupSignature = '0x556f1830';\nexport const offchainLookupAbiItem = {\n name: 'OffchainLookup',\n type: 'error',\n inputs: [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'urls',\n type: 'string[]',\n },\n {\n name: 'callData',\n type: 'bytes',\n },\n {\n name: 'callbackFunction',\n type: 'bytes4',\n },\n {\n name: 'extraData',\n type: 'bytes',\n },\n ],\n};\nexport async function offchainLookup(client, { blockNumber, blockTag, data, to, }) {\n const { args } = decodeErrorResult({\n data,\n abi: [offchainLookupAbiItem],\n });\n const [sender, urls, callData, callbackSelector, extraData] = args;\n const { ccipRead } = client;\n const ccipRequest_ = ccipRead && typeof ccipRead?.request === 'function'\n ? ccipRead.request\n : ccipRequest;\n try {\n if (!isAddressEqual(to, sender))\n throw new OffchainLookupSenderMismatchError({ sender, to });\n const result = await ccipRequest_({ data: callData, sender, urls });\n const { data: data_ } = await call(client, {\n blockNumber,\n blockTag,\n data: concat([\n callbackSelector,\n encodeAbiParameters([{ type: 'bytes' }, { type: 'bytes' }], [result, extraData]),\n ]),\n to,\n });\n return data_;\n }\n catch (err) {\n throw new OffchainLookupError({\n callbackSelector,\n cause: err,\n data,\n extraData,\n sender,\n urls,\n });\n }\n}\nexport async function ccipRequest({ data, sender, urls, }) {\n let error = new Error('An unknown error occurred.');\n for (let i = 0; i < urls.length; i++) {\n const url = urls[i];\n const method = url.includes('{data}') ? 'GET' : 'POST';\n const body = method === 'POST' ? { data, sender } : undefined;\n try {\n const response = await fetch(url.replace('{sender}', sender).replace('{data}', data), {\n body: JSON.stringify(body),\n method,\n });\n let result;\n if (response.headers.get('Content-Type')?.startsWith('application/json')) {\n result = (await response.json()).data;\n }\n else {\n result = (await response.text());\n }\n if (!response.ok) {\n error = new HttpRequestError({\n body,\n details: result?.error\n ? stringify(result.error)\n : response.statusText,\n headers: response.headers,\n status: response.status,\n url,\n });\n continue;\n }\n if (!isHex(result)) {\n error = new OffchainLookupResponseMalformedError({\n result,\n url,\n });\n continue;\n }\n return result;\n }\n catch (err) {\n error = new HttpRequestError({\n body,\n details: err.message,\n url,\n });\n }\n }\n throw error;\n}\n//# sourceMappingURL=ccip.js.map"],"names":["OffchainLookupError","BaseError","callbackSelector","cause","data","extraData","sender","urls","_a","url","getUrl","OffchainLookupResponseMalformedError","result","stringify","OffchainLookupSenderMismatchError","to","offchainLookupSignature","offchainLookupAbiItem","offchainLookup","client","blockNumber","blockTag","args","decodeErrorResult","callData","ccipRead","ccipRequest_","ccipRequest","isAddressEqual","data_","call","concat","encodeAbiParameters","err","error","i","method","body","response","HttpRequestError","isHex"],"mappings":"uHAGO,MAAMA,UAA4BC,EAAAA,SAAU,CAC/C,YAAY,CAAE,iBAAAC,EAAkB,MAAAC,EAAO,KAAAC,EAAM,UAAAC,EAAW,OAAAC,EAAQ,KAAAC,GAAS,OACrE,MAAMJ,EAAM,cACR,2DAA4D,CAC5D,MAAAA,EACA,aAAc,CACV,GAAIA,EAAM,cAAgB,CAAE,GAC5BK,EAAAL,EAAM,eAAN,MAAAK,EAAoB,OAAS,GAAK,CAAE,EACpC,yBACAD,GAAQ,CACJ,oBACA,GAAGA,EAAK,IAAKE,GAAQ,OAAOC,EAAM,OAACD,CAAG,CAAC,EAAE,CAC5C,EACD,aAAaH,CAAM,GACnB,WAAWF,CAAI,GACf,wBAAwBF,CAAgB,GACxC,iBAAiBG,CAAS,EAC7B,EAAC,KAAM,CACpB,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,qBACnB,CAAS,CACJ,CACL,CACO,MAAMM,UAA6CV,EAAAA,SAAU,CAChE,YAAY,CAAE,OAAAW,EAAQ,IAAAH,GAAO,CACzB,MAAM,6EAA8E,CAChF,aAAc,CACV,gBAAgBC,EAAAA,OAAOD,CAAG,CAAC,GAC3B,aAAaI,EAAAA,UAAUD,CAAM,CAAC,EACjC,CACb,CAAS,EACD,OAAO,eAAe,KAAM,OAAQ,CAChC,WAAY,GACZ,aAAc,GACd,SAAU,GACV,MAAO,sCACnB,CAAS,CACJ,CACL,CACO,MAAME,UAA0Cb,EAAAA,SAAU,CAC7D,YAAY,CAAE,OAAAK,EAAQ,GAAAS,GAAM,CACxB,MAAM,yEAA0E,CAC5E,aAAc,CACV,qBAAqBA,CAAE,GACvB,kCAAkCT,CAAM,EAC3C,CACb,CAAS,EACD,OAAO,eAAe,KAAM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0,1]}
@@ -0,0 +1,476 @@
1
+ export declare const PufLocker: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly stateMutability: "nonpayable";
4
+ readonly type: "constructor";
5
+ }, {
6
+ readonly inputs: readonly [{
7
+ readonly internalType: "address";
8
+ readonly name: "authority";
9
+ readonly type: "address";
10
+ }];
11
+ readonly name: "AccessManagedInvalidAuthority";
12
+ readonly type: "error";
13
+ }, {
14
+ readonly inputs: readonly [{
15
+ readonly internalType: "address";
16
+ readonly name: "caller";
17
+ readonly type: "address";
18
+ }, {
19
+ readonly internalType: "uint32";
20
+ readonly name: "delay";
21
+ readonly type: "uint32";
22
+ }];
23
+ readonly name: "AccessManagedRequiredDelay";
24
+ readonly type: "error";
25
+ }, {
26
+ readonly inputs: readonly [{
27
+ readonly internalType: "address";
28
+ readonly name: "caller";
29
+ readonly type: "address";
30
+ }];
31
+ readonly name: "AccessManagedUnauthorized";
32
+ readonly type: "error";
33
+ }, {
34
+ readonly inputs: readonly [{
35
+ readonly internalType: "address";
36
+ readonly name: "target";
37
+ readonly type: "address";
38
+ }];
39
+ readonly name: "AddressEmptyCode";
40
+ readonly type: "error";
41
+ }, {
42
+ readonly inputs: readonly [{
43
+ readonly internalType: "address";
44
+ readonly name: "account";
45
+ readonly type: "address";
46
+ }];
47
+ readonly name: "AddressInsufficientBalance";
48
+ readonly type: "error";
49
+ }, {
50
+ readonly inputs: readonly [];
51
+ readonly name: "DepositLocked";
52
+ readonly type: "error";
53
+ }, {
54
+ readonly inputs: readonly [{
55
+ readonly internalType: "address";
56
+ readonly name: "implementation";
57
+ readonly type: "address";
58
+ }];
59
+ readonly name: "ERC1967InvalidImplementation";
60
+ readonly type: "error";
61
+ }, {
62
+ readonly inputs: readonly [];
63
+ readonly name: "ERC1967NonPayable";
64
+ readonly type: "error";
65
+ }, {
66
+ readonly inputs: readonly [];
67
+ readonly name: "FailedInnerCall";
68
+ readonly type: "error";
69
+ }, {
70
+ readonly inputs: readonly [];
71
+ readonly name: "InvalidAmount";
72
+ readonly type: "error";
73
+ }, {
74
+ readonly inputs: readonly [];
75
+ readonly name: "InvalidDepositIndex";
76
+ readonly type: "error";
77
+ }, {
78
+ readonly inputs: readonly [];
79
+ readonly name: "InvalidInitialization";
80
+ readonly type: "error";
81
+ }, {
82
+ readonly inputs: readonly [];
83
+ readonly name: "InvalidLockPeriod";
84
+ readonly type: "error";
85
+ }, {
86
+ readonly inputs: readonly [];
87
+ readonly name: "InvalidRecipientAddress";
88
+ readonly type: "error";
89
+ }, {
90
+ readonly inputs: readonly [];
91
+ readonly name: "NoWithdrawableAmount";
92
+ readonly type: "error";
93
+ }, {
94
+ readonly inputs: readonly [];
95
+ readonly name: "NotInitializing";
96
+ readonly type: "error";
97
+ }, {
98
+ readonly inputs: readonly [{
99
+ readonly internalType: "address";
100
+ readonly name: "token";
101
+ readonly type: "address";
102
+ }];
103
+ readonly name: "SafeERC20FailedOperation";
104
+ readonly type: "error";
105
+ }, {
106
+ readonly inputs: readonly [];
107
+ readonly name: "TokenNotAllowed";
108
+ readonly type: "error";
109
+ }, {
110
+ readonly inputs: readonly [];
111
+ readonly name: "UUPSUnauthorizedCallContext";
112
+ readonly type: "error";
113
+ }, {
114
+ readonly inputs: readonly [{
115
+ readonly internalType: "bytes32";
116
+ readonly name: "slot";
117
+ readonly type: "bytes32";
118
+ }];
119
+ readonly name: "UUPSUnsupportedProxiableUUID";
120
+ readonly type: "error";
121
+ }, {
122
+ readonly anonymous: false;
123
+ readonly inputs: readonly [{
124
+ readonly indexed: false;
125
+ readonly internalType: "address";
126
+ readonly name: "authority";
127
+ readonly type: "address";
128
+ }];
129
+ readonly name: "AuthorityUpdated";
130
+ readonly type: "event";
131
+ }, {
132
+ readonly anonymous: false;
133
+ readonly inputs: readonly [{
134
+ readonly indexed: true;
135
+ readonly internalType: "address";
136
+ readonly name: "user";
137
+ readonly type: "address";
138
+ }, {
139
+ readonly indexed: true;
140
+ readonly internalType: "address";
141
+ readonly name: "token";
142
+ readonly type: "address";
143
+ }, {
144
+ readonly indexed: false;
145
+ readonly internalType: "uint128";
146
+ readonly name: "amount";
147
+ readonly type: "uint128";
148
+ }, {
149
+ readonly indexed: false;
150
+ readonly internalType: "uint128";
151
+ readonly name: "releaseTime";
152
+ readonly type: "uint128";
153
+ }];
154
+ readonly name: "Deposited";
155
+ readonly type: "event";
156
+ }, {
157
+ readonly anonymous: false;
158
+ readonly inputs: readonly [{
159
+ readonly indexed: false;
160
+ readonly internalType: "uint64";
161
+ readonly name: "version";
162
+ readonly type: "uint64";
163
+ }];
164
+ readonly name: "Initialized";
165
+ readonly type: "event";
166
+ }, {
167
+ readonly anonymous: false;
168
+ readonly inputs: readonly [{
169
+ readonly indexed: false;
170
+ readonly internalType: "uint128";
171
+ readonly name: "previousMinLock";
172
+ readonly type: "uint128";
173
+ }, {
174
+ readonly indexed: false;
175
+ readonly internalType: "uint128";
176
+ readonly name: "newMinLock";
177
+ readonly type: "uint128";
178
+ }, {
179
+ readonly indexed: false;
180
+ readonly internalType: "uint128";
181
+ readonly name: "previousMaxLock";
182
+ readonly type: "uint128";
183
+ }, {
184
+ readonly indexed: false;
185
+ readonly internalType: "uint128";
186
+ readonly name: "newMaxLock";
187
+ readonly type: "uint128";
188
+ }];
189
+ readonly name: "LockPeriodsChanged";
190
+ readonly type: "event";
191
+ }, {
192
+ readonly anonymous: false;
193
+ readonly inputs: readonly [{
194
+ readonly indexed: true;
195
+ readonly internalType: "address";
196
+ readonly name: "token";
197
+ readonly type: "address";
198
+ }, {
199
+ readonly indexed: false;
200
+ readonly internalType: "bool";
201
+ readonly name: "allowed";
202
+ readonly type: "bool";
203
+ }];
204
+ readonly name: "SetTokenIsAllowed";
205
+ readonly type: "event";
206
+ }, {
207
+ readonly anonymous: false;
208
+ readonly inputs: readonly [{
209
+ readonly indexed: true;
210
+ readonly internalType: "address";
211
+ readonly name: "implementation";
212
+ readonly type: "address";
213
+ }];
214
+ readonly name: "Upgraded";
215
+ readonly type: "event";
216
+ }, {
217
+ readonly anonymous: false;
218
+ readonly inputs: readonly [{
219
+ readonly indexed: true;
220
+ readonly internalType: "address";
221
+ readonly name: "user";
222
+ readonly type: "address";
223
+ }, {
224
+ readonly indexed: true;
225
+ readonly internalType: "address";
226
+ readonly name: "token";
227
+ readonly type: "address";
228
+ }, {
229
+ readonly indexed: false;
230
+ readonly internalType: "uint128";
231
+ readonly name: "amount";
232
+ readonly type: "uint128";
233
+ }, {
234
+ readonly indexed: true;
235
+ readonly internalType: "address";
236
+ readonly name: "recipient";
237
+ readonly type: "address";
238
+ }];
239
+ readonly name: "Withdrawn";
240
+ readonly type: "event";
241
+ }, {
242
+ readonly inputs: readonly [];
243
+ readonly name: "UPGRADE_INTERFACE_VERSION";
244
+ readonly outputs: readonly [{
245
+ readonly internalType: "string";
246
+ readonly name: "";
247
+ readonly type: "string";
248
+ }];
249
+ readonly stateMutability: "view";
250
+ readonly type: "function";
251
+ }, {
252
+ readonly inputs: readonly [];
253
+ readonly name: "authority";
254
+ readonly outputs: readonly [{
255
+ readonly internalType: "address";
256
+ readonly name: "";
257
+ readonly type: "address";
258
+ }];
259
+ readonly stateMutability: "view";
260
+ readonly type: "function";
261
+ }, {
262
+ readonly inputs: readonly [{
263
+ readonly internalType: "address";
264
+ readonly name: "token";
265
+ readonly type: "address";
266
+ }, {
267
+ readonly internalType: "uint128";
268
+ readonly name: "lockPeriod";
269
+ readonly type: "uint128";
270
+ }, {
271
+ readonly components: readonly [{
272
+ readonly internalType: "uint256";
273
+ readonly name: "deadline";
274
+ readonly type: "uint256";
275
+ }, {
276
+ readonly internalType: "uint256";
277
+ readonly name: "amount";
278
+ readonly type: "uint256";
279
+ }, {
280
+ readonly internalType: "uint8";
281
+ readonly name: "v";
282
+ readonly type: "uint8";
283
+ }, {
284
+ readonly internalType: "bytes32";
285
+ readonly name: "r";
286
+ readonly type: "bytes32";
287
+ }, {
288
+ readonly internalType: "bytes32";
289
+ readonly name: "s";
290
+ readonly type: "bytes32";
291
+ }];
292
+ readonly internalType: "struct Permit";
293
+ readonly name: "permitData";
294
+ readonly type: "tuple";
295
+ }];
296
+ readonly name: "deposit";
297
+ readonly outputs: readonly [];
298
+ readonly stateMutability: "nonpayable";
299
+ readonly type: "function";
300
+ }, {
301
+ readonly inputs: readonly [{
302
+ readonly internalType: "address";
303
+ readonly name: "token";
304
+ readonly type: "address";
305
+ }, {
306
+ readonly internalType: "address";
307
+ readonly name: "depositor";
308
+ readonly type: "address";
309
+ }];
310
+ readonly name: "getAllDeposits";
311
+ readonly outputs: readonly [{
312
+ readonly components: readonly [{
313
+ readonly internalType: "uint128";
314
+ readonly name: "amount";
315
+ readonly type: "uint128";
316
+ }, {
317
+ readonly internalType: "uint128";
318
+ readonly name: "releaseTime";
319
+ readonly type: "uint128";
320
+ }];
321
+ readonly internalType: "struct IPufLocker.Deposit[]";
322
+ readonly name: "";
323
+ readonly type: "tuple[]";
324
+ }];
325
+ readonly stateMutability: "view";
326
+ readonly type: "function";
327
+ }, {
328
+ readonly inputs: readonly [{
329
+ readonly internalType: "address";
330
+ readonly name: "user";
331
+ readonly type: "address";
332
+ }, {
333
+ readonly internalType: "address";
334
+ readonly name: "token";
335
+ readonly type: "address";
336
+ }, {
337
+ readonly internalType: "uint256";
338
+ readonly name: "start";
339
+ readonly type: "uint256";
340
+ }, {
341
+ readonly internalType: "uint256";
342
+ readonly name: "limit";
343
+ readonly type: "uint256";
344
+ }];
345
+ readonly name: "getDeposits";
346
+ readonly outputs: readonly [{
347
+ readonly components: readonly [{
348
+ readonly internalType: "uint128";
349
+ readonly name: "amount";
350
+ readonly type: "uint128";
351
+ }, {
352
+ readonly internalType: "uint128";
353
+ readonly name: "releaseTime";
354
+ readonly type: "uint128";
355
+ }];
356
+ readonly internalType: "struct IPufLocker.Deposit[]";
357
+ readonly name: "";
358
+ readonly type: "tuple[]";
359
+ }];
360
+ readonly stateMutability: "view";
361
+ readonly type: "function";
362
+ }, {
363
+ readonly inputs: readonly [];
364
+ readonly name: "getLockPeriods";
365
+ readonly outputs: readonly [{
366
+ readonly internalType: "uint128";
367
+ readonly name: "";
368
+ readonly type: "uint128";
369
+ }, {
370
+ readonly internalType: "uint128";
371
+ readonly name: "";
372
+ readonly type: "uint128";
373
+ }];
374
+ readonly stateMutability: "view";
375
+ readonly type: "function";
376
+ }, {
377
+ readonly inputs: readonly [{
378
+ readonly internalType: "address";
379
+ readonly name: "accessManager";
380
+ readonly type: "address";
381
+ }];
382
+ readonly name: "initialize";
383
+ readonly outputs: readonly [];
384
+ readonly stateMutability: "nonpayable";
385
+ readonly type: "function";
386
+ }, {
387
+ readonly inputs: readonly [];
388
+ readonly name: "isConsumingScheduledOp";
389
+ readonly outputs: readonly [{
390
+ readonly internalType: "bytes4";
391
+ readonly name: "";
392
+ readonly type: "bytes4";
393
+ }];
394
+ readonly stateMutability: "view";
395
+ readonly type: "function";
396
+ }, {
397
+ readonly inputs: readonly [];
398
+ readonly name: "proxiableUUID";
399
+ readonly outputs: readonly [{
400
+ readonly internalType: "bytes32";
401
+ readonly name: "";
402
+ readonly type: "bytes32";
403
+ }];
404
+ readonly stateMutability: "view";
405
+ readonly type: "function";
406
+ }, {
407
+ readonly inputs: readonly [{
408
+ readonly internalType: "address";
409
+ readonly name: "newAuthority";
410
+ readonly type: "address";
411
+ }];
412
+ readonly name: "setAuthority";
413
+ readonly outputs: readonly [];
414
+ readonly stateMutability: "nonpayable";
415
+ readonly type: "function";
416
+ }, {
417
+ readonly inputs: readonly [{
418
+ readonly internalType: "address";
419
+ readonly name: "token";
420
+ readonly type: "address";
421
+ }, {
422
+ readonly internalType: "bool";
423
+ readonly name: "allowed";
424
+ readonly type: "bool";
425
+ }];
426
+ readonly name: "setIsAllowedToken";
427
+ readonly outputs: readonly [];
428
+ readonly stateMutability: "nonpayable";
429
+ readonly type: "function";
430
+ }, {
431
+ readonly inputs: readonly [{
432
+ readonly internalType: "uint128";
433
+ readonly name: "minLock";
434
+ readonly type: "uint128";
435
+ }, {
436
+ readonly internalType: "uint128";
437
+ readonly name: "maxLock";
438
+ readonly type: "uint128";
439
+ }];
440
+ readonly name: "setLockPeriods";
441
+ readonly outputs: readonly [];
442
+ readonly stateMutability: "nonpayable";
443
+ readonly type: "function";
444
+ }, {
445
+ readonly inputs: readonly [{
446
+ readonly internalType: "address";
447
+ readonly name: "newImplementation";
448
+ readonly type: "address";
449
+ }, {
450
+ readonly internalType: "bytes";
451
+ readonly name: "data";
452
+ readonly type: "bytes";
453
+ }];
454
+ readonly name: "upgradeToAndCall";
455
+ readonly outputs: readonly [];
456
+ readonly stateMutability: "payable";
457
+ readonly type: "function";
458
+ }, {
459
+ readonly inputs: readonly [{
460
+ readonly internalType: "address";
461
+ readonly name: "token";
462
+ readonly type: "address";
463
+ }, {
464
+ readonly internalType: "uint256[]";
465
+ readonly name: "depositIndexes";
466
+ readonly type: "uint256[]";
467
+ }, {
468
+ readonly internalType: "address";
469
+ readonly name: "recipient";
470
+ readonly type: "address";
471
+ }];
472
+ readonly name: "withdraw";
473
+ readonly outputs: readonly [];
474
+ readonly stateMutability: "nonpayable";
475
+ readonly type: "function";
476
+ }];