@ada-anvil/weld-plugin-hodei 0.0.2 → 0.0.4
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/cdn.min.js +2 -2
- package/lib.cjs +1 -1
- package/lib.js +22 -18
- package/package.json +23 -32
- package/{lib.d.ts → types/lib.d.ts} +30 -35
package/cdn.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var HodeiPlugin=(function(f,w){"use strict";async function U(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network],o=new URL(`${t}/wallets/utxos`);return o.searchParams.set("address",e.address),o.searchParams.set("includeMempool","true"),(await fetch(o,{headers:{"x-api-key":n}})).json()}async function A(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network],o=new URL(`${t}/wallets/balance`);return o.searchParams.set("address",e.address),(await fetch(o,{headers:{"x-api-key":n}})).json()}async function P(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network];return(await fetch(`${t}/transactions/submit`,{method:"POST",headers:{"x-api-key":n,"content-type":"application/json"},body:JSON.stringify({transaction:e.transaction,signatures:e.signature?[e.signature]:[]})})).json()}const y="hodei-token";function k(){return localStorage.getItem(y)??void 0}function $(e){localStorage.setItem(y,e)}function E(){localStorage.removeItem(y)}function b(){let e="pending",t=()=>{},n=()=>{};const o=new Promise((u,d)=>{t=l=>{e="resolved",u(l)},n=l=>{e="rejected",d(l)}});return{status:e,promise:o,resolve:t,reject:n}}function g(e){if(e){if((e instanceof Error||_(e,"message"))&&typeof e.message=="string"&&e.message.length>0)return e.message;if(_(e,"data")&&_(e.data,"message")&&typeof e.data.message=="string"&&e.data.message.length>0)return e.data.message;if(typeof e=="string"&&e.length>0)return e}}function _(e,t){return typeof e=="object"&&e!==null&&t in e}class H{_config;_onStateChange;_debug;_connectPromise;_connection;constructor(t){this._config=t.config,this._onStateChange=t.onStateChange,this._debug=t.config?.debug??!1}setDebug(t){this._debug=t}debugLog(...t){if(!this._debug)return;let n="[HODEI]";this.connection&&(n+=` (${this.connection.id})`),console.log(n,...t)}get connection(){return this._connection}isConnected(){return this.connection?.state.status==="paired"||this.connection?.state.status==="pairing"}async connect(){if(this._connectPromise)return this._connectPromise;if(this.isConnected())return this.connection.state;this._connectPromise=this._connect();try{return await this._connectPromise}finally{this._connectPromise=void 0}}disconnect(){this._connection?.ws.close(1e3,"disconnected"),this._connection=void 0}unlink(){this.send({type:"client.session_unlinked",payload:{}})}getState(){return this.connection?.state}async _connect(){this.disconnect();const t=this._config.bridge.baseUrl.replace("http","ws"),n=new URL(`${t}/client/ws`),o=await this._getToken();o&&n.searchParams.set("token",o);const u=(this.connection?.id??0)+1,d=new WebSocket(n),l=new AbortController,s=b();this.debugLog("connecting"),d.addEventListener("message",r=>{try{const i=JSON.parse(r.data);T(i),this.debugLog("received connection message"),s.resolve(i.payload)}catch(i){s.reject(`Error parsing connection message ${r.data}: ${g(i)}`)}finally{l.abort()}},{signal:l.signal}),d.addEventListener("error",r=>{this.debugLog("received connection error"),s.reject(`Error connecting: ${g(r)}`),l.abort()},{signal:l.signal});try{const r=await s.promise;this.debugLog("connected"),$(r.token);const i={id:u,ws:d,state:r,controller:new AbortController};return this._connection=i,this._onStateChange(i.state),d.addEventListener("message",a=>{try{if(i.state.status==="error")throw new Error("Received message after error");if(i.state.status==="closed")throw new Error("Received message after closed");const c=JSON.parse(a.data);L(c),c.type==="client.wallet_updated"&&(this.debugLog("received wallet_updated message"),i.state={...c.payload,status:"paired",sessionId:i.state.sessionId,token:i.state.token},this._onStateChange(i.state))}catch(c){this.debugLog(`error parsing message ${a.data}: ${g(c)}`)}},{signal:i.controller.signal}),d.addEventListener("error",a=>{if(this._scheduleReconnect()){this.debugLog("scheduled reconnect after error");return}this.debugLog(`received error: ${g(a)}`),i.state={status:"error",error:g(a)},this._onStateChange(i.state),i.controller.abort()},{signal:i.controller.signal}),d.addEventListener("close",async a=>{if(a.code===4001&&(this.debugLog("session deleted"),E()),a.code!==1e3&&this._scheduleReconnect()){this.debugLog("scheduled reconnect after close");return}this.debugLog(`received close: ${a.code} ${a.reason}`),i.state={status:"closed",reason:a.reason,code:a.code},this._onStateChange(i.state),i.controller.abort()},{signal:i.controller.signal}),this._attempts=0,r}catch(r){throw d.close(void 0,`failed to connect: ${g(r)}`),r}}send(t){this.connection?.ws.send(JSON.stringify(t))}_attempts=0;_reconnectTimer;_scheduleReconnect(){this._reconnectTimer&&(this.debugLog("clearing reconnect timer"),clearTimeout(this._reconnectTimer)),this._attempts=Math.min(this._attempts+1,5);const t=2**this._attempts*1e3;this.debugLog(`reconnecting in ${t/1e3}s`);const n=setTimeout(()=>{if(this._reconnectTimer!==n){this.debugLog("reconnect timer cleared. ignoring");return}this.debugLog("reconnecting"),this._reconnectTimer=void 0,this._connect().catch(()=>this._scheduleReconnect())},t);return this._reconnectTimer=n,!0}async _getToken(){const t=k();if(!t)return;const n=await C({config:this._config,token:t});if(this.debugLog(`checked token: ${n.valid?"valid":`invalid: ${n.reason}`}`),n.valid)return t;if(n.reason==="alreadyConnected")throw new Error("Already connected");n.reason==="notFound"&&E()}}async function C(e){const t=new URL(`${e.config.bridge.baseUrl}/client/check`),n=await fetch(t,{method:"POST",headers:{Authorization:`Bearer ${e.token}`}});return n.status===404?{valid:!1,reason:"notFound"}:n.status===409?{valid:!1,reason:"alreadyConnected"}:{valid:!0,token:e.token}}function h(e){return typeof e=="object"&&e!==null}function I(e){return h(e)&&(e.status==="pairing"||e.status==="paired")}function T(e){if(!h(e)||e.type!=="client.connected"||!I(e.payload))throw new Error("Invalid connected message")}const D=new Set(["client.wallet_updated","client.sig_req_accepted","client.sig_req_rejected"]);function L(e){if(!h(e)||typeof e.type!="string"||!D.has(e.type))throw new Error("Invalid incoming message")}function j(e){if(!h(e)||e.type!=="client.sig_req_accepted"&&e.type!=="client.sig_req_rejected")throw new Error("Invalid sig req response")}const O=new Set(["pairing","paired","closed","error"]);function q(e){return h(e)&&typeof e.status=="string"&&O.has(e.status)}function v(e,t){e.dispatchEvent(new CustomEvent("command",{detail:t}))}function S(e,t,n){const o=u=>{const d=R(u);d&&t(d)};return e.addEventListener("command",o,n),()=>{e.removeEventListener("command",o,n)}}function R(e){if(e instanceof CustomEvent)return W(e.detail)?e.detail:void 0}const z=new Set(["disconnecting","disconnected","unlinked","dialog_closed"]);function W(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.type!="string"?!1:z.has(t.type)?!0:t.type==="state_changed"&&q(t.payload)}const N={bridge:{baseUrl:"https://bridge.hodei.io/api/dev"},anvil:{mainnet:{baseUrl:"https://prod.api.ada-anvil.app/v2/services",apiKey:"mainnet_IIrhwohjiEAJ2LFOgI8p5F735xz4C6XsgH6KfzpC"},preprod:{baseUrl:"https://preprod.api.ada-anvil.app/v2/services",apiKey:"testnet_C301LOscFsUccwR4zCqEtTJvizEAUc3AaVhRDdcY"}},debug:!1,waitForPairing:!0,onError:({error:e})=>console.error("[HODEI] unhandled error:",e??"unknown"),onClose:({code:e,reason:t})=>console.error("[HODEI] unhandled closure:",e,t)},J={refused:1,failure:2};function M(e,t){return{code:J[e],info:g(t)??"unknown"}}const F={invalidRequest:-1,internalError:-2,refused:-3,accountChange:-4};function p(e,t){return{code:F[e],info:g(t)??"unknown"}}const K={proofGeneration:1,userDeclined:2};function G(e,t){let n=g(t)??"unknown";for(const o of["ProofGeneration: ","UserDeclined: "])if(n.startsWith(o)){n=n.slice(o.length);break}return n==="UserDeclined"&&(n="User declined"),n==="ProofGeneration"&&(n="Unable to sign the transaction"),{code:K[e],info:n}}function B(e){if(!(typeof window>"u"))return window.cardano||(window.cardano={}),window.cardano.hodei||(window.cardano.hodei=V(e)),window.cardano.hodei}function V(e={}){const t={config:{...N,...e}},n=async o=>{await t.promise?.catch(()=>{}),o.status==="error"&&t.config.onError(o),o.status==="closed"&&t.config.onClose(o),o.status==="paired"&&t.config.onWalletUpdate?.({baseAddress:o.baseAddress,stakeAddress:o.stakeAddress,network:o.network}),t.resolved?t.resolved?.client.sendCommand({sender:"wallet",type:"state_changed",payload:o}):console.error("[HODEI] (state_changed)",o)};return{name:"hodei",icon:"https://raw.githubusercontent.com/cardano-forge/weld/main/images/wallets/hodei.png",apiVersion:"1",async enable(){if(t.resolved?.bridge.isConnected())return t.resolved.api;t.promise||(t.promise=X({config:t.config,onStateChange:n}));try{const o=await t.promise;return t.resolved=o,t.config.waitForPairing?await o.pairingPromise:o.pairingPromise.catch(()=>{}),o.api}finally{t.promise=void 0}},async isEnabled(){if(t.promise)try{return await t.promise,!0}catch{return!1}if(t.resolved)return t.resolved.bridge.isConnected();const o=k();if(!o)return!1;try{return(await C({config:t.config,token:o})).valid}catch{return!1}}}}async function X(e){const t=await Y(),n=new H(e);await n.connect(),S(t.element,s=>{if(s.sender==="client")switch(s.type){case"dialog_closed":{n.getState()?.status==="pairing"&&n.disconnect();break}case"disconnected":{n.disconnect();break}case"unlinked":{n.unlink();break}default:{n.debugLog(`unhandled command received from client: ${JSON.stringify(s)}`);break}}},{signal:n.connection?.controller.signal});const o=()=>{const s=n.getState();if(s?.status!=="paired")throw p("refused",new Error("Wallet is not connected"));return s},u=async s=>{if(o(),!n.isConnected())throw p("refused",new Error("Wallet is not connected"));const r=new AbortController;n.connection.controller.signal.addEventListener("abort",()=>r.abort(),{signal:r.signal});const i=b();return n.connection.ws.addEventListener("message",a=>{try{const c=JSON.parse(a.data);j(c);const m=c;if(m.payload.requestId!==s.requestId)return;m.type==="client.sig_req_accepted"?i.resolve(m.payload.signature):i.reject(m.payload.reason),r.abort()}catch(c){n.debugLog(`error parsing message ${a.data}: ${g(c)}`)}},{signal:r.signal}),n.send({type:"client.sig_req_created",payload:s}),i.promise},d={getNetworkId:async()=>o().network==="mainnet"?1:0,getUtxos:async()=>{const s=o();try{return await U({config:e.config,network:s.network,address:s.baseAddress})}catch(r){throw p("internalError",r)}},getBalance:async()=>{const s=o();try{return await A({config:e.config,network:s.network,address:s.baseAddress})}catch(r){throw p("internalError",r)}},getUsedAddresses:async()=>[o().baseAddress],getUnusedAddresses:async()=>[],getChangeAddress:async()=>o().baseAddress,getRewardAddresses:async()=>[o().stakeAddress],signTx:async(s,r=!1)=>{try{return await u({requestId:crypto.randomUUID(),tx:s,partialSign:r})}catch(i){const a=g(i),c=a?.startsWith("ProofGeneration")?"proofGeneration":"userDeclined";throw G(c,a)}},signData:async(s,r)=>{const i=await u({requestId:crypto.randomUUID(),address:s,data:r}),[a,c]=i.split("::");if(!a||!c)throw p("internalError",new Error("Invalid signature"));return{signature:a,key:c}},submitTx:async s=>{const r=o();try{return(await P({config:e.config,network:r.network,transaction:s})).txHash}catch(i){throw M("failure",i)}},disconnect:async()=>{t.sendCommand({sender:"wallet",type:"disconnecting"})}},l=b();if(n.connection&&n.getState()?.status==="pairing"){const s=new AbortController;n.connection.controller.signal.addEventListener("abort",()=>{s.abort(),l.reject(new Error("Aborted"))},{signal:s.signal}),n.connection.ws.addEventListener("message",r=>{try{const i=JSON.parse(r.data);L(i),i.type==="client.wallet_updated"&&(l.resolve(),s.abort())}catch{}},{signal:s.signal})}else l.resolve();return{api:d,bridge:n,client:t,pairingPromise:l.promise}}async function Y(){if(!customElements.get("hodei-client")){const t=await Promise.resolve().then(()=>ne);customElements.define("hodei-client",t.HodeiClient)}let e=document.querySelector("hodei-client")??void 0;if(!e){e=document.createElement("hodei-client");const t=b();e.addEventListener("mounted",()=>t.resolve(),{once:!0}),document.body.appendChild(e),await t.promise}return{element:e,sendCommand:t=>v(e,t)}}class x extends w.DefaultWalletHandler{async disconnect(){if("disconnect"in this.enabledApi&&typeof this.enabledApi.disconnect=="function")return this.enabledApi?.disconnect()}}function Q(e){return{key:"hodei",connector:w.getDefaultWalletConnector(x),initialize:w.runOnce(t=>B({debug:t.config.debug,...e,onError:o=>{t.config.debug&&console.error("[WELD] Hodei socket error, disconnecting.",o),e?.onError?.(o,t),t.wallet.disconnect()},onClose:o=>{t.config.debug&&console.error("[WELD] Hodei socket closed, disconnecting.",o),e?.onClose?.(o,t),t.wallet.disconnect()},onWalletUpdate:o=>{t.config.debug&&console.log("[WELD] Hodei wallet updated, updating state.",o),e?.onWalletUpdate?.(o,t),t.wallet.updateState()}})?(t.extensions.registerWallets([{supported:!0,key:"hodei",displayName:"Hodei",icon:"https://raw.githubusercontent.com/cardano-forge/weld/main/images/wallets/hodei.png",website:"https://github.com/cardano-forge/hodei-client",supportsTxChaining:!1}]),!0):!1)}}const Z="*{box-sizing:border-box}:host{font-family:Roboto,Arial,Helvetica,sans-serif;pointer-events:auto}dialog{width:100%;max-width:300px;outline:none;border:none;padding:24px;background:transparent}dialog::backdrop{background:#00000052}article{padding:24px;border-radius:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;overflow:hidden;text-align:center;background:linear-gradient(to bottom right,#ebdee8,#fff7fa);color:#1e191e}h1{margin:12px 0 16px;font-size:20px;font-weight:400}p{margin:0;font-size:14px}h2{margin:0 0 24px;font-size:24px;font-weight:600;letter-spacing:.2em}img{width:75px;height:75px}button{--bg: #69548e;--fg: #ffffff;background:var(--bg);color:var(--fg);outline:none;border:none;height:32px;padding:0 12px;border-radius:24px;position:relative;overflow:hidden;transition:all .2s ease-in-out}button:hover{cursor:pointer;--bg: #746197;--fg: #ffffff}button.tonal{--bg: #e8dff8;--fg: #1e182b}button.tonal:hover{--bg: #d9cfe7;--fg: #1f182b}footer{margin-top:24px}@media(prefers-color-scheme:dark){article{background:linear-gradient(to bottom right,#362a36,#181215);color:#eadfe6}button{--bg: #d3bcfd;--fg: #37265c}button:hover{--bg: #c6b0f0;--fg: #37265c}button.tonal{--bg: #4b4358;--fg: #e8dff8}button.tonal:hover{--bg: #574f63;--fg: #e9def8}}",ee=`<dialog></dialog>
|
|
1
|
+
var HodeiPlugin=function(b,p){"use strict";var ce=Object.defineProperty;var de=(b,p,w)=>p in b?ce(b,p,{enumerable:!0,configurable:!0,writable:!0,value:w}):b[p]=w;var g=(b,p,w)=>de(b,typeof p!="symbol"?p+"":p,w);async function w(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network],o=new URL(`${t}/wallets/utxos`);return o.searchParams.set("address",e.address),o.searchParams.set("includeMempool","true"),(await fetch(o,{headers:{"x-api-key":n}})).json()}async function H(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network],o=new URL(`${t}/wallets/balance`);return o.searchParams.set("address",e.address),(await fetch(o,{headers:{"x-api-key":n}})).json()}async function j(e){const{baseUrl:t,apiKey:n}=e.config.anvil[e.network];return(await fetch(`${t}/transactions/submit`,{method:"POST",headers:{"x-api-key":n,"content-type":"application/json"},body:JSON.stringify({transaction:e.transaction,signatures:e.signature?[e.signature]:[]})})).json()}const C="hodei-token";function x(){return localStorage.getItem(C)??void 0}function q(e){localStorage.setItem(C,e)}function U(){localStorage.removeItem(C)}function E(){let e="pending",t=()=>{},n=()=>{};const o=new Promise((i,d)=>{t=l=>{e="resolved",i(l)},n=l=>{e="rejected",d(l)}});return{status:e,promise:o,resolve:t,reject:n}}function f(e){if(e){if((e instanceof Error||L(e,"message"))&&typeof e.message=="string"&&e.message.length>0)return e.message;if(L(e,"data")&&L(e.data,"message")&&typeof e.data.message=="string"&&e.data.message.length>0)return e.data.message;if(typeof e=="string"&&e.length>0)return e}}function L(e,t){return typeof e=="object"&&e!==null&&t in e}class D{constructor(t){g(this,"_config");g(this,"_onStateChange");g(this,"_debug");g(this,"_connectPromise");g(this,"_connection");g(this,"_attempts",0);g(this,"_reconnectTimer");var n;this._config=t.config,this._onStateChange=t.onStateChange,this._debug=((n=t.config)==null?void 0:n.debug)??!1}setDebug(t){this._debug=t}debugLog(...t){if(!this._debug)return;let n="[HODEI]";this.connection&&(n+=` (${this.connection.id})`),console.log(n,...t)}get connection(){return this._connection}isConnected(){var t,n;return((t=this.connection)==null?void 0:t.state.status)==="paired"||((n=this.connection)==null?void 0:n.state.status)==="pairing"}async connect(){if(this._connectPromise)return this._connectPromise;if(this.isConnected())return this.connection.state;this._connectPromise=this._connect();try{return await this._connectPromise}finally{this._connectPromise=void 0}}disconnect(){var t;(t=this._connection)==null||t.ws.close(1e3,"disconnected"),this._connection=void 0}unlink(){this.send({type:"client.session_unlinked",payload:{}})}getState(){var t;return(t=this.connection)==null?void 0:t.state}async _connect(){var k,a,r,u;(k=this._connection)==null||k.ws.close(1e3,"disconnected");const t=this._config.bridge.baseUrl.replace("http","ws"),n=new URL(`${t}/client/ws`),o=await this._getToken();o&&n.searchParams.set("token",o);const i=(((a=this.connection)==null?void 0:a.id)??0)+1,d=new WebSocket(n),l=new AbortController,m=E();this.debugLog("connecting"),d.addEventListener("message",c=>{try{const s=JSON.parse(c.data);z(s),this.debugLog("received connection message"),m.resolve(s.payload)}catch(s){m.reject(`Error parsing connection message ${c.data}: ${f(s)}`)}finally{l.abort()}},{signal:l.signal}),d.addEventListener("error",c=>{this.debugLog("received connection error"),m.reject(`Error connecting: ${f(c)}`),l.abort()},{signal:l.signal});try{const c=await m.promise;this.debugLog("connected"),q(c.token);const s={id:i,ws:d,state:c,controller:((r=this._connection)==null?void 0:r.controller)??new AbortController,events:((u=this._connection)==null?void 0:u.events)??new EventTarget};return this._connection=s,this._onStateChange(s.state),d.addEventListener("message",h=>{var $;try{if(s.state.status==="error")throw new Error("Received message after error");if(s.state.status==="closed")throw new Error("Received message after closed");const y=JSON.parse(h.data);P(y),($=this._connection)==null||$.events.dispatchEvent(new CustomEvent("message",{detail:y})),y.type==="client.wallet_updated"&&(this.debugLog("received wallet_updated message"),s.state={...y.payload,status:"paired",sessionId:s.state.sessionId,token:s.state.token},this._onStateChange(s.state))}catch(y){this.debugLog(`error parsing message ${h.data}: ${f(y)}`)}},{signal:s.controller.signal}),d.addEventListener("error",h=>{if(this._scheduleReconnect()){this.debugLog("scheduled reconnect after error");return}this.debugLog(`received error: ${f(h)}`),s.state={status:"error",error:f(h)},this._onStateChange(s.state),s.controller.abort()},{signal:s.controller.signal}),d.addEventListener("close",async h=>{if(h.code===4001&&(this.debugLog("session deleted"),U()),h.code!==1e3&&this._scheduleReconnect()){this.debugLog("scheduled reconnect after close");return}this.debugLog(`received close: ${h.code} ${h.reason}`),s.state={status:"closed",reason:h.reason,code:h.code},this._onStateChange(s.state),s.controller.abort()},{signal:s.controller.signal}),this._attempts=0,c}catch(c){throw d.close(void 0,`failed to connect: ${f(c)}`),c}}send(t){var n;(n=this.connection)==null||n.ws.send(JSON.stringify(t))}_scheduleReconnect(){this._reconnectTimer&&(this.debugLog("clearing reconnect timer"),clearTimeout(this._reconnectTimer)),this._attempts=Math.min(this._attempts+1,5);const t=2**this._attempts*1e3;this.debugLog(`reconnecting in ${t/1e3}s`);const n=setTimeout(()=>{if(this._reconnectTimer!==n){this.debugLog("reconnect timer cleared. ignoring");return}this.debugLog("reconnecting"),this._reconnectTimer=void 0,this._connect().catch(()=>this._scheduleReconnect())},t);return this._reconnectTimer=n,!0}async _getToken(){const t=x();if(!t)return;const n=await A({config:this._config,token:t});if(this.debugLog(`checked token: ${n.valid?"valid":`invalid: ${n.reason}`}`),n.valid)return t;if(n.reason==="tooManyConnections")throw new Error("Too many connections");n.reason==="notFound"&&U()}}async function A(e){const t=new URL(`${e.config.bridge.baseUrl}/client/check`),n=await fetch(t,{method:"POST",headers:{Authorization:`Bearer ${e.token}`}});return n.status===404?{valid:!1,reason:"notFound"}:n.status===409?{valid:!1,reason:"tooManyConnections"}:{valid:!0,token:e.token}}function _(e){return typeof e=="object"&&e!==null}function O(e){return _(e)&&(e.status==="pairing"||e.status==="paired")}function z(e){if(!_(e)||e.type!=="client.connected"||!O(e.payload))throw new Error("Invalid connected message")}const R=new Set(["client.wallet_updated","client.sig_req_accepted","client.sig_req_rejected"]);function P(e){if(!_(e)||typeof e.type!="string"||!R.has(e.type))throw new Error("Invalid incoming message")}function W(e){if(!_(e)||e.type!=="client.sig_req_accepted"&&e.type!=="client.sig_req_rejected")throw new Error("Invalid sig req response")}const M=new Set(["pairing","paired","closed","error"]);function N(e){return _(e)&&typeof e.status=="string"&&M.has(e.status)}function S(e,t){e.dispatchEvent(new CustomEvent("command",{detail:t}))}function I(e,t,n){const o=i=>{const d=J(i);d&&t(d)};return e.addEventListener("command",o,n),()=>{e.removeEventListener("command",o,n)}}function J(e){if(e instanceof CustomEvent)return K(e.detail)?e.detail:void 0}const F=new Set(["disconnecting","disconnected","unlinked","dialog_closed"]);function K(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.type!="string"?!1:F.has(t.type)?!0:t.type==="state_changed"&&N(t.payload)}const G={bridge:{baseUrl:"https://bridge.hodei.io/api/dev"},anvil:{mainnet:{baseUrl:"https://prod.api.ada-anvil.app/v2/services",apiKey:"mainnet_IIrhwohjiEAJ2LFOgI8p5F735xz4C6XsgH6KfzpC"},preprod:{baseUrl:"https://preprod.api.ada-anvil.app/v2/services",apiKey:"testnet_C301LOscFsUccwR4zCqEtTJvizEAUc3AaVhRDdcY"}},debug:!1,waitForPairing:!0,onError:({error:e})=>console.error("[HODEI] unhandled error:",e??"unknown"),onClose:({code:e,reason:t})=>console.error("[HODEI] unhandled closure:",e,t)},V={refused:1,failure:2};function B(e,t){return{code:V[e],info:f(t)??"unknown"}}const X={invalidRequest:-1,internalError:-2,refused:-3,accountChange:-4};function v(e,t){return{code:X[e],info:f(t)??"unknown"}}const Y={proofGeneration:1,userDeclined:2};function Q(e,t){let n=f(t)??"unknown";for(const o of["ProofGeneration: ","UserDeclined: "])if(n.startsWith(o)){n=n.slice(o.length);break}return n==="UserDeclined"&&(n="User declined"),n==="ProofGeneration"&&(n="Unable to sign the transaction"),{code:Y[e],info:n}}function Z(e){if(!(typeof window>"u"))return window.cardano||(window.cardano={}),"hodei"in window.cardano||(window.cardano.hodei=ee(e)),window.cardano.hodei}function ee(e={}){const t={config:{...G,...e}},n=async o=>{var i,d,l,m;await((i=t.promise)==null?void 0:i.catch(()=>{})),o.status==="error"&&t.config.onError(o),o.status==="closed"&&t.config.onClose(o),o.status==="paired"&&((l=(d=t.config).onWalletUpdate)==null||l.call(d,{baseAddress:o.baseAddress,stakeAddress:o.stakeAddress,network:o.network})),t.resolved?(m=t.resolved)==null||m.client.sendCommand({sender:"wallet",type:"state_changed",payload:o}):console.error("[HODEI] (state_changed)",o)};return{name:"hodei",icon:"https://raw.githubusercontent.com/cardano-forge/weld/main/images/wallets/hodei.png",apiVersion:"1",async enable(){var o;if((o=t.resolved)!=null&&o.bridge.isConnected())return t.resolved.api;t.promise||(t.promise=te({config:t.config,onStateChange:n}));try{const i=await t.promise;return t.resolved=i,t.config.waitForPairing?await i.pairingPromise:i.pairingPromise.catch(()=>{}),i.api}finally{t.promise=void 0}},async isEnabled(){if(t.promise)try{return await t.promise,!0}catch{return!1}if(t.resolved)return t.resolved.bridge.isConnected();const o=x();if(!o)return!1;try{return(await A({config:t.config,token:o})).valid}catch{return!1}}}}async function te(e){var m,k;const t=await ne(),n=new D(e);await n.connect(),I(t.element,a=>{var r;if(a.sender==="client")switch(a.type){case"dialog_closed":{((r=n.getState())==null?void 0:r.status)==="pairing"&&n.disconnect();break}case"disconnected":{n.disconnect();break}case"unlinked":{n.unlink();break}default:{n.debugLog(`unhandled command received from client: ${JSON.stringify(a)}`);break}}},{signal:(m=n.connection)==null?void 0:m.controller.signal});const o=()=>{const a=n.getState();if((a==null?void 0:a.status)!=="paired")throw v("refused",new Error("Wallet is not connected"));return a},i=async a=>{if(o(),!n.isConnected())throw v("refused",new Error("Wallet is not connected"));const r=new AbortController;n.connection.controller.signal.addEventListener("abort",()=>r.abort(),{signal:r.signal});const u=E();return r.signal.addEventListener("abort",()=>{u.reject("aborted")}),n.connection.events.addEventListener("message",c=>{if(c instanceof CustomEvent)try{const s=c.detail;if(W(s),s.payload.requestId!==a.requestId)return;n.send({type:"client.sig_req_ack",payload:{requestId:s.payload.requestId}}),s.type==="client.sig_req_accepted"?u.resolve(s.payload.signature):u.reject(s.payload.reason),r.abort()}catch(s){n.debugLog(`error parsing message ${c.detail}: ${f(s)}`)}},{signal:r.signal}),n.send({type:"client.sig_req_created",payload:a}),u.promise},d={getNetworkId:async()=>o().network==="mainnet"?1:0,getUtxos:async()=>{const a=o();try{return await w({config:e.config,network:a.network,address:a.baseAddress})}catch(r){throw v("internalError",r)}},getBalance:async()=>{const a=o();try{return await H({config:e.config,network:a.network,address:a.baseAddress})}catch(r){throw v("internalError",r)}},getUsedAddresses:async()=>[o().baseAddress],getUnusedAddresses:async()=>[],getChangeAddress:async()=>o().baseAddress,getRewardAddresses:async()=>[o().stakeAddress],signTx:async(a,r=!1)=>{try{return await i({requestId:crypto.randomUUID(),tx:a,partialSign:r,capabilities:["ack"]})}catch(u){const c=f(u),s=c!=null&&c.startsWith("ProofGeneration")?"proofGeneration":"userDeclined";throw Q(s,c)}},signData:async(a,r)=>{const u=await i({requestId:crypto.randomUUID(),address:a,data:r,capabilities:["ack"]}),[c,s]=u.split("::");if(!c||!s)throw v("internalError",new Error("Invalid signature"));return{signature:c,key:s}},submitTx:async a=>{const r=o();try{return(await j({config:e.config,network:r.network,transaction:a})).txHash}catch(u){throw B("failure",u)}},disconnect:async()=>{t.sendCommand({sender:"wallet",type:"disconnecting"})}},l=E();if(n.connection&&((k=n.getState())==null?void 0:k.status)==="pairing"){const a=new AbortController;n.connection.controller.signal.addEventListener("abort",()=>{a.abort(),l.reject(new Error("Aborted"))},{signal:a.signal}),n.connection.events.addEventListener("message",r=>{if(r instanceof CustomEvent)try{const u=r.detail;P(u),u.type==="client.wallet_updated"&&(l.resolve(),a.abort())}catch{}},{signal:a.signal})}else l.resolve();return{api:d,bridge:n,client:t,pairingPromise:l.promise}}async function ne(){if(!customElements.get("hodei-client")){const t=await Promise.resolve().then(()=>re);customElements.define("hodei-client",t.HodeiClient)}let e=document.querySelector("hodei-client")??void 0;if(!e){e=document.createElement("hodei-client");const t=E();e.addEventListener("mounted",()=>t.resolve(),{once:!0}),document.body.appendChild(e),await t.promise}return{element:e,sendCommand:t=>S(e,t)}}class T extends p.DefaultWalletHandler{async disconnect(){var t;if("disconnect"in this.enabledApi&&typeof this.enabledApi.disconnect=="function")return(t=this.enabledApi)==null?void 0:t.disconnect()}}function oe(e){return{key:"hodei",connector:p.getDefaultWalletConnector(T),initialize:p.runOnce(t=>Z({debug:t.config.debug,...e,onError:o=>{var i;t.config.debug&&console.error("[WELD] Hodei socket error, disconnecting.",o),(i=e==null?void 0:e.onError)==null||i.call(e,o,t),t.wallet.disconnect()},onClose:o=>{var i;t.config.debug&&console.error("[WELD] Hodei socket closed, disconnecting.",o),(i=e==null?void 0:e.onClose)==null||i.call(e,o,t),t.wallet.disconnect()},onWalletUpdate:o=>{var i;t.config.debug&&console.log("[WELD] Hodei wallet updated, updating state.",o),(i=e==null?void 0:e.onWalletUpdate)==null||i.call(e,o,t),t.wallet.updateState()}})?(t.extensions.registerWallets([{supported:!0,key:"hodei",displayName:"Hodei",icon:"https://raw.githubusercontent.com/cardano-forge/weld/main/images/wallets/hodei.png",website:"https://github.com/cardano-forge/hodei-client",supportsTxChaining:!1}]),!0):!1)}}const se="*{box-sizing:border-box}:host{font-family:Roboto,Arial,Helvetica,sans-serif;pointer-events:auto}dialog{width:100%;max-width:300px;outline:none;border:none;padding:24px;background:transparent}dialog::backdrop{background:#00000052}article{padding:24px;border-radius:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;overflow:hidden;text-align:center;background:linear-gradient(to bottom right,#ebdee8,#fff7fa);color:#1e191e}h1{margin:12px 0 16px;font-size:20px;font-weight:400}p{margin:0;font-size:14px}h2{margin:0 0 24px;font-size:24px;font-weight:600;letter-spacing:.2em}img{width:75px;height:75px}button{--bg: #69548e;--fg: #ffffff;background:var(--bg);color:var(--fg);outline:none;border:none;height:32px;padding:0 12px;border-radius:24px;position:relative;overflow:hidden;transition:all .2s ease-in-out}button:hover{cursor:pointer;--bg: #746197;--fg: #ffffff}button.tonal{--bg: #e8dff8;--fg: #1e182b}button.tonal:hover{--bg: #d9cfe7;--fg: #1f182b}footer{margin-top:24px}@media(prefers-color-scheme:dark){article{background:linear-gradient(to bottom right,#362a36,#181215);color:#eadfe6}button{--bg: #d3bcfd;--fg: #37265c}button:hover{--bg: #c6b0f0;--fg: #37265c}button.tonal{--bg: #4b4358;--fg: #e8dff8}button.tonal:hover{--bg: #574f63;--fg: #e9def8}}",ie=`<dialog></dialog>
|
|
2
2
|
|
|
3
3
|
<template id="pairing">
|
|
4
4
|
<article>
|
|
@@ -20,4 +20,4 @@ var HodeiPlugin=(function(f,w){"use strict";async function U(e){const{baseUrl:t,
|
|
|
20
20
|
</footer>
|
|
21
21
|
</article>
|
|
22
22
|
</template>
|
|
23
|
-
`;class
|
|
23
|
+
`;class ae extends HTMLElement{constructor(){super();g(this,"_state",{status:"disconnected"});g(this,"_shadow");g(this,"_dialog");g(this,"_unsub");g(this,"_observer");this._shadow=this.attachShadow({mode:"open"}),this._shadow.innerHTML=`<style>${se}</style>${ie}`;const n=this._shadow.querySelector("dialog");if(n)this._dialog=n;else throw new Error("dialog not found");for(const o of["pointerdown","pointerup","click","mousedown","mouseup"])this.addEventListener(o,i=>i.stopPropagation());this._dialog.addEventListener("click",o=>{o.target===this._dialog&&this._dialog.close("backdrop")}),this._dialog.addEventListener("close",()=>{switch(this._state.status){case"pairing":S(this,{sender:"client",type:"dialog_closed"});break;case"disconnecting":this._dialog.returnValue==="backdrop"?this._state={status:"connected"}:S(this,{sender:"client",type:this._state.shouldUnlink?"unlinked":"disconnected"});break}})}connectedCallback(){this._unsub=I(this,o=>{if(o.sender==="wallet"&&!(o.type==="state_changed"&&o.payload.status==="paired"&&this._state.status==="disconnecting"))switch(o.type){case"state_changed":switch(o.payload.status){case"paired":this._state={status:"connected"};break;case"pairing":this._state={status:"pairing",pin:o.payload.pin};break;default:this._state={status:"disconnected"};break}this._update();break;case"disconnecting":this._state.status==="connected"&&(this._state={status:"disconnecting",shouldUnlink:!1},this._update());break}});const n=this.parentElement;n&&(this._observer=new MutationObserver(()=>{n.lastElementChild!==this&&(n.removeChild(this),n.appendChild(this))}),this._observer.observe(n,{childList:!0})),this.dispatchEvent(new CustomEvent("mounted"))}disconnectedCallback(){var n,o;(n=this._unsub)==null||n.call(this),(o=this._observer)==null||o.disconnect(),this.dispatchEvent(new CustomEvent("unmounted"))}_cloneTemplate(n){var o;return(o=this._shadow.querySelector(`#${n}`))==null?void 0:o.content.cloneNode(!0)}_update(){const n=this._state;switch(n.status){case"pairing":{const o=this._cloneTemplate(n.status),i=o.querySelector(".pin");i&&(i.textContent=n.pin),this._dialog.replaceChildren(o),this._dialog.open||this._dialog.showModal();break}case"disconnecting":{const o=this._cloneTemplate(n.status);this._dialog.replaceChildren(o);for(const i of this._dialog.querySelectorAll("button"))i.addEventListener("click",()=>{n.shouldUnlink=i.dataset.action==="unlink",this._dialog.close("disconnect")});this._dialog.open||this._dialog.showModal();break}default:{this._dialog.open&&this._dialog.close("no-content");break}}}}const re=Object.freeze(Object.defineProperty({__proto__:null,HodeiClient:ae},Symbol.toStringTag,{value:"Module"}));return b.HodeiHandler=T,b.hodeiPlugin=oe,Object.defineProperty(b,Symbol.toStringTag,{value:"Module"}),b}({},WeldCore);
|
package/lib.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@ada-anvil/hodei-client"),o=require("@ada-anvil/weld/core");class i extends o.DefaultWalletHandler{async disconnect(){var t;if("disconnect"in this.enabledApi&&typeof this.enabledApi.disconnect=="function")return(t=this.enabledApi)==null?void 0:t.disconnect()}}function l(e){return{key:"hodei",connector:o.getDefaultWalletConnector(i),initialize:o.runOnce(t=>s.initialize({debug:t.config.debug,...e,onError:n=>{var r;t.config.debug&&console.error("[WELD] Hodei socket error, disconnecting.",n),(r=e==null?void 0:e.onError)==null||r.call(e,n,t),t.wallet.disconnect()},onClose:n=>{var r;t.config.debug&&console.error("[WELD] Hodei socket closed, disconnecting.",n),(r=e==null?void 0:e.onClose)==null||r.call(e,n,t),t.wallet.disconnect()},onWalletUpdate:n=>{var r;t.config.debug&&console.log("[WELD] Hodei wallet updated, updating state.",n),(r=e==null?void 0:e.onWalletUpdate)==null||r.call(e,n,t),t.wallet.updateState()}})?(t.extensions.registerWallets([{supported:!0,key:"hodei",displayName:"Hodei",icon:"https://raw.githubusercontent.com/cardano-forge/weld/main/images/wallets/hodei.png",website:"https://github.com/cardano-forge/hodei-client",supportsTxChaining:!1}]),!0):!1)}}exports.HodeiHandler=i;exports.hodeiPlugin=l;
|
package/lib.js
CHANGED
|
@@ -1,28 +1,32 @@
|
|
|
1
|
-
import { initialize as
|
|
2
|
-
import { DefaultWalletHandler as
|
|
3
|
-
class
|
|
1
|
+
import { initialize as o } from "@ada-anvil/hodei-client";
|
|
2
|
+
import { DefaultWalletHandler as s, runOnce as a, getDefaultWalletConnector as i } from "@ada-anvil/weld/core";
|
|
3
|
+
class l extends s {
|
|
4
4
|
async disconnect() {
|
|
5
|
+
var t;
|
|
5
6
|
if ("disconnect" in this.enabledApi && typeof this.enabledApi.disconnect == "function")
|
|
6
|
-
return this.enabledApi
|
|
7
|
+
return (t = this.enabledApi) == null ? void 0 : t.disconnect();
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function c(e) {
|
|
10
11
|
return {
|
|
11
12
|
key: "hodei",
|
|
12
|
-
connector:
|
|
13
|
-
initialize:
|
|
14
|
-
debug:
|
|
15
|
-
...
|
|
16
|
-
onError: (
|
|
17
|
-
|
|
13
|
+
connector: i(l),
|
|
14
|
+
initialize: a((t) => o({
|
|
15
|
+
debug: t.config.debug,
|
|
16
|
+
...e,
|
|
17
|
+
onError: (r) => {
|
|
18
|
+
var n;
|
|
19
|
+
t.config.debug && console.error("[WELD] Hodei socket error, disconnecting.", r), (n = e == null ? void 0 : e.onError) == null || n.call(e, r, t), t.wallet.disconnect();
|
|
18
20
|
},
|
|
19
|
-
onClose: (
|
|
20
|
-
|
|
21
|
+
onClose: (r) => {
|
|
22
|
+
var n;
|
|
23
|
+
t.config.debug && console.error("[WELD] Hodei socket closed, disconnecting.", r), (n = e == null ? void 0 : e.onClose) == null || n.call(e, r, t), t.wallet.disconnect();
|
|
21
24
|
},
|
|
22
|
-
onWalletUpdate: (
|
|
23
|
-
|
|
25
|
+
onWalletUpdate: (r) => {
|
|
26
|
+
var n;
|
|
27
|
+
t.config.debug && console.log("[WELD] Hodei wallet updated, updating state.", r), (n = e == null ? void 0 : e.onWalletUpdate) == null || n.call(e, r, t), t.wallet.updateState();
|
|
24
28
|
}
|
|
25
|
-
}) ? (
|
|
29
|
+
}) ? (t.extensions.registerWallets([
|
|
26
30
|
{
|
|
27
31
|
supported: !0,
|
|
28
32
|
key: "hodei",
|
|
@@ -35,6 +39,6 @@ function u(o) {
|
|
|
35
39
|
};
|
|
36
40
|
}
|
|
37
41
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
42
|
+
l as HodeiHandler,
|
|
43
|
+
c as hodeiPlugin
|
|
40
44
|
};
|
package/package.json
CHANGED
|
@@ -1,46 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ada-anvil/weld-plugin-hodei",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"devDependencies": {
|
|
5
|
-
"@ada-anvil/weld": "^0.7.0",
|
|
6
|
-
"@biomejs/biome": "2.4.4",
|
|
7
|
-
"@microsoft/api-extractor": "^7.57.4",
|
|
8
|
-
"@types/node": "^25.4.0",
|
|
9
|
-
"typescript": "~5.9.3",
|
|
10
|
-
"unplugin-dts": "^1.0.0-beta.6",
|
|
11
|
-
"vite": "^7.3.1",
|
|
12
|
-
"vitest": "^4.0.18"
|
|
13
|
-
},
|
|
14
|
-
"scripts": {
|
|
15
|
-
"dev": "vite",
|
|
16
|
-
"build:client": "vite build --config ./vite.client.ts",
|
|
17
|
-
"build:cdn": "vite build --config ./vite.cdn.ts",
|
|
18
|
-
"build": "tsc && bun run build:client && bun run build:cdn",
|
|
19
|
-
"preview": "vite preview",
|
|
20
|
-
"check": "tsc --noEmit",
|
|
21
|
-
"lint": "biome check --write .",
|
|
22
|
-
"test:watch": "vitest --passWithNoTests",
|
|
23
|
-
"test": "vitest run --passWithNoTests",
|
|
24
|
-
"pre": "bun run lint && bun run check && bun run build && bun run test"
|
|
25
|
-
},
|
|
26
|
-
"type": "module",
|
|
27
|
-
"peerDependencies": {
|
|
28
|
-
"@ada-anvil/weld": ">=0.7.0"
|
|
29
|
-
},
|
|
30
|
-
"dependencies": {
|
|
31
|
-
"@ada-anvil/hodei-client": "^0.0.3"
|
|
32
|
-
},
|
|
3
|
+
"version": "0.0.4",
|
|
33
4
|
"files": [
|
|
34
5
|
"**"
|
|
35
6
|
],
|
|
7
|
+
"type": "module",
|
|
36
8
|
"main": "./lib.cjs",
|
|
37
9
|
"module": "./lib.js",
|
|
38
|
-
"types": "./lib.d.ts",
|
|
10
|
+
"types": "./types/lib.d.ts",
|
|
39
11
|
"exports": {
|
|
40
12
|
".": {
|
|
41
|
-
"types": "./lib.d.ts",
|
|
13
|
+
"types": "./types/lib.d.ts",
|
|
42
14
|
"import": "./lib.js",
|
|
43
15
|
"require": "./lib.cjs"
|
|
44
16
|
}
|
|
17
|
+
},
|
|
18
|
+
"peerDependencies": {
|
|
19
|
+
"@ada-anvil/weld": ">=0.7.0"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"@ada-anvil/hodei-client": "^0.0.6"
|
|
23
|
+
},
|
|
24
|
+
"license": "MIT",
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://github.com/Cardano-Forge/weld/plugins/hodei",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/Cardano-Forge/weld.git",
|
|
32
|
+
"directory": "plugins/hodei"
|
|
33
|
+
},
|
|
34
|
+
"bugs": {
|
|
35
|
+
"url": "https://github.com/Cardano-Forge/weld/issues"
|
|
45
36
|
}
|
|
46
37
|
}
|
|
@@ -1,35 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { WeldPlugin } from '@ada-anvil/weld/plugins';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}, weld: WeldInstance): void;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
network: "mainnet" | "preprod";
|
|
32
|
-
}, weld: WeldInstance): void;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export { }
|
|
1
|
+
import { WeldInstance } from '@ada-anvil/weld';
|
|
2
|
+
import { DefaultWalletHandler } from '@ada-anvil/weld/core';
|
|
3
|
+
import { WeldPlugin } from '@ada-anvil/weld/plugins';
|
|
4
|
+
export declare class HodeiHandler extends DefaultWalletHandler {
|
|
5
|
+
disconnect(): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export type HodeiPluginConfig = {
|
|
8
|
+
bridge: {
|
|
9
|
+
baseUrl: string;
|
|
10
|
+
};
|
|
11
|
+
anvil: Record<"mainnet" | "preprod", {
|
|
12
|
+
baseUrl: string;
|
|
13
|
+
apiKey: string;
|
|
14
|
+
}>;
|
|
15
|
+
debug: boolean;
|
|
16
|
+
waitForPairing: boolean;
|
|
17
|
+
onError(data: {
|
|
18
|
+
error?: string;
|
|
19
|
+
}, weld: WeldInstance): void;
|
|
20
|
+
onClose(data: {
|
|
21
|
+
code: number;
|
|
22
|
+
reason: string;
|
|
23
|
+
}, weld: WeldInstance): void;
|
|
24
|
+
onWalletUpdate(wallet: {
|
|
25
|
+
baseAddress: string;
|
|
26
|
+
stakeAddress: string;
|
|
27
|
+
network: "mainnet" | "preprod";
|
|
28
|
+
}, weld: WeldInstance): void;
|
|
29
|
+
};
|
|
30
|
+
export declare function hodeiPlugin(config?: Partial<HodeiPluginConfig>): WeldPlugin;
|