keyring-chatbot-agent-sdk-test 0.0.14 → 0.0.16
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/README.md +334 -296
- package/dist/chat-widget.es.js +226 -210
- package/dist/chat-widget.umd.js +19 -19
- package/package.json +1 -1
package/dist/chat-widget.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet{font-size:14px;font-weight:500;color:#1a1a1d}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}.message:hover .message-reply-button{opacity:1}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header label{margin-bottom:0}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".chat-button{cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000026;transition:all .3s ease;border-radius:16px}.chat-button:hover{transform:scale(1.1);box-shadow:0 6px 16px #0003}.chat-button:active{transform:scale(.95)}.chat-modal-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:transparent;display:flex;align-items:flex-end;justify-content:flex-end;z-index:9999;pointer-events:all;animation:fadeIn .2s ease}.chat-modal-overlay.chat-modal-overlay--left{justify-content:flex-start}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chat-modal{width:90%;max-width:480px;height:700px;max-height:calc(100dvh - 64px);background:#f5f5f7;border-radius:14px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 20px 60px #0000004d;margin:20px;pointer-events:all;animation:slideUp .3s ease}@keyframes slideUp{0%{transform:translateY(30px);opacity:0}to{transform:translateY(0);opacity:1}}.chat-modal-header{background:#fff;padding:16px 20px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid #e5e5e7}.chat-modal-header-left{display:flex;align-items:center;gap:12px}.keyring-logo{width:32px;height:32px}.chat-modal-header h3{margin:0;font-size:18px;font-weight:700;color:#1a1a1d}.close-button{background:transparent;border:none;cursor:pointer;padding:8px;border-radius:8px;color:#666;transition:all .2s}.close-button:hover{background:#f5f5f7;color:#000}.chat-user-info{background:#fff;padding:12px 20px;display:flex;align-items:center;gap:10px;border-bottom:1px solid #e5e5e7}.user-avatar{width:20px;height:20px;border-radius:50%}.user-avatar img{border-radius:50%}.user-wallet,.user-wallet a{font-size:14px;font-weight:500;color:#1a1a1d}.copy-address-btn{display:flex;align-items:center;justify-content:center;background:none;border:none;cursor:pointer;padding:3px;color:#999;border-radius:4px;transition:color .15s,background .15s;line-height:0}@media(min-width:640px){.copy-address-btn:hover{color:#1a1a1d;background:#f0f0f0}}.chat-modal-messages-wrapper{position:relative;flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-modal-messages{flex:1;padding:20px;overflow-y:auto;display:flex;flex-direction:column;gap:12px}.date-separator{text-align:center;font-size:12px;font-weight:600;color:#666;background:#e5e5e7;padding:6px 16px;border-radius:12px;align-self:center;width:fit-content;margin:8px auto}.message{display:flex;animation:messageSlide .3s ease;position:relative}.message:hover .message-reply-button{opacity:1}@keyframes messageSlide{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.message-reply-button{position:absolute;top:50%;transform:translateY(-50%);background:#fff;border:1px solid #e5e5e7;border-radius:8px;padding:6px;cursor:pointer;opacity:0;transition:all .2s;box-shadow:0 2px 8px #0000001a;z-index:10}.message-bot .message-reply-button{right:20px}.message-user .message-reply-button{left:20px}.message-reply-button:hover{background:#f5f5f7;transform:translateY(-50%) scale(1.1)}.message-reply-button svg{display:block;width:16px;height:16px;color:#666}.message-bot{justify-content:flex-start}.message-user{justify-content:flex-end}.message-bubble{max-width:85%;padding:14px 16px;border-radius:20px}.message-bot .message-bubble{background:#fff;box-shadow:0 2px 8px #0000000f;border-bottom-left-radius:4px}.message-user .message-bubble{background:#5b7fff;color:#fff;border-bottom-right-radius:4px}.message-reply-to{background:#0000000d;padding:8px 12px;border-radius:6px;margin-bottom:8px;border-left:3px solid #5b7fff}.message-bot .message-reply-to{background:#f5f5f7}.message-user .message-reply-to{background:#ffffff26;border-left-color:#ffffff80}.message-reply-to-label{font-size:11px;font-weight:600;margin-bottom:4px}.message-bot .message-reply-to-label{color:#5b7fff}.message-user .message-reply-to-label{color:#ffffffe6}.message-reply-to-text{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-text{font-size:14px;line-height:1.5;margin-bottom:6px;word-wrap:break-word;white-space:pre-line}.message-bot .message-text{color:#1a1a1d}.message-user .message-text{color:#fff}.message-buttons{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px;margin-bottom:8px}.message-button{flex:1 1 calc(50% - 4px);min-width:100px;padding:10px 16px;background:#fffffff2;border:1px solid #e0e0e0;border-radius:12px;font-size:13px;font-weight:500;color:#1a1a1d;cursor:pointer;transition:all .2s ease;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.message-button.full-width{flex:1 1 100%;text-align:center;white-space:normal;padding:12px 16px;font-size:14px}@media(min-width:640px){.message-button:hover{background:#fff;border-color:#007aff;color:#007aff;transform:translateY(-1px);box-shadow:0 2px 8px #007aff26}.message-button:active{transform:translateY(0);box-shadow:0 1px 4px #007aff1a}}.message-user .message-button{background:#fff3;border-color:#ffffff4d;color:#fff}.message-user .message-button:hover{background:#ffffff4d;border-color:#ffffff80}.message-timestamp{font-size:11px;color:#999;display:flex;align-items:center;gap:4px;justify-content:flex-end}.message-user .message-timestamp{color:#ffffffb3}.check-icon{width:14px;height:14px}.typing-indicator .message-bubble{padding:12px 18px;display:flex;gap:6px;min-width:60px}.typing-dot{width:8px;height:8px;border-radius:50%;background:#999;animation:typingDot 1.4s infinite ease-in-out}.typing-dot:nth-child(1){animation-delay:0s}.typing-dot:nth-child(2){animation-delay:.2s}.typing-dot:nth-child(3){animation-delay:.4s}@keyframes typingDot{0%,60%,to{transform:translateY(0);opacity:.7}30%{transform:translateY(-8px);opacity:1}}.suggestions-container{display:flex;flex-direction:column;gap:10px;margin-top:8px}.suggestion-button{background:#d4d8f0;border:none;padding:12px 16px;border-radius:16px;display:flex;gap:12px;cursor:pointer;transition:all .2s;font-size:14px;font-weight:500;color:#1a1a1d;width:100%;text-align:center;align-items:center;justify-content:center}.suggestion-button:hover{background:#c5caeb;transform:translateY(-1px)}.suggestion-icon{font-size:18px}.chat-modal-input{padding:16px 20px;background:#fff;border-top:1px solid #e5e5e7;display:flex;flex-direction:column;gap:12px;box-shadow:0 -5px 8px 4px #0000000d}.reply-preview{background:#f5f5f7;padding:10px 14px;border-radius:6px;border-left:3px solid #5b7fff;display:flex;justify-content:space-between;align-items:flex-start;gap:10px}.reply-preview-content{flex:1;min-width:0}.reply-preview-label{font-size:11px;color:#5b7fff;font-weight:600;margin-bottom:4px}.reply-preview-text{font-size:13px;color:#666;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.reply-preview-close{background:transparent;border:none;cursor:pointer;padding:2px;color:#999;transition:color .2s;flex-shrink:0}.reply-preview-close:hover{color:#666}.chat-modal-input-row{display:flex;gap:12px;align-items:center}.chat-modal-input input{flex:1;padding:14px 18px;border:1px solid #e5e5e7;border-radius:24px;outline:none;font-size:16px;color:#1a1a1d;transition:all .2s}.chat-modal-input input::placeholder{color:#999}.chat-modal-input input:focus{border-color:#5b7fff;box-shadow:0 0 0 3px #5b7fff1a}.chat-modal-input input:disabled{opacity:.6;cursor:not-allowed;background:#f5f5f7}.send-button{width:44px;height:44px;border-radius:50%;background:#5b7fff;border:none;color:#fff;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:all .2s}.send-button:hover:not(:disabled){background:#4a6fee;transform:scale(1.05)}.send-button:disabled{opacity:.4;cursor:not-allowed}.chat-modal-messages::-webkit-scrollbar{width:6px}.chat-modal-messages::-webkit-scrollbar-thumb{background:#d1d1d6;border-radius:3px}@media(max-width:640px){.chat-modal{width:100%;height:100dvh;max-height:100dvh;border-radius:0;margin:0}}.action-status{margin-top:8px;padding:6px 10px;border-radius:6px;font-size:.8em;font-weight:500}.action-status-submitted{background:#fef3c7;color:#92400e;border:1px solid #fde68a}.action-status-success{background:#d1fae5;color:#065f46;border:1px solid #a7f3d0}.action-status-fail{background:#fee2e2;color:#991b1b;border:1px solid #fca5a5}.message-content{display:block;word-wrap:break-word;overflow-wrap:break-word;max-width:100%;overflow:hidden;font-size:inherit;line-height:1.5}.mc-line{min-height:1.2em;word-break:break-word}.mc-empty-line{height:.5em}.mc-heading{font-weight:600;margin:.3em 0;word-break:break-word}.mc-h1{font-size:1.4em}.mc-h2{font-size:1.2em}.mc-h3{font-size:1.05em}.mc-inline-code{background:#afb8c133;padding:1px 5px;border-radius:3px;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.88em}.mc-codeblock{background:#f6f8fa;border:1px solid #d0d7de;border-radius:6px;margin:6px 0;overflow:hidden;max-width:100%}.mc-codeblock-lang{background:#e8ecf0;padding:3px 10px;font-size:.75em;font-weight:600;color:#57606a;text-transform:uppercase;font-family:Monaco,Menlo,monospace;border-bottom:1px solid #d0d7de}.mc-codeblock pre{margin:0;padding:10px;overflow-x:auto}.mc-codeblock code{font-family:Monaco,Menlo,Ubuntu Mono,Consolas,monospace;font-size:.85em;line-height:1.5;color:#24292f;white-space:pre}.mc-link{color:#0969da;text-decoration:none;word-break:break-word}.mc-link:hover{text-decoration:underline}.mc-image{max-width:150px;width:150px;height:150px;object-fit:contain;border-radius:8px;margin:8px 0;display:block}.mc-image-inline{width:20px;height:20px;border-radius:50%;margin:0 4px;display:inline-block;vertical-align:middle;object-fit:cover}.mc-blockquote{margin:4px 0;padding:2px 0 2px 12px;color:#57606a;border-left:3px solid #d0d7de}.mc-hr{height:1px;border:0;background:#d0d7de;margin:.4em 0}.message-content strong{font-weight:600}.message-content del{text-decoration:line-through}.action-form{background:#f8f9fb;border:1px solid #e2e6ea;border-radius:10px;padding:12px;margin-top:8px}.action-form-title{font-weight:600;font-size:.9em;margin-bottom:10px;color:#1a1a2e;display:flex;align-items:center;gap:6px}.action-form-general-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 12px;margin-bottom:10px;font-size:.8em;color:#dc2626;font-weight:500;display:flex;align-items:center;gap:6px}.action-form-fields{display:flex;flex-direction:column;gap:8px}.action-form-field{display:flex;flex-direction:column;gap:3px}.action-form-field label{font-size:.75em;font-weight:500;color:#6b7280}.action-form-field input,.action-form-field textarea{padding:8px 10px;border:1px solid #d1d5db;border-radius:6px;font-size:16px;background:#fff;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}.action-form-field textarea{resize:none;word-break:break-all}.action-form-field input:focus,.action-form-field textarea:focus{border-color:#6c5ce7;box-shadow:0 0 0 2px #6c5ce726}.action-form-field input.error,.action-form-field textarea.error{border-color:#ef4444}.action-form-field input.readonly,.action-form-field textarea.readonly{background:#f3f4f6;color:#6b7280;cursor:not-allowed;border-color:#e5e7eb}.action-form-field .field-error{font-size:.7em;color:#ef4444;margin-top:1px}.action-form-actions{display:flex;gap:8px;margin-top:10px}.action-form-submit{flex:1;padding:8px 14px;background:#6c5ce7;color:#fff;border:none;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:background .2s}.action-form-submit:hover:not(:disabled){background:#5a4bd1}.action-form-submit:disabled{background:#a5b4fc;cursor:not-allowed}.action-form-cancel{padding:8px 14px;background:transparent;color:#6b7280;border:1px solid #d1d5db;border-radius:6px;font-size:.85em;font-weight:500;cursor:pointer;transition:all .2s}.action-form-cancel:hover{background:#f3f4f6;color:#374151}.action-form-token-info{background:#eef2ff;border:1px solid #c7d2fe;border-radius:8px;padding:8px 10px;margin-bottom:10px}.token-info-row{display:flex;align-items:center;gap:8px}.token-info-logo{border-radius:50%;flex-shrink:0}.token-info-details{display:flex;flex-direction:column;gap:2px;min-width:0}.token-info-name{font-size:.8em;font-weight:600;color:#1a1a2e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.token-info-balance{font-size:.75em;color:#4b5563}.token-info-usd{color:#6c5ce7;font-weight:500}.action-form-field-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.action-form-field-header label{margin-bottom:0}.action-form-pct-btns{display:inline-flex;gap:4px}.action-form-pct-btn{padding:1px 6px;font-size:.7em;font-weight:600;color:#6c5ce7;background:#eef2ff;border:1px solid #c7d2fe;border-radius:4px;cursor:pointer;transition:all .15s}@media(min-width:640px){.action-form-pct-btn:hover:not(:disabled){background:#6c5ce7;color:#fff}}.action-form-pct-btn:disabled{opacity:.5;cursor:not-allowed}.action-form-max-btn{font-weight:700}.scroll-to-bottom-btn{position:absolute;bottom:16px;right:20px;background:#1a1a1dd6;color:#fff;border:1px solid rgba(255,255,255,.12);border-radius:50%;width:36px;height:36px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 4px 12px #00000040;z-index:20;transition:background .15s,transform .15s,box-shadow .15s;animation:fadeInUp .18s ease}@keyframes fadeInUp{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@media(min-width:640px){.scroll-to-bottom-btn:hover{background:#2d2d35;box-shadow:0 6px 16px #0000004d;transform:scale(1.08)}}.scroll-to-bottom-btn:active{transform:scale(.96)}")),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
|
|
2
2
|
import { jsx as L, Fragment as Kr, jsxs as we } from "react/jsx-runtime";
|
|
3
|
-
import Mo, { memo as _o, useState as qe, useCallback as Ne, createContext as Xn, useContext as Kn, useEffect as st, useRef as
|
|
3
|
+
import Mo, { memo as _o, useState as qe, useCallback as Ne, createContext as Xn, useContext as Kn, useEffect as st, useRef as Tt, useMemo as Ro } from "react";
|
|
4
4
|
const Lo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAYAAADG4PRLAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAfXSURBVHgB7Z1LbFRVGMe/c4YCAmKrEFiQWIIrNm13RE0olLRuTCq4w4C6Mbopo9GltFsVpmxQN1pJ2MkjcSMESrsgYdd2w8rGkrCA8GjFVintzPH878wZjrfzujPTe88p3y+ZzMydOxO4//s9z3dvBTWB7sxsqyTqF2q5k4R8nUh06s2thQeTZyZ4qOwU0bqJFkHjv6fbZqhBBNVJIJqiASFUN94SExl98CeVEsONiBlZQEu4E8QW1kTUSAvJoahCRhLw4OnZkyzc6qItcnD087ahWvevScB3MrPty6QuKaJOYuJgpoXEgVqsUVbboef07PElUhMsXqy045j3ZB72V9uxooCHtMskoUaIXWYS6GMuLyFsVdqprAuFeEqoQWISp1JcLClgz3fadFPyEjHuIMWH1wfafglvXiEgEhb4X2K36RpzOrHpCic2K2KgFu8GsXgu0opKILzxfwIeygfMdmKcBJXAwVOPBu1tRRdacJ1/EuM6c1kSu8fSbXN4U7TAJZUdJMYHWmUud8K8CSyQrc87ilYYWOCzXLabGJ8oWmEgoJRygBivEFLsD57ZffqLdqNtkt2nv8hctl8qIXiVwVOE1k5KITqI8RTRjiSmnRg/EdTBAvpNa9UVecZpWEDfYQE9hwX0HBbQc1jAEFs2CLp2oi14dOxaR67DAoZ4c09L8XXHrhZyHRYwxFt71hdf9+5dT67DAlrs2Cq1gM+tbqd+77obZQEtju17qaZtLsECFji2byP1lXCZsMAvezcHyY2LuJ9mrSKbtShva5fZu3dDRVcJYfH5uVv/0tTdZbr/JEeuIHoyjxV5CA4+Duye7Skdq1JV9z87/g9NP8gGr5FpHunaWHd8w+9cmHhKV28/o6Tx0gIPd20IYlMUtza/+Pw8Pa6/C+HrBd/9SrtVF6zRuxiIWPXZ/k2RYxIySoNxhfUC0fAbLrhSrywQdZmdFV65vRi4sXs1HEjbAm9OLwWPHYUyAb9pC1zu+xe124TwjYjfbLwS0Bbv3K2ngRU0AiwIJwAesOxyJcMfOuZ98evftLDoXrrgjQuFpRgrgQU0Kl4YnBCwsDCw7kriNRJLm4E3Atou7ub06mR/EHE+JBROlHLiwQX/eHRr8JwUXhby86vkyvC79slxr+Biy2HKkD5dRyYFd2JC2IJN3V0qux9cp4mZKGuScqUvdCemFCjSYYkoU0pZH5rdh0NNAOwLV4rYjDiKDDcuWMAQEO/bqwtBXIteLqjY4yELWIJKFmTXkKfefzlIriD6yd/mE6kPOQbWCWpIU3Yg8UmquGcBG8DEyIsTi5QULGADwHV+cv5JcZUjCWKPgab3iLS7loY0CmkU2K5hkpUkxQOxClip3+gbSF6G3t0SCIhe6fd6vTEJYnOh4ZWEtQA8CDzKluQaMfEJmGS7aS0Tm4A+TDn7CGehnsMCNoGF5MpA9wU06bq9hPTG9uTdsd3zvPckuVLCeQHNyCBaVUZEZLRJLqJipNHOqONcfQjjvIBmnc0MFQGk72gkJyGi3cQG6IMmOZ3mfGpoaq38WttiMEWNg4fH+Y9fCbZHdWH4TrWh3N7CNLYNvIG9DSv2Z8ebO5sTFS9ye7grDBbBCvFsWwAOaEfE/0ZfcBKkKg5G4Xcr1a4QD0tIPNhbA6Z/CnDAPvjpL/pGL7pOP6h/CQdtvU/3b6KomKHepJvYBm+qaxxwYKzGzHMioYgypd1ntfSOdG3QGW0qsKRKg1Jf68/NqIVrs6GeDfZuDGKTfZXQQsSDipUNuD8zng/r/uHo1sA1l3OH+H2Xrkiy8a6/hdiHC0uAsQokMdUOsD0SD8vFd7GaYBIixNVKIrqK1w1KU2LUksSEL2iZLozLm4RoZ2FIN6nZlnp5oVtp9wtj8yYZMfUl5jx94YXvhRoR7boQ8dG+W4XLcDOb8l0elCV2XWhnti6UC+WITcB5x9LvUpS6ZA2XZrv8b48ticFZnOSibq2JCUS8ot0pkhrMurh4TaBNbBbY7Ov5ooC6L0pmeb+wv+vigdgEXI2LMmvBXKC5VonVp5kuSF+V+7I0A1gRrqG/oFcwfLCkenHiPjGV5kWbcS38WsbpMoLFq46zArJ4teGkgCxe7TgnIIsXDacEZPGi44yALF59OLEeiNaVbwupruCEBbJ49cPLSZ7DAnoOC+g5LKDnsICeI/VSxBwx3iIFC+gzM9qFqklifGVG5hTdIcZPlJqSQrEFektKTsicTF0mxkuyORqXY+k2JDFjxHiFrh4mtXYzQR0ocmqcGK8QUgzjORBwWcphrgf9Au4Tz4GAcKM6HT1DjCeIEbhPvCq20tgK/SFLNGReFwVkK/QDRWrIWB9YcXuHg5nHE3pjJzHOoT3kzGj61d32thWrETkS77ErdQ9oorU5EN6+QsC8eebSxDiFoNxHtus0lFwPHE1vGxHa1xLjBIh719PbSnbMKt7i6FDm0aAicZKYxIB4o+nXBst9XvUeVT2Zh/2K5M96x1ZiYiOfh+TS8IaV9qvpJmPdmdl2SeqG3rmdmFUHfU4kk6ViXphIf8ubXerqAqvThnLmWgWXGSbaH2OnvDWmVG6QhDhOTFMwwi2THC6sDtVMZAENebea7daJ7AAX/nUzprP98XqEM9QtoI0RUyjRqS2zg/Kxsp2YAFhYfnhMTeo3d5RQOsalLtcrms1//TyUbJOo0HUAAAAASUVORK5CYII=", Ho = _o(({ onClick: e }) => /* @__PURE__ */ L(
|
|
5
5
|
"button",
|
|
6
6
|
{
|
|
@@ -97,11 +97,11 @@ class Vo extends ue {
|
|
|
97
97
|
super(`Size cannot exceed ${n} bytes. Given size: ${t} bytes.`, { name: "SizeOverflowError" });
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
function
|
|
100
|
+
function Rt(e, { strict: t = !0 } = {}) {
|
|
101
101
|
return !e || typeof e != "string" ? !1 : t ? /^0x[0-9a-fA-F]*$/.test(e) : e.startsWith("0x");
|
|
102
102
|
}
|
|
103
103
|
function Ye(e) {
|
|
104
|
-
return
|
|
104
|
+
return Rt(e, { strict: !1 }) ? Math.ceil((e.length - 2) / 2) : e.length;
|
|
105
105
|
}
|
|
106
106
|
function hn(e, { dir: t = "left" } = {}) {
|
|
107
107
|
let n = typeof e == "string" ? e.replace("0x", "") : e, r = 0;
|
|
@@ -119,7 +119,7 @@ class es extends ue {
|
|
|
119
119
|
super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${t}) exceeds padding size (${n}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
|
-
function
|
|
122
|
+
function Lt(e, { dir: t, size: n = 32 } = {}) {
|
|
123
123
|
return typeof e == "string" ? vt(e, { dir: t, size: n }) : Wo(e, { dir: t, size: n });
|
|
124
124
|
}
|
|
125
125
|
function vt(e, { dir: t, size: n = 32 } = {}) {
|
|
@@ -151,19 +151,19 @@ function Wo(e, { dir: t, size: n = 32 } = {}) {
|
|
|
151
151
|
return r;
|
|
152
152
|
}
|
|
153
153
|
const Go = /* @__PURE__ */ Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
|
|
154
|
-
function
|
|
154
|
+
function Mt(e, t = {}) {
|
|
155
155
|
return typeof e == "number" || typeof e == "bigint" ? le(e, t) : typeof e == "string" ? ns(e, t) : typeof e == "boolean" ? ts(e, t) : ht(e, t);
|
|
156
156
|
}
|
|
157
157
|
function ts(e, t = {}) {
|
|
158
158
|
const n = `0x${Number(e)}`;
|
|
159
|
-
return typeof t.size == "number" ? (
|
|
159
|
+
return typeof t.size == "number" ? (Ht(n, { size: t.size }), Lt(n, { size: t.size })) : n;
|
|
160
160
|
}
|
|
161
161
|
function ht(e, t = {}) {
|
|
162
162
|
let n = "";
|
|
163
163
|
for (let s = 0; s < e.length; s++)
|
|
164
164
|
n += Go[e[s]];
|
|
165
165
|
const r = `0x${n}`;
|
|
166
|
-
return typeof t.size == "number" ? (
|
|
166
|
+
return typeof t.size == "number" ? (Ht(r, { size: t.size }), Lt(r, { dir: "right", size: t.size })) : r;
|
|
167
167
|
}
|
|
168
168
|
function le(e, t = {}) {
|
|
169
169
|
const { signed: n, size: r } = t, s = BigInt(e);
|
|
@@ -181,7 +181,7 @@ function le(e, t = {}) {
|
|
|
181
181
|
});
|
|
182
182
|
}
|
|
183
183
|
const c = `0x${(n && s < 0 ? (1n << BigInt(r * 8)) + BigInt(s) : s).toString(16)}`;
|
|
184
|
-
return r ?
|
|
184
|
+
return r ? Lt(c, { size: r }) : c;
|
|
185
185
|
}
|
|
186
186
|
const zo = /* @__PURE__ */ new TextEncoder();
|
|
187
187
|
function ns(e, t = {}) {
|
|
@@ -190,11 +190,11 @@ function ns(e, t = {}) {
|
|
|
190
190
|
}
|
|
191
191
|
const qo = /* @__PURE__ */ new TextEncoder();
|
|
192
192
|
function Zn(e, t = {}) {
|
|
193
|
-
return typeof e == "number" || typeof e == "bigint" ? jo(e, t) : typeof e == "boolean" ? Yo(e, t) :
|
|
193
|
+
return typeof e == "number" || typeof e == "bigint" ? jo(e, t) : typeof e == "boolean" ? Yo(e, t) : Rt(e) ? Ct(e, t) : rs(e, t);
|
|
194
194
|
}
|
|
195
195
|
function Yo(e, t = {}) {
|
|
196
196
|
const n = new Uint8Array(1);
|
|
197
|
-
return n[0] = Number(e), typeof t.size == "number" ? (
|
|
197
|
+
return n[0] = Number(e), typeof t.size == "number" ? (Ht(n, { size: t.size }), Lt(n, { size: t.size })) : n;
|
|
198
198
|
}
|
|
199
199
|
const dt = {
|
|
200
200
|
zero: 48,
|
|
@@ -212,9 +212,9 @@ function Br(e) {
|
|
|
212
212
|
if (e >= dt.a && e <= dt.f)
|
|
213
213
|
return e - (dt.a - 10);
|
|
214
214
|
}
|
|
215
|
-
function
|
|
215
|
+
function Ct(e, t = {}) {
|
|
216
216
|
let n = e;
|
|
217
|
-
t.size && (
|
|
217
|
+
t.size && (Ht(n, { size: t.size }), n = Lt(n, { dir: "right", size: t.size }));
|
|
218
218
|
let r = n.slice(2);
|
|
219
219
|
r.length % 2 && (r = `0${r}`);
|
|
220
220
|
const s = r.length / 2, a = new Uint8Array(s);
|
|
@@ -228,22 +228,22 @@ function It(e, t = {}) {
|
|
|
228
228
|
}
|
|
229
229
|
function jo(e, t) {
|
|
230
230
|
const n = le(e, t);
|
|
231
|
-
return
|
|
231
|
+
return Ct(n);
|
|
232
232
|
}
|
|
233
233
|
function rs(e, t = {}) {
|
|
234
234
|
const n = qo.encode(e);
|
|
235
|
-
return typeof t.size == "number" ? (
|
|
235
|
+
return typeof t.size == "number" ? (Ht(n, { size: t.size }), Lt(n, { dir: "right", size: t.size })) : n;
|
|
236
236
|
}
|
|
237
|
-
function
|
|
237
|
+
function Ht(e, { size: t }) {
|
|
238
238
|
if (Ye(e) > t)
|
|
239
239
|
throw new Vo({
|
|
240
240
|
givenSize: Ye(e),
|
|
241
241
|
maxSize: t
|
|
242
242
|
});
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function Dt(e, t = {}) {
|
|
245
245
|
const { signed: n } = t;
|
|
246
|
-
t.size &&
|
|
246
|
+
t.size && Ht(e, { size: t.size });
|
|
247
247
|
const r = BigInt(e);
|
|
248
248
|
if (!n)
|
|
249
249
|
return r;
|
|
@@ -251,7 +251,7 @@ function Ut(e, t = {}) {
|
|
|
251
251
|
return r <= a ? r : r - BigInt(`0x${"f".padStart(s * 2, "f")}`) - 1n;
|
|
252
252
|
}
|
|
253
253
|
function gn(e, t = {}) {
|
|
254
|
-
const n =
|
|
254
|
+
const n = Dt(e, t), r = Number(n);
|
|
255
255
|
if (!Number.isSafeInteger(r))
|
|
256
256
|
throw new $n({
|
|
257
257
|
max: `${Number.MAX_SAFE_INTEGER}`,
|
|
@@ -403,9 +403,9 @@ function sa(e) {
|
|
|
403
403
|
...typeof t.v < "u" && typeof t.yParity > "u" ? { v: le(t.v) } : {}
|
|
404
404
|
}));
|
|
405
405
|
}
|
|
406
|
-
const
|
|
407
|
-
function
|
|
408
|
-
return typeof e[0] == "string" ?
|
|
406
|
+
const Vt = 2n ** 256n - 1n;
|
|
407
|
+
function _t(e) {
|
|
408
|
+
return typeof e[0] == "string" ? Nt(e) : oa(e);
|
|
409
409
|
}
|
|
410
410
|
function oa(e) {
|
|
411
411
|
let t = 0;
|
|
@@ -417,7 +417,7 @@ function oa(e) {
|
|
|
417
417
|
n.set(s, r), r += s.length;
|
|
418
418
|
return n;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
420
|
+
function Nt(e) {
|
|
421
421
|
return `0x${e.reduce((t, n) => t + n.replace("0x", ""), "")}`;
|
|
422
422
|
}
|
|
423
423
|
class Pr extends ue {
|
|
@@ -563,7 +563,7 @@ function os(e, { recursiveReadLimit: t = 8192 } = {}) {
|
|
|
563
563
|
const n = Object.create(ca);
|
|
564
564
|
return n.bytes = e, n.dataView = new DataView(e.buffer ?? e, e.byteOffset, e.byteLength), n.positionReadCount = /* @__PURE__ */ new Map(), n.recursiveReadLimit = t, n;
|
|
565
565
|
}
|
|
566
|
-
function
|
|
566
|
+
function Bt(e, t = "hex") {
|
|
567
567
|
const n = as(e), r = os(new Uint8Array(n.length));
|
|
568
568
|
return n.encode(r), t === "hex" ? ht(r.bytes) : r.bytes;
|
|
569
569
|
}
|
|
@@ -582,7 +582,7 @@ function la(e) {
|
|
|
582
582
|
};
|
|
583
583
|
}
|
|
584
584
|
function da(e) {
|
|
585
|
-
const t = typeof e == "string" ?
|
|
585
|
+
const t = typeof e == "string" ? Ct(e) : e, n = is(t.length);
|
|
586
586
|
return {
|
|
587
587
|
length: t.length === 1 && t[0] < 128 ? 1 : t.length <= 55 ? 1 + t.length : 1 + n + t.length,
|
|
588
588
|
encode(s) {
|
|
@@ -621,7 +621,7 @@ function Fe(e, t) {
|
|
|
621
621
|
function pa(e, t = "wei") {
|
|
622
622
|
return Fe(e, ua[t]);
|
|
623
623
|
}
|
|
624
|
-
function
|
|
624
|
+
function St(e, t = "wei") {
|
|
625
625
|
return Fe(e, fa[t]);
|
|
626
626
|
}
|
|
627
627
|
function cs(e) {
|
|
@@ -669,22 +669,22 @@ function ba(e) {
|
|
|
669
669
|
for (const n of e) {
|
|
670
670
|
const { chainId: r, nonce: s, ...a } = n, o = n.address;
|
|
671
671
|
t.push([
|
|
672
|
-
r ?
|
|
672
|
+
r ? Mt(r) : "0x",
|
|
673
673
|
o,
|
|
674
|
-
s ?
|
|
675
|
-
...
|
|
674
|
+
s ? Mt(s) : "0x",
|
|
675
|
+
...tn({}, a)
|
|
676
676
|
]);
|
|
677
677
|
}
|
|
678
678
|
return t;
|
|
679
679
|
}
|
|
680
680
|
function ls(e) {
|
|
681
|
-
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((a) =>
|
|
681
|
+
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((a) => Ct(a)) : e.blobs, s = [];
|
|
682
682
|
for (const a of r)
|
|
683
683
|
s.push(Uint8Array.from(t.blobToKzgCommitment(a)));
|
|
684
684
|
return n === "bytes" ? s : s.map((a) => ht(a));
|
|
685
685
|
}
|
|
686
686
|
function ds(e) {
|
|
687
|
-
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((o) =>
|
|
687
|
+
const { kzg: t } = e, n = e.to ?? (typeof e.blobs[0] == "string" ? "hex" : "bytes"), r = typeof e.blobs[0] == "string" ? e.blobs.map((o) => Ct(o)) : e.blobs, s = typeof e.commitments[0] == "string" ? e.commitments.map((o) => Ct(o)) : e.commitments, a = [];
|
|
688
688
|
for (let o = 0; o < r.length; o++) {
|
|
689
689
|
const c = r[o], T = s[o];
|
|
690
690
|
a.push(Uint8Array.from(t.computeBlobKzgProof(c, T)));
|
|
@@ -698,7 +698,7 @@ function Nr(e) {
|
|
|
698
698
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
699
699
|
throw new Error("positive integer expected, got " + e);
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function Kt(e, ...t) {
|
|
702
702
|
if (!wa(e))
|
|
703
703
|
throw new Error("Uint8Array expected");
|
|
704
704
|
if (t.length > 0 && !t.includes(e.length))
|
|
@@ -711,7 +711,7 @@ function bn(e, t = !0) {
|
|
|
711
711
|
throw new Error("Hash#digest() has already been called");
|
|
712
712
|
}
|
|
713
713
|
function us(e, t) {
|
|
714
|
-
|
|
714
|
+
Kt(e);
|
|
715
715
|
const n = t.outputLen;
|
|
716
716
|
if (e.length < n)
|
|
717
717
|
throw new Error("digestInto() expects output buffer of length at least " + n);
|
|
@@ -719,7 +719,7 @@ function us(e, t) {
|
|
|
719
719
|
function ya(e) {
|
|
720
720
|
return new Uint32Array(e.buffer, e.byteOffset, Math.floor(e.byteLength / 4));
|
|
721
721
|
}
|
|
722
|
-
function
|
|
722
|
+
function $t(...e) {
|
|
723
723
|
for (let t = 0; t < e.length; t++)
|
|
724
724
|
e[t].fill(0);
|
|
725
725
|
}
|
|
@@ -745,7 +745,7 @@ function xa(e) {
|
|
|
745
745
|
return new Uint8Array(new TextEncoder().encode(e));
|
|
746
746
|
}
|
|
747
747
|
function tr(e) {
|
|
748
|
-
return typeof e == "string" && (e = xa(e)),
|
|
748
|
+
return typeof e == "string" && (e = xa(e)), Kt(e), e;
|
|
749
749
|
}
|
|
750
750
|
class fs {
|
|
751
751
|
}
|
|
@@ -770,7 +770,7 @@ class Ia extends fs {
|
|
|
770
770
|
super(), this.finished = !1, this.length = 0, this.pos = 0, this.destroyed = !1, this.blockLen = t, this.outputLen = n, this.padOffset = r, this.isLE = s, this.buffer = new Uint8Array(t), this.view = Tn(this.buffer);
|
|
771
771
|
}
|
|
772
772
|
update(t) {
|
|
773
|
-
bn(this), t = tr(t),
|
|
773
|
+
bn(this), t = tr(t), Kt(t);
|
|
774
774
|
const { view: n, buffer: r, blockLen: s } = this, a = t.length;
|
|
775
775
|
for (let o = 0; o < a; ) {
|
|
776
776
|
const c = Math.min(s - this.pos, a - o);
|
|
@@ -788,7 +788,7 @@ class Ia extends fs {
|
|
|
788
788
|
bn(this), us(t, this), this.finished = !0;
|
|
789
789
|
const { buffer: n, view: r, blockLen: s, isLE: a } = this;
|
|
790
790
|
let { pos: o } = this;
|
|
791
|
-
n[o++] = 128,
|
|
791
|
+
n[o++] = 128, $t(this.buffer.subarray(o)), this.padOffset > s - o && (this.process(r, 0), o = 0);
|
|
792
792
|
for (let _ = o; _ < s; _++)
|
|
793
793
|
n[_] = 0;
|
|
794
794
|
Ta(r, s - 8, BigInt(this.length * 8), a), this.process(r, 0);
|
|
@@ -931,15 +931,15 @@ class Fa extends Ia {
|
|
|
931
931
|
r = r + this.A | 0, s = s + this.B | 0, a = a + this.C | 0, o = o + this.D | 0, c = c + this.E | 0, T = T + this.F | 0, I = I + this.G | 0, P = P + this.H | 0, this.set(r, s, a, o, c, T, I, P);
|
|
932
932
|
}
|
|
933
933
|
roundClean() {
|
|
934
|
-
|
|
934
|
+
$t(bt);
|
|
935
935
|
}
|
|
936
936
|
destroy() {
|
|
937
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0),
|
|
937
|
+
this.set(0, 0, 0, 0, 0, 0, 0, 0), $t(this.buffer);
|
|
938
938
|
}
|
|
939
939
|
}
|
|
940
940
|
const Ma = /* @__PURE__ */ ps(() => new Fa()), _a = Ma;
|
|
941
941
|
function Ra(e, t) {
|
|
942
|
-
return _a(
|
|
942
|
+
return _a(Rt(e, { strict: !1 }) ? Zn(e) : e);
|
|
943
943
|
}
|
|
944
944
|
function La(e) {
|
|
945
945
|
const { commitment: t, version: n = 1 } = e, r = e.to ?? (typeof t == "string" ? "hex" : "bytes"), s = Ra(t);
|
|
@@ -991,7 +991,7 @@ class Ga extends ue {
|
|
|
991
991
|
}
|
|
992
992
|
}
|
|
993
993
|
function za(e) {
|
|
994
|
-
const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), n = typeof e.data == "string" ?
|
|
994
|
+
const t = e.to ?? (typeof e.data == "string" ? "hex" : "bytes"), n = typeof e.data == "string" ? Ct(e.data) : e.data, r = Ye(n);
|
|
995
995
|
if (!r)
|
|
996
996
|
throw new bs();
|
|
997
997
|
if (r > Fr)
|
|
@@ -1042,7 +1042,7 @@ class yn extends ue {
|
|
|
1042
1042
|
super(typeof t == "number" ? `Chain ID "${t}" is invalid.` : "Chain ID is invalid.", { name: "InvalidChainIdError" });
|
|
1043
1043
|
}
|
|
1044
1044
|
}
|
|
1045
|
-
class
|
|
1045
|
+
class Ft extends ue {
|
|
1046
1046
|
constructor({ cause: t, message: n } = {}) {
|
|
1047
1047
|
const r = n?.replace("execution reverted: ", "")?.replace("execution reverted", "");
|
|
1048
1048
|
super(`Execution reverted ${r ? `with reason: ${r}` : "for an unknown reason"}.`, {
|
|
@@ -1051,27 +1051,27 @@ class Dt extends ue {
|
|
|
1051
1051
|
});
|
|
1052
1052
|
}
|
|
1053
1053
|
}
|
|
1054
|
-
Object.defineProperty(
|
|
1054
|
+
Object.defineProperty(Ft, "code", {
|
|
1055
1055
|
enumerable: !0,
|
|
1056
1056
|
configurable: !0,
|
|
1057
1057
|
writable: !0,
|
|
1058
1058
|
value: 3
|
|
1059
1059
|
});
|
|
1060
|
-
Object.defineProperty(
|
|
1060
|
+
Object.defineProperty(Ft, "nodeMessage", {
|
|
1061
1061
|
enumerable: !0,
|
|
1062
1062
|
configurable: !0,
|
|
1063
1063
|
writable: !0,
|
|
1064
1064
|
value: /execution reverted|gas required exceeds allowance/
|
|
1065
1065
|
});
|
|
1066
|
-
class
|
|
1066
|
+
class Pt extends ue {
|
|
1067
1067
|
constructor({ cause: t, maxFeePerGas: n } = {}) {
|
|
1068
|
-
super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${
|
|
1068
|
+
super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${St(n)} gwei` : ""}) cannot be higher than the maximum allowed value (2^256-1).`, {
|
|
1069
1069
|
cause: t,
|
|
1070
1070
|
name: "FeeCapTooHighError"
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
1073
|
}
|
|
1074
|
-
Object.defineProperty(
|
|
1074
|
+
Object.defineProperty(Pt, "nodeMessage", {
|
|
1075
1075
|
enumerable: !0,
|
|
1076
1076
|
configurable: !0,
|
|
1077
1077
|
writable: !0,
|
|
@@ -1079,7 +1079,7 @@ Object.defineProperty(Bt, "nodeMessage", {
|
|
|
1079
1079
|
});
|
|
1080
1080
|
class _n extends ue {
|
|
1081
1081
|
constructor({ cause: t, maxFeePerGas: n } = {}) {
|
|
1082
|
-
super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${
|
|
1082
|
+
super(`The fee cap (\`maxFeePerGas\`${n ? ` = ${St(n)}` : ""} gwei) cannot be lower than the block base fee.`, {
|
|
1083
1083
|
cause: t,
|
|
1084
1084
|
name: "FeeCapTooLowError"
|
|
1085
1085
|
});
|
|
@@ -1197,10 +1197,10 @@ Object.defineProperty(zn, "nodeMessage", {
|
|
|
1197
1197
|
writable: !0,
|
|
1198
1198
|
value: /transaction type not valid/
|
|
1199
1199
|
});
|
|
1200
|
-
class
|
|
1200
|
+
class Zt extends ue {
|
|
1201
1201
|
constructor({ cause: t, maxPriorityFeePerGas: n, maxFeePerGas: r } = {}) {
|
|
1202
1202
|
super([
|
|
1203
|
-
`The provided tip (\`maxPriorityFeePerGas\`${n ? ` = ${
|
|
1203
|
+
`The provided tip (\`maxPriorityFeePerGas\`${n ? ` = ${St(n)} gwei` : ""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r ? ` = ${St(r)} gwei` : ""}).`
|
|
1204
1204
|
].join(`
|
|
1205
1205
|
`), {
|
|
1206
1206
|
cause: t,
|
|
@@ -1208,7 +1208,7 @@ class $t extends ue {
|
|
|
1208
1208
|
});
|
|
1209
1209
|
}
|
|
1210
1210
|
}
|
|
1211
|
-
Object.defineProperty(
|
|
1211
|
+
Object.defineProperty(Zt, "nodeMessage", {
|
|
1212
1212
|
enumerable: !0,
|
|
1213
1213
|
configurable: !0,
|
|
1214
1214
|
writable: !0,
|
|
@@ -1243,12 +1243,12 @@ class ys extends Map {
|
|
|
1243
1243
|
return this;
|
|
1244
1244
|
}
|
|
1245
1245
|
}
|
|
1246
|
-
const Ya = BigInt(0),
|
|
1247
|
-
for (let e = 0, t =
|
|
1246
|
+
const Ya = BigInt(0), zt = BigInt(1), ja = BigInt(2), Ja = BigInt(7), Xa = BigInt(256), Ka = BigInt(113), vs = [], As = [], ks = [];
|
|
1247
|
+
for (let e = 0, t = zt, n = 1, r = 0; e < 24; e++) {
|
|
1248
1248
|
[n, r] = [r, (2 * n + 3 * r) % 5], vs.push(2 * (5 * r + n)), As.push((e + 1) * (e + 2) / 2 % 64);
|
|
1249
1249
|
let s = Ya;
|
|
1250
1250
|
for (let a = 0; a < 7; a++)
|
|
1251
|
-
t = (t <<
|
|
1251
|
+
t = (t << zt ^ (t >> Ja) * Ka) % Xa, t & ja && (s ^= zt << (zt << /* @__PURE__ */ BigInt(a)) - zt);
|
|
1252
1252
|
ks.push(s);
|
|
1253
1253
|
}
|
|
1254
1254
|
const xs = Ba(ks, !0), $a = xs[0], Za = xs[1], Mr = (e, t, n) => n > 32 ? Oa(e, t, n) : Pa(e, t, n), _r = (e, t, n) => n > 32 ? Ua(e, t, n) : Na(e, t, n);
|
|
@@ -1275,7 +1275,7 @@ function Qa(e, t = 24) {
|
|
|
1275
1275
|
}
|
|
1276
1276
|
e[0] ^= $a[r], e[1] ^= Za[r];
|
|
1277
1277
|
}
|
|
1278
|
-
|
|
1278
|
+
$t(n);
|
|
1279
1279
|
}
|
|
1280
1280
|
class rr extends fs {
|
|
1281
1281
|
// NOTE: we accept arguments in bytes instead of bits here.
|
|
@@ -1291,7 +1291,7 @@ class rr extends fs {
|
|
|
1291
1291
|
Or(this.state32), Qa(this.state32, this.rounds), Or(this.state32), this.posOut = 0, this.pos = 0;
|
|
1292
1292
|
}
|
|
1293
1293
|
update(t) {
|
|
1294
|
-
bn(this), t = tr(t),
|
|
1294
|
+
bn(this), t = tr(t), Kt(t);
|
|
1295
1295
|
const { blockLen: n, state: r } = this, s = t.length;
|
|
1296
1296
|
for (let a = 0; a < s; ) {
|
|
1297
1297
|
const o = Math.min(n - this.pos, s - a);
|
|
@@ -1309,7 +1309,7 @@ class rr extends fs {
|
|
|
1309
1309
|
t[r] ^= n, (n & 128) !== 0 && r === s - 1 && this.keccak(), t[s - 1] ^= 128, this.keccak();
|
|
1310
1310
|
}
|
|
1311
1311
|
writeInto(t) {
|
|
1312
|
-
bn(this, !1),
|
|
1312
|
+
bn(this, !1), Kt(t), this.finish();
|
|
1313
1313
|
const n = this.state, { blockLen: r } = this;
|
|
1314
1314
|
for (let s = 0, a = t.length; s < a; ) {
|
|
1315
1315
|
this.posOut >= r && this.keccak();
|
|
@@ -1335,7 +1335,7 @@ class rr extends fs {
|
|
|
1335
1335
|
return this.digestInto(new Uint8Array(this.outputLen));
|
|
1336
1336
|
}
|
|
1337
1337
|
destroy() {
|
|
1338
|
-
this.destroyed = !0,
|
|
1338
|
+
this.destroyed = !0, $t(this.state);
|
|
1339
1339
|
}
|
|
1340
1340
|
_cloneInto(t) {
|
|
1341
1341
|
const { blockLen: n, suffix: r, outputLen: s, rounds: a, enableXOF: o } = this;
|
|
@@ -1344,8 +1344,8 @@ class rr extends fs {
|
|
|
1344
1344
|
}
|
|
1345
1345
|
const ei = (e, t, n) => ps(() => new rr(t, e, n)), ti = ei(1, 136, 256 / 8);
|
|
1346
1346
|
function Ts(e, t) {
|
|
1347
|
-
const n = t || "hex", r = ti(
|
|
1348
|
-
return n === "bytes" ? r :
|
|
1347
|
+
const n = t || "hex", r = ti(Rt(e, { strict: !1 }) ? Zn(e) : e);
|
|
1348
|
+
return n === "bytes" ? r : Mt(r);
|
|
1349
1349
|
}
|
|
1350
1350
|
const En = /* @__PURE__ */ new ys(8192);
|
|
1351
1351
|
function ni(e, t) {
|
|
@@ -1366,7 +1366,7 @@ function Ve(e, t) {
|
|
|
1366
1366
|
return Sn.set(r, s), s;
|
|
1367
1367
|
}
|
|
1368
1368
|
function sr(e, t, n, { strict: r } = {}) {
|
|
1369
|
-
return
|
|
1369
|
+
return Rt(e, { strict: !1 }) ? oi(e, t, n, {
|
|
1370
1370
|
strict: r
|
|
1371
1371
|
}) : si(e, t, n, {
|
|
1372
1372
|
strict: r
|
|
@@ -1434,10 +1434,10 @@ function or(e) {
|
|
|
1434
1434
|
throw new yn({ chainId: t });
|
|
1435
1435
|
if (s && !Ve(s))
|
|
1436
1436
|
throw new ct({ address: s });
|
|
1437
|
-
if (r && r >
|
|
1438
|
-
throw new
|
|
1437
|
+
if (r && r > Vt)
|
|
1438
|
+
throw new Pt({ maxFeePerGas: r });
|
|
1439
1439
|
if (n && r && n > r)
|
|
1440
|
-
throw new
|
|
1440
|
+
throw new Zt({ maxFeePerGas: r, maxPriorityFeePerGas: n });
|
|
1441
1441
|
}
|
|
1442
1442
|
function ci(e) {
|
|
1443
1443
|
const { chainId: t, maxPriorityFeePerGas: n, gasPrice: r, maxFeePerGas: s, to: a } = e;
|
|
@@ -1447,8 +1447,8 @@ function ci(e) {
|
|
|
1447
1447
|
throw new ct({ address: a });
|
|
1448
1448
|
if (n || s)
|
|
1449
1449
|
throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.");
|
|
1450
|
-
if (r && r >
|
|
1451
|
-
throw new
|
|
1450
|
+
if (r && r > Vt)
|
|
1451
|
+
throw new Pt({ maxFeePerGas: r });
|
|
1452
1452
|
}
|
|
1453
1453
|
function li(e) {
|
|
1454
1454
|
const { chainId: t, maxPriorityFeePerGas: n, gasPrice: r, maxFeePerGas: s, to: a } = e;
|
|
@@ -1458,8 +1458,8 @@ function li(e) {
|
|
|
1458
1458
|
throw new yn({ chainId: t });
|
|
1459
1459
|
if (n || s)
|
|
1460
1460
|
throw new ue("`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.");
|
|
1461
|
-
if (r && r >
|
|
1462
|
-
throw new
|
|
1461
|
+
if (r && r > Vt)
|
|
1462
|
+
throw new Pt({ maxFeePerGas: r });
|
|
1463
1463
|
}
|
|
1464
1464
|
function di(e) {
|
|
1465
1465
|
if (e.type)
|
|
@@ -1497,9 +1497,9 @@ function fi(e, t) {
|
|
|
1497
1497
|
const { authorizationList: n, chainId: r, gas: s, nonce: a, to: o, value: c, maxFeePerGas: T, maxPriorityFeePerGas: I, accessList: P, data: _ } = e;
|
|
1498
1498
|
ai(e);
|
|
1499
1499
|
const h = vn(P), k = ba(n);
|
|
1500
|
-
return
|
|
1500
|
+
return Nt([
|
|
1501
1501
|
"0x04",
|
|
1502
|
-
|
|
1502
|
+
Bt([
|
|
1503
1503
|
le(r),
|
|
1504
1504
|
a ? le(a) : "0x",
|
|
1505
1505
|
I ? le(I) : "0x",
|
|
@@ -1510,7 +1510,7 @@ function fi(e, t) {
|
|
|
1510
1510
|
_ ?? "0x",
|
|
1511
1511
|
h,
|
|
1512
1512
|
k,
|
|
1513
|
-
...
|
|
1513
|
+
...tn(e, t)
|
|
1514
1514
|
])
|
|
1515
1515
|
]);
|
|
1516
1516
|
}
|
|
@@ -1542,17 +1542,17 @@ function pi(e, t) {
|
|
|
1542
1542
|
x,
|
|
1543
1543
|
c ? le(c) : "0x",
|
|
1544
1544
|
h ?? [],
|
|
1545
|
-
...
|
|
1545
|
+
...tn(e, t)
|
|
1546
1546
|
], C = [], de = [], U = [];
|
|
1547
1547
|
if (k)
|
|
1548
1548
|
for (let Z = 0; Z < k.length; Z++) {
|
|
1549
1549
|
const { blob: se, commitment: ye, proof: he } = k[Z];
|
|
1550
1550
|
C.push(se), de.push(ye), U.push(he);
|
|
1551
1551
|
}
|
|
1552
|
-
return
|
|
1552
|
+
return Nt([
|
|
1553
1553
|
"0x03",
|
|
1554
1554
|
// If sidecars are enabled, envelope turns into a "wrapper":
|
|
1555
|
-
|
|
1555
|
+
Bt(k ? [g, C, de, U] : g)
|
|
1556
1556
|
]);
|
|
1557
1557
|
}
|
|
1558
1558
|
function mi(e, t) {
|
|
@@ -1568,11 +1568,11 @@ function mi(e, t) {
|
|
|
1568
1568
|
o ? le(o) : "0x",
|
|
1569
1569
|
P ?? "0x",
|
|
1570
1570
|
_,
|
|
1571
|
-
...
|
|
1571
|
+
...tn(e, t)
|
|
1572
1572
|
];
|
|
1573
|
-
return
|
|
1573
|
+
return Nt([
|
|
1574
1574
|
"0x02",
|
|
1575
|
-
|
|
1575
|
+
Bt(h)
|
|
1576
1576
|
]);
|
|
1577
1577
|
}
|
|
1578
1578
|
function hi(e, t) {
|
|
@@ -1587,11 +1587,11 @@ function hi(e, t) {
|
|
|
1587
1587
|
c ? le(c) : "0x",
|
|
1588
1588
|
s ?? "0x",
|
|
1589
1589
|
P,
|
|
1590
|
-
...
|
|
1590
|
+
...tn(e, t)
|
|
1591
1591
|
];
|
|
1592
|
-
return
|
|
1592
|
+
return Nt([
|
|
1593
1593
|
"0x01",
|
|
1594
|
-
|
|
1594
|
+
Bt(_)
|
|
1595
1595
|
]);
|
|
1596
1596
|
}
|
|
1597
1597
|
function gi(e, t) {
|
|
@@ -1628,9 +1628,9 @@ function gi(e, t) {
|
|
|
1628
1628
|
"0x",
|
|
1629
1629
|
"0x"
|
|
1630
1630
|
]);
|
|
1631
|
-
return
|
|
1631
|
+
return Bt(I);
|
|
1632
1632
|
}
|
|
1633
|
-
function
|
|
1633
|
+
function tn(e, t) {
|
|
1634
1634
|
const n = t ?? e, { v: r, yParity: s } = n;
|
|
1635
1635
|
if (typeof n.r > "u")
|
|
1636
1636
|
return [];
|
|
@@ -1660,7 +1660,7 @@ const bi = {
|
|
|
1660
1660
|
if (typeof n == "string")
|
|
1661
1661
|
return n;
|
|
1662
1662
|
const r = er(n);
|
|
1663
|
-
return r.typeHex === "0x7e" && (r.isSystemTx = n.isSystemTx, r.mint = n.mint ?
|
|
1663
|
+
return r.typeHex === "0x7e" && (r.isSystemTx = n.isSystemTx, r.mint = n.mint ? Dt(n.mint) : void 0, r.sourceHash = n.sourceHash, r.type = "deposit"), r;
|
|
1664
1664
|
}),
|
|
1665
1665
|
stateRoot: e.stateRoot
|
|
1666
1666
|
};
|
|
@@ -1669,15 +1669,15 @@ const bi = {
|
|
|
1669
1669
|
transaction: /* @__PURE__ */ Jo({
|
|
1670
1670
|
format(e) {
|
|
1671
1671
|
const t = {};
|
|
1672
|
-
return e.type === "0x7e" && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ?
|
|
1672
|
+
return e.type === "0x7e" && (t.isSystemTx = e.isSystemTx, t.mint = e.mint ? Dt(e.mint) : void 0, t.sourceHash = e.sourceHash, t.type = "deposit"), t;
|
|
1673
1673
|
}
|
|
1674
1674
|
}),
|
|
1675
1675
|
transactionReceipt: /* @__PURE__ */ ta({
|
|
1676
1676
|
format(e) {
|
|
1677
1677
|
return {
|
|
1678
|
-
l1GasPrice: e.l1GasPrice ?
|
|
1679
|
-
l1GasUsed: e.l1GasUsed ?
|
|
1680
|
-
l1Fee: e.l1Fee ?
|
|
1678
|
+
l1GasPrice: e.l1GasPrice ? Dt(e.l1GasPrice) : null,
|
|
1679
|
+
l1GasUsed: e.l1GasUsed ? Dt(e.l1GasUsed) : null,
|
|
1680
|
+
l1Fee: e.l1Fee ? Dt(e.l1Fee) : null,
|
|
1681
1681
|
l1FeeScalar: e.l1FeeScalar ? Number(e.l1FeeScalar) : null
|
|
1682
1682
|
};
|
|
1683
1683
|
}
|
|
@@ -1695,15 +1695,15 @@ function Ai(e) {
|
|
|
1695
1695
|
t,
|
|
1696
1696
|
r,
|
|
1697
1697
|
c ?? "0x",
|
|
1698
|
-
o ?
|
|
1699
|
-
T ?
|
|
1700
|
-
s ?
|
|
1698
|
+
o ? Mt(o) : "0x",
|
|
1699
|
+
T ? Mt(T) : "0x",
|
|
1700
|
+
s ? Mt(s) : "0x",
|
|
1701
1701
|
a ? "0x1" : "0x",
|
|
1702
1702
|
n ?? "0x"
|
|
1703
1703
|
];
|
|
1704
|
-
return
|
|
1704
|
+
return Nt([
|
|
1705
1705
|
"0x7e",
|
|
1706
|
-
|
|
1706
|
+
Bt(I)
|
|
1707
1707
|
]);
|
|
1708
1708
|
}
|
|
1709
1709
|
function ki(e) {
|
|
@@ -1769,7 +1769,7 @@ const wn = {
|
|
|
1769
1769
|
blockCreated: 11907934
|
|
1770
1770
|
}
|
|
1771
1771
|
}
|
|
1772
|
-
}),
|
|
1772
|
+
}), qt = 1, Is = /* @__PURE__ */ mt({
|
|
1773
1773
|
...wn,
|
|
1774
1774
|
id: 8453,
|
|
1775
1775
|
name: "Base",
|
|
@@ -1789,12 +1789,12 @@ const wn = {
|
|
|
1789
1789
|
contracts: {
|
|
1790
1790
|
...wn.contracts,
|
|
1791
1791
|
disputeGameFactory: {
|
|
1792
|
-
[
|
|
1792
|
+
[qt]: {
|
|
1793
1793
|
address: "0x43edB88C4B80fDD2AdFF2412A7BebF9dF42cB40e"
|
|
1794
1794
|
}
|
|
1795
1795
|
},
|
|
1796
1796
|
l2OutputOracle: {
|
|
1797
|
-
[
|
|
1797
|
+
[qt]: {
|
|
1798
1798
|
address: "0x56315b90c40730925ec5485cf004d835058518A0"
|
|
1799
1799
|
}
|
|
1800
1800
|
},
|
|
@@ -1803,19 +1803,19 @@ const wn = {
|
|
|
1803
1803
|
blockCreated: 5022
|
|
1804
1804
|
},
|
|
1805
1805
|
portal: {
|
|
1806
|
-
[
|
|
1806
|
+
[qt]: {
|
|
1807
1807
|
address: "0x49048044D57e1C92A77f79988d21Fa8fAF74E97e",
|
|
1808
1808
|
blockCreated: 17482143
|
|
1809
1809
|
}
|
|
1810
1810
|
},
|
|
1811
1811
|
l1StandardBridge: {
|
|
1812
|
-
[
|
|
1812
|
+
[qt]: {
|
|
1813
1813
|
address: "0x3154Cf16ccdb4C6d922629664174b904d80F2C35",
|
|
1814
1814
|
blockCreated: 17482143
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
1817
|
},
|
|
1818
|
-
sourceId:
|
|
1818
|
+
sourceId: qt
|
|
1819
1819
|
});
|
|
1820
1820
|
({
|
|
1821
1821
|
...Is
|
|
@@ -1975,7 +1975,7 @@ function Yn(e) {
|
|
|
1975
1975
|
}
|
|
1976
1976
|
return "indexed" in e && e.indexed && (t = `${t} indexed`), e.name ? `${t} ${e.name}` : t;
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function Yt(e) {
|
|
1979
1979
|
let t = "";
|
|
1980
1980
|
const n = e.length;
|
|
1981
1981
|
for (let r = 0; r < n; r++) {
|
|
@@ -1985,7 +1985,7 @@ function qt(e) {
|
|
|
1985
1985
|
return t;
|
|
1986
1986
|
}
|
|
1987
1987
|
function Li(e) {
|
|
1988
|
-
return e.type === "function" ? `function ${e.name}(${
|
|
1988
|
+
return e.type === "function" ? `function ${e.name}(${Yt(e.inputs)})${e.stateMutability && e.stateMutability !== "nonpayable" ? ` ${e.stateMutability}` : ""}${e.outputs?.length ? ` returns (${Yt(e.outputs)})` : ""}` : e.type === "event" ? `event ${e.name}(${Yt(e.inputs)})` : e.type === "error" ? `error ${e.name}(${Yt(e.inputs)})` : e.type === "constructor" ? `constructor(${Yt(e.inputs)})${e.stateMutability === "payable" ? " payable" : ""}` : e.type === "fallback" ? `fallback() external${e.stateMutability === "payable" ? " payable" : ""}` : "receive() external payable";
|
|
1989
1989
|
}
|
|
1990
1990
|
function Hi(e) {
|
|
1991
1991
|
let t = !0, n = "", r = 0, s = "", a = !1;
|
|
@@ -2079,7 +2079,7 @@ function cr(e) {
|
|
|
2079
2079
|
const { dynamic: o, encoded: c } = e[a];
|
|
2080
2080
|
o ? (n.push(le(t + s, { size: 32 })), r.push(c), s += Ye(c)) : n.push(c);
|
|
2081
2081
|
}
|
|
2082
|
-
return
|
|
2082
|
+
return _t([...n, ...r]);
|
|
2083
2083
|
}
|
|
2084
2084
|
function qi(e) {
|
|
2085
2085
|
if (!Ve(e))
|
|
@@ -2108,7 +2108,7 @@ function Yi(e, { length: t, param: n }) {
|
|
|
2108
2108
|
const c = le(a.length, { size: 32 });
|
|
2109
2109
|
return {
|
|
2110
2110
|
dynamic: !0,
|
|
2111
|
-
encoded: a.length > 0 ?
|
|
2111
|
+
encoded: a.length > 0 ? _t([c, o]) : c
|
|
2112
2112
|
};
|
|
2113
2113
|
}
|
|
2114
2114
|
if (s)
|
|
@@ -2116,7 +2116,7 @@ function Yi(e, { length: t, param: n }) {
|
|
|
2116
2116
|
}
|
|
2117
2117
|
return {
|
|
2118
2118
|
dynamic: !1,
|
|
2119
|
-
encoded:
|
|
2119
|
+
encoded: _t(a.map(({ encoded: o }) => o))
|
|
2120
2120
|
};
|
|
2121
2121
|
}
|
|
2122
2122
|
function ji(e, { param: t }) {
|
|
@@ -2128,7 +2128,7 @@ function ji(e, { param: t }) {
|
|
|
2128
2128
|
size: Math.ceil((e.length - 2) / 2 / 32) * 32
|
|
2129
2129
|
})), {
|
|
2130
2130
|
dynamic: !0,
|
|
2131
|
-
encoded:
|
|
2131
|
+
encoded: _t([vt(le(r, { size: 32 })), s])
|
|
2132
2132
|
};
|
|
2133
2133
|
}
|
|
2134
2134
|
if (r !== Number.parseInt(n, 10))
|
|
@@ -2171,7 +2171,7 @@ function Ki(e) {
|
|
|
2171
2171
|
}));
|
|
2172
2172
|
return {
|
|
2173
2173
|
dynamic: !0,
|
|
2174
|
-
encoded:
|
|
2174
|
+
encoded: _t([
|
|
2175
2175
|
vt(le(Ye(t), { size: 32 })),
|
|
2176
2176
|
...r
|
|
2177
2177
|
])
|
|
@@ -2189,7 +2189,7 @@ function $i(e, { param: t }) {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
return {
|
|
2191
2191
|
dynamic: n,
|
|
2192
|
-
encoded: n ? cr(r) :
|
|
2192
|
+
encoded: n ? cr(r) : _t(r.map(({ encoded: s }) => s))
|
|
2193
2193
|
};
|
|
2194
2194
|
}
|
|
2195
2195
|
function Zi(e) {
|
|
@@ -2201,7 +2201,7 @@ function Zi(e) {
|
|
|
2201
2201
|
}
|
|
2202
2202
|
const Qi = Bs;
|
|
2203
2203
|
function ec(e) {
|
|
2204
|
-
const { abi: t, args: n = [], name: r } = e, s =
|
|
2204
|
+
const { abi: t, args: n = [], name: r } = e, s = Rt(r, { strict: !1 }), a = t.filter((c) => s ? c.type === "function" ? Ps(c) === r : c.type === "event" ? Qi(c) === r : !1 : "name" in c && c.name === r);
|
|
2205
2205
|
if (a.length === 0)
|
|
2206
2206
|
return;
|
|
2207
2207
|
if (a.length === 1)
|
|
@@ -2292,9 +2292,9 @@ class nc extends ue {
|
|
|
2292
2292
|
value: typeof h < "u" && `${pa(h)} ${s?.nativeCurrency?.symbol || "ETH"}`,
|
|
2293
2293
|
data: a,
|
|
2294
2294
|
gas: o,
|
|
2295
|
-
gasPrice: typeof c < "u" && `${
|
|
2296
|
-
maxFeePerGas: typeof T < "u" && `${
|
|
2297
|
-
maxPriorityFeePerGas: typeof I < "u" && `${
|
|
2295
|
+
gasPrice: typeof c < "u" && `${St(c)} gwei`,
|
|
2296
|
+
maxFeePerGas: typeof T < "u" && `${St(T)} gwei`,
|
|
2297
|
+
maxPriorityFeePerGas: typeof I < "u" && `${St(I)} gwei`,
|
|
2298
2298
|
nonce: P
|
|
2299
2299
|
});
|
|
2300
2300
|
k && (g += `
|
|
@@ -2316,20 +2316,20 @@ ${tc(k)}`), super(t.shortMessage, {
|
|
|
2316
2316
|
}
|
|
2317
2317
|
}
|
|
2318
2318
|
function rc(e, t) {
|
|
2319
|
-
const n = (e.details || "").toLowerCase(), r = e instanceof ue ? e.walk((s) => s?.code ===
|
|
2320
|
-
return r instanceof ue ? new
|
|
2319
|
+
const n = (e.details || "").toLowerCase(), r = e instanceof ue ? e.walk((s) => s?.code === Ft.code) : e;
|
|
2320
|
+
return r instanceof ue ? new Ft({
|
|
2321
2321
|
cause: e,
|
|
2322
2322
|
message: r.details
|
|
2323
|
-
}) :
|
|
2323
|
+
}) : Ft.nodeMessage.test(n) ? new Ft({
|
|
2324
2324
|
cause: e,
|
|
2325
2325
|
message: e.details
|
|
2326
|
-
}) :
|
|
2326
|
+
}) : Pt.nodeMessage.test(n) ? new Pt({
|
|
2327
2327
|
cause: e,
|
|
2328
2328
|
maxFeePerGas: t?.maxFeePerGas
|
|
2329
2329
|
}) : _n.nodeMessage.test(n) ? new _n({
|
|
2330
2330
|
cause: e,
|
|
2331
2331
|
maxFeePerGas: t?.maxFeePerGas
|
|
2332
|
-
}) : Rn.nodeMessage.test(n) ? new Rn({ cause: e, nonce: t?.nonce }) : Ln.nodeMessage.test(n) ? new Ln({ cause: e, nonce: t?.nonce }) : Hn.nodeMessage.test(n) ? new Hn({ cause: e, nonce: t?.nonce }) : Vn.nodeMessage.test(n) ? new Vn({ cause: e }) : Wn.nodeMessage.test(n) ? new Wn({ cause: e, gas: t?.gas }) : Gn.nodeMessage.test(n) ? new Gn({ cause: e, gas: t?.gas }) : zn.nodeMessage.test(n) ? new zn({ cause: e }) :
|
|
2332
|
+
}) : Rn.nodeMessage.test(n) ? new Rn({ cause: e, nonce: t?.nonce }) : Ln.nodeMessage.test(n) ? new Ln({ cause: e, nonce: t?.nonce }) : Hn.nodeMessage.test(n) ? new Hn({ cause: e, nonce: t?.nonce }) : Vn.nodeMessage.test(n) ? new Vn({ cause: e }) : Wn.nodeMessage.test(n) ? new Wn({ cause: e, gas: t?.gas }) : Gn.nodeMessage.test(n) ? new Gn({ cause: e, gas: t?.gas }) : zn.nodeMessage.test(n) ? new zn({ cause: e }) : Zt.nodeMessage.test(n) ? new Zt({
|
|
2333
2333
|
cause: e,
|
|
2334
2334
|
maxFeePerGas: t?.maxFeePerGas,
|
|
2335
2335
|
maxPriorityFeePerGas: t?.maxPriorityFeePerGas
|
|
@@ -2365,10 +2365,10 @@ function ac(e) {
|
|
|
2365
2365
|
throw new ct({ address: a.address });
|
|
2366
2366
|
if (s && !Ve(s))
|
|
2367
2367
|
throw new ct({ address: s });
|
|
2368
|
-
if (n && n >
|
|
2369
|
-
throw new
|
|
2368
|
+
if (n && n > Vt)
|
|
2369
|
+
throw new Pt({ maxFeePerGas: n });
|
|
2370
2370
|
if (r && n && r > n)
|
|
2371
|
-
throw new
|
|
2371
|
+
throw new Zt({ maxFeePerGas: n, maxPriorityFeePerGas: r });
|
|
2372
2372
|
}
|
|
2373
2373
|
async function ic(e, t) {
|
|
2374
2374
|
const { account: n = e.account } = t;
|
|
@@ -2499,7 +2499,7 @@ const lc = /* @__PURE__ */ mt({
|
|
|
2499
2499
|
blockCreated: 14353601
|
|
2500
2500
|
}
|
|
2501
2501
|
}
|
|
2502
|
-
}),
|
|
2502
|
+
}), jt = 1, uc = /* @__PURE__ */ mt({
|
|
2503
2503
|
...wn,
|
|
2504
2504
|
id: 10,
|
|
2505
2505
|
name: "OP Mainnet",
|
|
@@ -2519,12 +2519,12 @@ const lc = /* @__PURE__ */ mt({
|
|
|
2519
2519
|
contracts: {
|
|
2520
2520
|
...wn.contracts,
|
|
2521
2521
|
disputeGameFactory: {
|
|
2522
|
-
[
|
|
2522
|
+
[jt]: {
|
|
2523
2523
|
address: "0xe5965Ab5962eDc7477C8520243A95517CD252fA9"
|
|
2524
2524
|
}
|
|
2525
2525
|
},
|
|
2526
2526
|
l2OutputOracle: {
|
|
2527
|
-
[
|
|
2527
|
+
[jt]: {
|
|
2528
2528
|
address: "0xdfe97868233d1aa22e815a266982f2cf17685a27"
|
|
2529
2529
|
}
|
|
2530
2530
|
},
|
|
@@ -2533,17 +2533,17 @@ const lc = /* @__PURE__ */ mt({
|
|
|
2533
2533
|
blockCreated: 4286263
|
|
2534
2534
|
},
|
|
2535
2535
|
portal: {
|
|
2536
|
-
[
|
|
2536
|
+
[jt]: {
|
|
2537
2537
|
address: "0xbEb5Fc579115071764c7423A4f12eDde41f106Ed"
|
|
2538
2538
|
}
|
|
2539
2539
|
},
|
|
2540
2540
|
l1StandardBridge: {
|
|
2541
|
-
[
|
|
2541
|
+
[jt]: {
|
|
2542
2542
|
address: "0x99C9fc46f92E8a1c0deC1b1747d010903E884bE1"
|
|
2543
2543
|
}
|
|
2544
2544
|
}
|
|
2545
2545
|
},
|
|
2546
|
-
sourceId:
|
|
2546
|
+
sourceId: jt
|
|
2547
2547
|
}), fc = /* @__PURE__ */ mt({
|
|
2548
2548
|
id: 137,
|
|
2549
2549
|
name: "Polygon",
|
|
@@ -2588,11 +2588,11 @@ function pc(e) {
|
|
|
2588
2588
|
functionName: Ps(qn(s))
|
|
2589
2589
|
};
|
|
2590
2590
|
}
|
|
2591
|
-
function
|
|
2591
|
+
function kt(e) {
|
|
2592
2592
|
const { args: t } = e, { abi: n, functionName: r } = e.abi.length === 1 && e.functionName?.startsWith("0x") ? e : pc(e), s = n[0], a = r, o = "inputs" in s && s.inputs ? Gi(s.inputs, t ?? []) : void 0;
|
|
2593
|
-
return
|
|
2593
|
+
return Nt([a, o ?? "0x"]);
|
|
2594
2594
|
}
|
|
2595
|
-
const
|
|
2595
|
+
const At = {
|
|
2596
2596
|
1: {
|
|
2597
2597
|
...dc,
|
|
2598
2598
|
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png?v=024",
|
|
@@ -2722,13 +2722,13 @@ const tn = {
|
|
|
2722
2722
|
});
|
|
2723
2723
|
}, ut = (e) => new Promise((t) => setTimeout(t, e || 0)), hc = (e, t = 5, n = 5) => (e = e || "", e?.length <= t + n ? e : `${e.substr(0, t)}...${e.substr(e.length - n, n)}`), gc = (e) => {
|
|
2724
2724
|
if (!e) return "";
|
|
2725
|
-
const t =
|
|
2725
|
+
const t = At[e];
|
|
2726
2726
|
return t ? t.chainTypeMoralis : "";
|
|
2727
2727
|
}, bc = (e) => {
|
|
2728
2728
|
if (!e) return "";
|
|
2729
|
-
const t =
|
|
2729
|
+
const t = At[e];
|
|
2730
2730
|
return t ? t.chainType : "";
|
|
2731
|
-
},
|
|
2731
|
+
}, It = {
|
|
2732
2732
|
getItem(e) {
|
|
2733
2733
|
if (typeof window > "u") return null;
|
|
2734
2734
|
try {
|
|
@@ -2793,7 +2793,7 @@ function pt(e, t) {
|
|
|
2793
2793
|
r = r.padEnd(t, "0");
|
|
2794
2794
|
return BigInt(`${s ? "-" : ""}${n}${r}`);
|
|
2795
2795
|
}
|
|
2796
|
-
const yc = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", et = "0x0000000000000000000000000000000000000000", vc = ({ address: e,
|
|
2796
|
+
const yc = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", et = "0x0000000000000000000000000000000000000000", vc = ({ address: e, chainId: t }) => {
|
|
2797
2797
|
const [n, r] = qe(!1), s = Ne(() => {
|
|
2798
2798
|
if (!e) return;
|
|
2799
2799
|
const a = e, o = () => {
|
|
@@ -2810,8 +2810,24 @@ const yc = "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee", et = "0x000000000000000
|
|
|
2810
2810
|
}
|
|
2811
2811
|
}, [e]);
|
|
2812
2812
|
return /* @__PURE__ */ L(Kr, { children: Ve(e || "") && /* @__PURE__ */ we("div", { className: "chat-user-info", children: [
|
|
2813
|
-
t && /* @__PURE__ */ L("div", { className: "user-avatar", children: /* @__PURE__ */ L(
|
|
2814
|
-
|
|
2813
|
+
t && At[t]?.logo && /* @__PURE__ */ L("div", { className: "user-avatar", children: /* @__PURE__ */ L(
|
|
2814
|
+
"img",
|
|
2815
|
+
{
|
|
2816
|
+
src: At[t].logo || "",
|
|
2817
|
+
alt: "Chain",
|
|
2818
|
+
width: 20,
|
|
2819
|
+
height: 20
|
|
2820
|
+
}
|
|
2821
|
+
) }),
|
|
2822
|
+
/* @__PURE__ */ L("span", { className: "user-wallet", children: /* @__PURE__ */ L(
|
|
2823
|
+
"a",
|
|
2824
|
+
{
|
|
2825
|
+
href: At[t]?.blockExplorers?.default?.url + "/address/" + e,
|
|
2826
|
+
target: "_blank",
|
|
2827
|
+
rel: "noopener noreferrer",
|
|
2828
|
+
children: hc(e) || "Not connected"
|
|
2829
|
+
}
|
|
2830
|
+
) }),
|
|
2815
2831
|
/* @__PURE__ */ L(
|
|
2816
2832
|
"button",
|
|
2817
2833
|
{
|
|
@@ -2893,7 +2909,7 @@ const Sc = "chat_widget_messages", Us = Xn(
|
|
|
2893
2909
|
throw new Error("useConnect must be used within ConnectProvider");
|
|
2894
2910
|
return {
|
|
2895
2911
|
...e,
|
|
2896
|
-
chainData:
|
|
2912
|
+
chainData: At[e.account?.chainId] || void 0,
|
|
2897
2913
|
chainId: e.account?.chainId || void 0,
|
|
2898
2914
|
chainType: bc(e.account?.chainId || void 0),
|
|
2899
2915
|
chainTypeMoralis: gc(
|
|
@@ -2903,7 +2919,7 @@ const Sc = "chat_widget_messages", Us = Xn(
|
|
|
2903
2919
|
}, Ic = ({
|
|
2904
2920
|
children: e,
|
|
2905
2921
|
initialAccount: t
|
|
2906
|
-
}) => /* @__PURE__ */ L(Us.Provider, { value: { account: t || null }, children: e }), lr = Sc, zr = 200,
|
|
2922
|
+
}) => /* @__PURE__ */ L(Us.Provider, { value: { account: t || null }, children: e }), lr = Sc, zr = 200, Ut = [
|
|
2907
2923
|
{
|
|
2908
2924
|
id: Os(),
|
|
2909
2925
|
text: `**Welcome! 🚀**
|
|
@@ -2922,7 +2938,7 @@ function qr(e) {
|
|
|
2922
2938
|
}));
|
|
2923
2939
|
}
|
|
2924
2940
|
function Yr() {
|
|
2925
|
-
const e =
|
|
2941
|
+
const e = It.getItem(lr);
|
|
2926
2942
|
if (!e) return null;
|
|
2927
2943
|
try {
|
|
2928
2944
|
const t = JSON.parse(e);
|
|
@@ -2938,26 +2954,26 @@ function Yr() {
|
|
|
2938
2954
|
return null;
|
|
2939
2955
|
}
|
|
2940
2956
|
function ln(e, t) {
|
|
2941
|
-
|
|
2957
|
+
It.setItem(lr, JSON.stringify({ owner: e, messages: t }));
|
|
2942
2958
|
}
|
|
2943
2959
|
function Bc() {
|
|
2944
2960
|
const { account: e } = Jn(), t = Cc(e?.address, e?.chainId), [n, r] = qe(() => t || "pending"), [s, a] = qe(() => {
|
|
2945
2961
|
const P = Yr();
|
|
2946
|
-
return t ? P && P.owner === t ? P.messages :
|
|
2962
|
+
return t ? P && P.owner === t ? P.messages : Ut : P?.messages ?? Ut;
|
|
2947
2963
|
});
|
|
2948
2964
|
if (n === "pending" && t) {
|
|
2949
2965
|
const P = Yr();
|
|
2950
2966
|
P && P.owner === t ? a(P.messages) : ln(t, s), r(t);
|
|
2951
|
-
} else n !== "pending" && t && n !== t && (a(
|
|
2967
|
+
} else n !== "pending" && t && n !== t && (a(Ut), ln(t, Ut), r(t));
|
|
2952
2968
|
st(() => {
|
|
2953
2969
|
n !== "pending" && ln(n, s);
|
|
2954
2970
|
}, [s, n]), st(() => {
|
|
2955
2971
|
const P = [];
|
|
2956
|
-
for (let _ = 0; _ <
|
|
2957
|
-
const h =
|
|
2972
|
+
for (let _ = 0; _ < It.length; _++) {
|
|
2973
|
+
const h = It.key(_);
|
|
2958
2974
|
h && h.startsWith(lr + "_") && P.push(h);
|
|
2959
2975
|
}
|
|
2960
|
-
P.forEach((_) =>
|
|
2976
|
+
P.forEach((_) => It.removeItem(_));
|
|
2961
2977
|
}, []);
|
|
2962
2978
|
const o = (P, _, h, k, x) => {
|
|
2963
2979
|
const g = h ? s.find((de) => de.id === h) : void 0, C = {
|
|
@@ -2990,7 +3006,7 @@ function Bc() {
|
|
|
2990
3006
|
(h) => h.map((k) => k.id === P ? { ...k, text: _ } : k)
|
|
2991
3007
|
);
|
|
2992
3008
|
}, I = Ne(() => {
|
|
2993
|
-
a(
|
|
3009
|
+
a(Ut), ln(t, Ut);
|
|
2994
3010
|
}, [t]);
|
|
2995
3011
|
return {
|
|
2996
3012
|
messages: s,
|
|
@@ -3315,7 +3331,7 @@ function Ms(e) {
|
|
|
3315
3331
|
}
|
|
3316
3332
|
function se(i, l) {
|
|
3317
3333
|
for (var u, w, p = 1, v = new U(i[0]); p < i.length; p++)
|
|
3318
|
-
w = new U(i[p]), (!w.s || (u =
|
|
3334
|
+
w = new U(i[p]), (!w.s || (u = Et(v, w)) === l || u === 0 && v.s === l) && (v = w);
|
|
3319
3335
|
return v;
|
|
3320
3336
|
}
|
|
3321
3337
|
function ye(i, l, u) {
|
|
@@ -3389,7 +3405,7 @@ function Ms(e) {
|
|
|
3389
3405
|
var i = new U(this);
|
|
3390
3406
|
return i.s < 0 && (i.s = 1), i;
|
|
3391
3407
|
}, s.comparedTo = function(i, l) {
|
|
3392
|
-
return
|
|
3408
|
+
return Et(this, new U(i, l));
|
|
3393
3409
|
}, s.decimalPlaces = s.dp = function(i, l) {
|
|
3394
3410
|
var u, w, p, v = this;
|
|
3395
3411
|
if (i != null)
|
|
@@ -3436,19 +3452,19 @@ function Ms(e) {
|
|
|
3436
3452
|
var l = new U(this);
|
|
3437
3453
|
return i == null ? i = c : Oe(i, 0, 8), he(l, l.e + 1, i);
|
|
3438
3454
|
}, s.isEqualTo = s.eq = function(i, l) {
|
|
3439
|
-
return
|
|
3455
|
+
return Et(this, new U(i, l)) === 0;
|
|
3440
3456
|
}, s.isFinite = function() {
|
|
3441
3457
|
return !!this.c;
|
|
3442
3458
|
}, s.isGreaterThan = s.gt = function(i, l) {
|
|
3443
|
-
return
|
|
3459
|
+
return Et(this, new U(i, l)) > 0;
|
|
3444
3460
|
}, s.isGreaterThanOrEqualTo = s.gte = function(i, l) {
|
|
3445
|
-
return (l =
|
|
3461
|
+
return (l = Et(this, new U(i, l))) === 1 || l === 0;
|
|
3446
3462
|
}, s.isInteger = function() {
|
|
3447
3463
|
return !!this.c && nt(this.e / pe) > this.c.length - 2;
|
|
3448
3464
|
}, s.isLessThan = s.lt = function(i, l) {
|
|
3449
|
-
return
|
|
3465
|
+
return Et(this, new U(i, l)) < 0;
|
|
3450
3466
|
}, s.isLessThanOrEqualTo = s.lte = function(i, l) {
|
|
3451
|
-
return (l =
|
|
3467
|
+
return (l = Et(this, new U(i, l))) === -1 || l === 0;
|
|
3452
3468
|
}, s.isNaN = function() {
|
|
3453
3469
|
return !this.s;
|
|
3454
3470
|
}, s.isNegative = function() {
|
|
@@ -3610,7 +3626,7 @@ function Ze(e) {
|
|
|
3610
3626
|
for (s = a.length; a.charCodeAt(--s) === 48; ) ;
|
|
3611
3627
|
return a.slice(0, s + 1 || 1);
|
|
3612
3628
|
}
|
|
3613
|
-
function
|
|
3629
|
+
function Et(e, t) {
|
|
3614
3630
|
var n, r, s = e.c, a = t.c, o = e.s, c = t.s, T = e.e, I = t.e;
|
|
3615
3631
|
if (!o || !c) return null;
|
|
3616
3632
|
if (n = s && !s[0], r = a && !a[0], n || r) return n ? r ? 0 : -c : o;
|
|
@@ -3709,13 +3725,13 @@ const Fc = "https://deep-index.moralis.io";
|
|
|
3709
3725
|
function nn() {
|
|
3710
3726
|
return "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJub25jZSI6ImY4NmY0Yzc2LTA3MDQtNGEwZS04YTA0LWUwODllOGQxMGZjZCIsIm9yZ0lkIjoiMzk0MDAyIiwidXNlcklkIjoiNDA0ODUzIiwidHlwZUlkIjoiYjQyODExOTQtOGQ0Yi00NjkxLTlhZjItNjU4ODE2NzExYmRjIiwidHlwZSI6IlBST0pFQ1QiLCJpYXQiOjE3MTY4NjQyNTYsImV4cCI6NDg3MjYyNDI1Nn0.V8crfBIBardAnZkc05FD0hQIJBeZxMqvzRnYExVtnF8";
|
|
3711
3727
|
}
|
|
3712
|
-
function
|
|
3728
|
+
function Qt(e) {
|
|
3713
3729
|
return {
|
|
3714
3730
|
"X-API-Key": e,
|
|
3715
3731
|
Accept: "application/json"
|
|
3716
3732
|
};
|
|
3717
3733
|
}
|
|
3718
|
-
const
|
|
3734
|
+
const en = new An(Fc);
|
|
3719
3735
|
async function it(e) {
|
|
3720
3736
|
const {
|
|
3721
3737
|
address: t,
|
|
@@ -3733,11 +3749,11 @@ async function it(e) {
|
|
|
3733
3749
|
exclude_unverified_contracts: a ?? !1
|
|
3734
3750
|
};
|
|
3735
3751
|
r && (c.token_addresses = r);
|
|
3736
|
-
const I = (await
|
|
3752
|
+
const I = (await en.get(
|
|
3737
3753
|
`/api/v2.2/wallets/${encodeURIComponent(t)}/tokens`,
|
|
3738
3754
|
{
|
|
3739
3755
|
query: c,
|
|
3740
|
-
headers:
|
|
3756
|
+
headers: Qt(o)
|
|
3741
3757
|
}
|
|
3742
3758
|
)).data;
|
|
3743
3759
|
return I?.result?.length > 0 && (I.result = I.result.filter((P) => new ce(P?.balance || 0).gt(0)), I.result = I.result.map((P) => ({
|
|
@@ -3761,13 +3777,13 @@ async function Mc(e) {
|
|
|
3761
3777
|
throw new Error("Token address is required");
|
|
3762
3778
|
try {
|
|
3763
3779
|
const r = nn(), [s, a] = await Promise.allSettled([
|
|
3764
|
-
|
|
3780
|
+
en.get("/api/v2.2/erc20/metadata", {
|
|
3765
3781
|
query: { chain: n, addresses: [t] },
|
|
3766
|
-
headers:
|
|
3782
|
+
headers: Qt(r)
|
|
3767
3783
|
}),
|
|
3768
|
-
|
|
3784
|
+
en.get(`/api/v2.2/erc20/${encodeURIComponent(t)}/price`, {
|
|
3769
3785
|
query: { chain: n, include: "percent_change" },
|
|
3770
|
-
headers:
|
|
3786
|
+
headers: Qt(r)
|
|
3771
3787
|
})
|
|
3772
3788
|
]), o = s.status === "fulfilled" ? s.value.data : [];
|
|
3773
3789
|
if (!o || o.length === 0)
|
|
@@ -3839,11 +3855,11 @@ async function Rc(e) {
|
|
|
3839
3855
|
const r = nn();
|
|
3840
3856
|
return {
|
|
3841
3857
|
success: !0,
|
|
3842
|
-
data: (await
|
|
3858
|
+
data: (await en.get(
|
|
3843
3859
|
`/api/v2.2/nft/${encodeURIComponent(t)}/metadata`,
|
|
3844
3860
|
{
|
|
3845
3861
|
query: { chain: n },
|
|
3846
|
-
headers:
|
|
3862
|
+
headers: Qt(r)
|
|
3847
3863
|
}
|
|
3848
3864
|
)).data
|
|
3849
3865
|
};
|
|
@@ -3876,11 +3892,11 @@ async function Lc(e) {
|
|
|
3876
3892
|
};
|
|
3877
3893
|
return a && (c.cursor = a), {
|
|
3878
3894
|
success: !0,
|
|
3879
|
-
data: (await
|
|
3895
|
+
data: (await en.get(
|
|
3880
3896
|
`/api/v2.2/${encodeURIComponent(t)}/nft`,
|
|
3881
3897
|
{
|
|
3882
3898
|
query: c,
|
|
3883
|
-
headers:
|
|
3899
|
+
headers: Qt(o)
|
|
3884
3900
|
}
|
|
3885
3901
|
)).data
|
|
3886
3902
|
};
|
|
@@ -4644,7 +4660,7 @@ const Jc = {
|
|
|
4644
4660
|
};
|
|
4645
4661
|
function $c(e) {
|
|
4646
4662
|
const { walletAddress: t, chainName: n, chainId: r, nativeSymbol: s } = e;
|
|
4647
|
-
return t ? t && !
|
|
4663
|
+
return t ? t && !At[r] ? `You are a Web3 wallet assistant for the Keyring crypto EVM wallet app.
|
|
4648
4664
|
The user's wallet address is: ${t}
|
|
4649
4665
|
The user is selected on (chainId: ${r}) an UNSUPPORTED chain.
|
|
4650
4666
|
|
|
@@ -5001,7 +5017,7 @@ const _s = {
|
|
|
5001
5017
|
}
|
|
5002
5018
|
];
|
|
5003
5019
|
function rn(e, t) {
|
|
5004
|
-
return t ||
|
|
5020
|
+
return t || At[e]?.rpcUrls?.default?.http?.[0];
|
|
5005
5021
|
}
|
|
5006
5022
|
function el(e) {
|
|
5007
5023
|
const { action: t, parameters: n, fromAddress: r, chainId: s } = e;
|
|
@@ -5041,7 +5057,7 @@ function nl(e, t, n) {
|
|
|
5041
5057
|
if (!r) throw new Error("Token contract address is required");
|
|
5042
5058
|
if (!s) throw new Error("Recipient address is required");
|
|
5043
5059
|
if (!a) throw new Error("Amount is required");
|
|
5044
|
-
const T = parseInt(o) || 18, I = pt(a, T), P =
|
|
5060
|
+
const T = parseInt(o) || 18, I = pt(a, T), P = kt({
|
|
5045
5061
|
abi: kn,
|
|
5046
5062
|
functionName: "transfer",
|
|
5047
5063
|
args: [s, I]
|
|
@@ -5059,7 +5075,7 @@ function rl(e, t, n) {
|
|
|
5059
5075
|
const { contract_address: r, spender_address: s, amount: a, token_symbol: o } = e;
|
|
5060
5076
|
if (!r) throw new Error("Token contract address is required");
|
|
5061
5077
|
if (!s) throw new Error("Spender address is required");
|
|
5062
|
-
const c = a && a?.trim() !== "" ? pt(a, 18) :
|
|
5078
|
+
const c = a && a?.trim() !== "" ? pt(a, 18) : Vt, T = kt({
|
|
5063
5079
|
abi: kn,
|
|
5064
5080
|
functionName: "approve",
|
|
5065
5081
|
args: [s, c]
|
|
@@ -5078,7 +5094,7 @@ function sl(e, t, n) {
|
|
|
5078
5094
|
if (!r) throw new Error("Amount is required");
|
|
5079
5095
|
const s = _s[n];
|
|
5080
5096
|
if (!s) throw new Error(`WETH not supported on chain ${n}`);
|
|
5081
|
-
const a = pt(r, 18).toString(), o =
|
|
5097
|
+
const a = pt(r, 18).toString(), o = kt({
|
|
5082
5098
|
abi: Rs,
|
|
5083
5099
|
functionName: "deposit"
|
|
5084
5100
|
});
|
|
@@ -5096,7 +5112,7 @@ function ol(e, t, n) {
|
|
|
5096
5112
|
if (!r) throw new Error("Amount is required");
|
|
5097
5113
|
const s = _s[n];
|
|
5098
5114
|
if (!s) throw new Error(`WETH not supported on chain ${n}`);
|
|
5099
|
-
const a = pt(r, 18), o =
|
|
5115
|
+
const a = pt(r, 18), o = kt({
|
|
5100
5116
|
abi: Rs,
|
|
5101
5117
|
functionName: "withdraw",
|
|
5102
5118
|
args: [a]
|
|
@@ -5172,7 +5188,7 @@ async function Dn(e) {
|
|
|
5172
5188
|
if (!o)
|
|
5173
5189
|
return console.warn(`No RPC endpoint for chain ${s}, assuming no allowance`), BigInt(0);
|
|
5174
5190
|
try {
|
|
5175
|
-
const c =
|
|
5191
|
+
const c = kt({
|
|
5176
5192
|
abi: kn,
|
|
5177
5193
|
functionName: "allowance",
|
|
5178
5194
|
args: [n, r]
|
|
@@ -5192,10 +5208,10 @@ async function Dn(e) {
|
|
|
5192
5208
|
}
|
|
5193
5209
|
}
|
|
5194
5210
|
function fn(e) {
|
|
5195
|
-
const { tokenAddress: t, spenderAddress: n, fromAddress: r, chainId: s, tokenSymbol: a } = e, o =
|
|
5211
|
+
const { tokenAddress: t, spenderAddress: n, fromAddress: r, chainId: s, tokenSymbol: a } = e, o = kt({
|
|
5196
5212
|
abi: kn,
|
|
5197
5213
|
functionName: "approve",
|
|
5198
|
-
args: [n,
|
|
5214
|
+
args: [n, Vt]
|
|
5199
5215
|
});
|
|
5200
5216
|
return {
|
|
5201
5217
|
from: r,
|
|
@@ -5222,7 +5238,7 @@ function il(e, t, n) {
|
|
|
5222
5238
|
let _, h;
|
|
5223
5239
|
if (I === "ERC1155") {
|
|
5224
5240
|
const k = BigInt(c || "1");
|
|
5225
|
-
_ =
|
|
5241
|
+
_ = kt({
|
|
5226
5242
|
abi: Qc,
|
|
5227
5243
|
functionName: "safeTransferFrom",
|
|
5228
5244
|
args: [
|
|
@@ -5234,7 +5250,7 @@ function il(e, t, n) {
|
|
|
5234
5250
|
]
|
|
5235
5251
|
}), h = `Send ${k > 1n ? k.toString() + "x " : ""}${T || "NFT"} (ERC1155 #${s}) to ${a}`;
|
|
5236
5252
|
} else
|
|
5237
|
-
_ =
|
|
5253
|
+
_ = kt({
|
|
5238
5254
|
abi: Zc,
|
|
5239
5255
|
functionName: "safeTransferFrom",
|
|
5240
5256
|
args: [t, a, P]
|
|
@@ -5268,7 +5284,7 @@ async function pn(e) {
|
|
|
5268
5284
|
return console.warn("getNativeBalance failed:", a), new ce(0);
|
|
5269
5285
|
}
|
|
5270
5286
|
}
|
|
5271
|
-
async function
|
|
5287
|
+
async function Jt(e) {
|
|
5272
5288
|
const { from: t, to: n, data: r, value: s, chainId: a, rpcUrl: o } = e, c = rn(a, o);
|
|
5273
5289
|
if (!c)
|
|
5274
5290
|
return console.warn(`No RPC endpoint for chain ${a}`), new ce(0);
|
|
@@ -5330,7 +5346,7 @@ async function Fn(e) {
|
|
|
5330
5346
|
return console.warn("getGasPrice failed:", s), new ce(0);
|
|
5331
5347
|
}
|
|
5332
5348
|
}
|
|
5333
|
-
var ne = {},
|
|
5349
|
+
var ne = {}, Xt = { exports: {} }, cl = Xt.exports, Jr;
|
|
5334
5350
|
function ll() {
|
|
5335
5351
|
return Jr || (Jr = 1, (function(e, t) {
|
|
5336
5352
|
(function(n, r) {
|
|
@@ -5411,7 +5427,7 @@ function ll() {
|
|
|
5411
5427
|
};
|
|
5412
5428
|
}
|
|
5413
5429
|
})(typeof window == "object" ? window : cl);
|
|
5414
|
-
})(
|
|
5430
|
+
})(Xt, Xt.exports)), Xt.exports;
|
|
5415
5431
|
}
|
|
5416
5432
|
var Xr;
|
|
5417
5433
|
function dl() {
|
|
@@ -5845,19 +5861,19 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5845
5861
|
}, ot = function(d) {
|
|
5846
5862
|
var f = d.version;
|
|
5847
5863
|
return W(f);
|
|
5848
|
-
},
|
|
5864
|
+
}, xt = function(d) {
|
|
5849
5865
|
var f = d.major;
|
|
5850
5866
|
return W(f);
|
|
5851
5867
|
}, lt = function(d) {
|
|
5852
5868
|
var f = d.name;
|
|
5853
5869
|
return W(f);
|
|
5854
|
-
},
|
|
5870
|
+
}, Wt = function(d) {
|
|
5855
5871
|
var f = d.name;
|
|
5856
5872
|
return W(f);
|
|
5857
|
-
},
|
|
5873
|
+
}, Gt = function(d) {
|
|
5858
5874
|
var f = d.version;
|
|
5859
5875
|
return W(f);
|
|
5860
|
-
},
|
|
5876
|
+
}, Ot = function() {
|
|
5861
5877
|
var d = ge(), f = d && d.userAgent && d.userAgent.toLowerCase();
|
|
5862
5878
|
return typeof f == "string" ? /electron/.test(f) : !1;
|
|
5863
5879
|
}, Pe = function(d) {
|
|
@@ -5899,12 +5915,12 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5899
5915
|
osVersion: D(R),
|
|
5900
5916
|
osName: V(R),
|
|
5901
5917
|
fullBrowserVersion: ot(B),
|
|
5902
|
-
browserVersion:
|
|
5918
|
+
browserVersion: xt(B),
|
|
5903
5919
|
browserName: lt(B),
|
|
5904
5920
|
mobileVendor: K(f),
|
|
5905
5921
|
mobileModel: X(f),
|
|
5906
|
-
engineName:
|
|
5907
|
-
engineVersion:
|
|
5922
|
+
engineName: Wt(be),
|
|
5923
|
+
engineVersion: Gt(be),
|
|
5908
5924
|
getUA: fr(De),
|
|
5909
5925
|
isEdge: ie(B) || Pe(De),
|
|
5910
5926
|
isYandex: G(B),
|
|
@@ -5913,7 +5929,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5913
5929
|
isIPad13: $e(),
|
|
5914
5930
|
isIPhone13: dr(),
|
|
5915
5931
|
isIPod13: ur(),
|
|
5916
|
-
isElectron:
|
|
5932
|
+
isElectron: Ot(),
|
|
5917
5933
|
isEdgeChromium: Pe(De),
|
|
5918
5934
|
isLegacyEdge: ie(B) && !Pe(De),
|
|
5919
5935
|
isWindows: fe(R),
|
|
@@ -5922,7 +5938,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
5922
5938
|
isSamsungBrowser: Ke(B)
|
|
5923
5939
|
};
|
|
5924
5940
|
}
|
|
5925
|
-
var mr = H(c), hr = q(c), gr = ee(c), Ls = z(c), Hs = ve(a) || $e(), Vs = oe(a), on = re(c) || $e(), br = Ee(c), wr = F(c) || $e(), yr = Q(c), Ws = Q(c), vr = $(I), Ar = Ae(I), kr = ke(I) || $e(), Gs = M(a), zs = Y(a), qs = J(a), Ys = Se(a), xr = Be(a), js = D(I), Js = V(I), Xs = ot(a), Ks =
|
|
5941
|
+
var mr = H(c), hr = q(c), gr = ee(c), Ls = z(c), Hs = ve(a) || $e(), Vs = oe(a), on = re(c) || $e(), br = Ee(c), wr = F(c) || $e(), yr = Q(c), Ws = Q(c), vr = $(I), Ar = Ae(I), kr = ke(I) || $e(), Gs = M(a), zs = Y(a), qs = J(a), Ys = Se(a), xr = Be(a), js = D(I), Js = V(I), Xs = ot(a), Ks = xt(a), $s = lt(a), Zs = K(c), Qs = X(c), eo = Wt(T), to = Gt(T), no = fr(P), ro = ie(a) || Pe(P), so = G(a), oo = O(c), ao = sn(), io = $e(), co = dr(), lo = ur(), uo = Ot(), fo = Pe(P), po = ie(a) && !Pe(P), mo = fe(I), ho = ae(I), go = Je(a), bo = Ke(a), wo = function(d) {
|
|
5926
5942
|
if (!d || typeof d != "string") {
|
|
5927
5943
|
console.error("No valid user agent string was provided");
|
|
5928
5944
|
return;
|
|
@@ -6080,14 +6096,14 @@ const ul = ({
|
|
|
6080
6096
|
}) => {
|
|
6081
6097
|
const { language: s } = Uc();
|
|
6082
6098
|
console.log("🚀 ~ ChatModal ~ language:", s);
|
|
6083
|
-
const { messages: a, addMessage: o, updateMessageAction: c, updateMessageText: T } = Bc(), [I, P] = qe(""), [_, h] = qe(!1), [k, x] = qe(!0), [g, C] = qe(null), de =
|
|
6099
|
+
const { messages: a, addMessage: o, updateMessageAction: c, updateMessageText: T } = Bc(), [I, P] = qe(""), [_, h] = qe(!1), [k, x] = qe(!0), [g, C] = qe(null), de = Tt(null), U = Tt(null), Z = Tt(null), se = Tt(null), ye = Tt(null), he = Tt(!1), Ce = Tt(k);
|
|
6084
6100
|
st(() => {
|
|
6085
6101
|
Ce.current = k;
|
|
6086
6102
|
}, [k]);
|
|
6087
6103
|
const { account: i, chainData: l, chainType: u, chainTypeMoralis: w, chainId: p } = Jn(), v = Jn();
|
|
6088
6104
|
console.log("🚀 ~ ChatModal ~ connect:", v);
|
|
6089
6105
|
const { config: S } = Pc(), m = p && S?.rpcUrls?.[p] || void 0, b = Ne(() => {
|
|
6090
|
-
const F =
|
|
6106
|
+
const F = It.getItem("dataBuyToken");
|
|
6091
6107
|
if (F)
|
|
6092
6108
|
try {
|
|
6093
6109
|
return JSON.parse(F);
|
|
@@ -6109,7 +6125,7 @@ const ul = ({
|
|
|
6109
6125
|
};
|
|
6110
6126
|
}, []), E = Ne(
|
|
6111
6127
|
(F) => {
|
|
6112
|
-
|
|
6128
|
+
It.setItem("dataBuyToken", JSON.stringify(F));
|
|
6113
6129
|
},
|
|
6114
6130
|
[]
|
|
6115
6131
|
), y = Ne(
|
|
@@ -6291,7 +6307,7 @@ Available: ${q} ${re}`,
|
|
|
6291
6307
|
fromAddress: i.address,
|
|
6292
6308
|
chainId: p
|
|
6293
6309
|
});
|
|
6294
|
-
Ae = await
|
|
6310
|
+
Ae = await Jt({
|
|
6295
6311
|
from: i.address,
|
|
6296
6312
|
to: oe.to,
|
|
6297
6313
|
data: oe.data,
|
|
@@ -6583,9 +6599,9 @@ Error: ${O.error}` : "";
|
|
|
6583
6599
|
}
|
|
6584
6600
|
}));
|
|
6585
6601
|
o(
|
|
6586
|
-
|
|
6602
|
+
`Swap ${fe} → ${ee}
|
|
6587
6603
|
|
|
6588
|
-
|
|
6604
|
+
Select the amount of ${fe} to swap:
|
|
6589
6605
|
|
|
6590
6606
|
Available: ${ae} ${fe}`,
|
|
6591
6607
|
"bot",
|
|
@@ -7116,7 +7132,7 @@ ${q}`);
|
|
|
7116
7132
|
fromAddress: i.address,
|
|
7117
7133
|
chainId: p
|
|
7118
7134
|
});
|
|
7119
|
-
ot = await
|
|
7135
|
+
ot = await Jt({
|
|
7120
7136
|
from: i.address,
|
|
7121
7137
|
to: Pe.to,
|
|
7122
7138
|
data: Pe.data,
|
|
@@ -7126,23 +7142,23 @@ ${q}`);
|
|
|
7126
7142
|
} catch (Pe) {
|
|
7127
7143
|
console.warn("Approve fee estimation failed:", Pe);
|
|
7128
7144
|
}
|
|
7129
|
-
const
|
|
7130
|
-
let
|
|
7131
|
-
if (i?.address &&
|
|
7145
|
+
const xt = Ke.plus(ot), lt = l?.nativeCurrency?.symbol || "native";
|
|
7146
|
+
let Wt = "", Gt = !1;
|
|
7147
|
+
if (i?.address && xt.isGreaterThan(0))
|
|
7132
7148
|
try {
|
|
7133
7149
|
const Pe = await pn({
|
|
7134
7150
|
address: i.address,
|
|
7135
7151
|
chainId: p,
|
|
7136
7152
|
rpcUrl: m
|
|
7137
7153
|
});
|
|
7138
|
-
if (Pe.isLessThan(
|
|
7139
|
-
|
|
7154
|
+
if (Pe.isLessThan(xt)) {
|
|
7155
|
+
Gt = !0;
|
|
7140
7156
|
const sn = ce(
|
|
7141
7157
|
Fe(BigInt(Pe.toFixed(0)), 18)
|
|
7142
7158
|
).decimalPlaces(6).toFormat(), $e = ce(
|
|
7143
|
-
Fe(BigInt(
|
|
7159
|
+
Fe(BigInt(xt.toFixed(0)), 18)
|
|
7144
7160
|
).decimalPlaces(6).toFormat();
|
|
7145
|
-
|
|
7161
|
+
Wt = `
|
|
7146
7162
|
⚠️ **Insufficient ${lt} for fees!**
|
|
7147
7163
|
You have ${sn} ${lt} but need ~${$e} ${lt}.
|
|
7148
7164
|
`;
|
|
@@ -7150,14 +7166,14 @@ ${q}`);
|
|
|
7150
7166
|
} catch (Pe) {
|
|
7151
7167
|
console.warn("Fee balance check failed:", Pe);
|
|
7152
7168
|
}
|
|
7153
|
-
const
|
|
7169
|
+
const Ot = `From: ${Se} ${J.symbol}
|
|
7154
7170
|
⬇️
|
|
7155
7171
|
To: ${Be} ${ve.symbol}
|
|
7156
7172
|
|
|
7157
|
-
` +
|
|
7173
|
+
` + Wt + `
|
|
7158
7174
|
`;
|
|
7159
|
-
if (
|
|
7160
|
-
o(
|
|
7175
|
+
if (Gt)
|
|
7176
|
+
o(Ot, "bot");
|
|
7161
7177
|
else if (Je) {
|
|
7162
7178
|
const Pe = [
|
|
7163
7179
|
{
|
|
@@ -7175,7 +7191,7 @@ To: ${Be} ${ve.symbol}
|
|
|
7175
7191
|
}
|
|
7176
7192
|
];
|
|
7177
7193
|
o(
|
|
7178
|
-
|
|
7194
|
+
Ot + `You need to approve ${J.symbol} first before swapping.`,
|
|
7179
7195
|
"bot",
|
|
7180
7196
|
void 0,
|
|
7181
7197
|
Pe
|
|
@@ -7191,7 +7207,7 @@ To: ${Be} ${ve.symbol}
|
|
|
7191
7207
|
}
|
|
7192
7208
|
];
|
|
7193
7209
|
o(
|
|
7194
|
-
|
|
7210
|
+
Ot + "Ready to proceed with the swap?",
|
|
7195
7211
|
"bot",
|
|
7196
7212
|
void 0,
|
|
7197
7213
|
Pe
|
|
@@ -7531,7 +7547,7 @@ Available: ${G.balance_formatted} ${G.symbol} (~$${G.usd_value?.toFixed(2) || "0
|
|
|
7531
7547
|
try {
|
|
7532
7548
|
const ie = new ce(
|
|
7533
7549
|
M.balance
|
|
7534
|
-
), G = "0x" + BigInt(ie.toFixed(0)).toString(16), J = await
|
|
7550
|
+
), G = "0x" + BigInt(ie.toFixed(0)).toString(16), J = await Jt({
|
|
7535
7551
|
from: i.address,
|
|
7536
7552
|
to: i.address,
|
|
7537
7553
|
data: "0x",
|
|
@@ -7732,7 +7748,7 @@ Available: ${G.balance_formatted} ${G.symbol} (~$${G.usd_value?.toFixed(2) || "0
|
|
|
7732
7748
|
fromAddress: i.address,
|
|
7733
7749
|
chainId: p
|
|
7734
7750
|
});
|
|
7735
|
-
ke = await
|
|
7751
|
+
ke = await Jt({
|
|
7736
7752
|
from: i.address,
|
|
7737
7753
|
to: ie.to,
|
|
7738
7754
|
data: ie.data,
|
|
@@ -7836,7 +7852,7 @@ Step 2: Confirm Swap`,
|
|
|
7836
7852
|
};
|
|
7837
7853
|
if ((F === "send_token" || F === "send_native" || F === "send_nft") && i?.address)
|
|
7838
7854
|
try {
|
|
7839
|
-
const q = l?.nativeCurrency?.symbol || "native", z = await
|
|
7855
|
+
const q = l?.nativeCurrency?.symbol || "native", z = await Jt({
|
|
7840
7856
|
from: Q.from,
|
|
7841
7857
|
to: Q.to,
|
|
7842
7858
|
data: Q.data,
|
|
@@ -7995,7 +8011,7 @@ Error: ${q.error}` : "";
|
|
|
7995
8011
|
vc,
|
|
7996
8012
|
{
|
|
7997
8013
|
address: i?.address,
|
|
7998
|
-
|
|
8014
|
+
chainId: l?.chainId
|
|
7999
8015
|
}
|
|
8000
8016
|
),
|
|
8001
8017
|
/* @__PURE__ */ we("div", { className: "chat-modal-messages-wrapper", children: [
|