@seams/wallet-server 0.9.2 → 0.9.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/THIRD_PARTY_NOTICES.md +33 -1
- package/artifact-manifest.json +34 -29
- package/cloudflare-router-ab/build/deriver-a/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-a/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/deriver-b/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/deriver-b/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/local-tools/darwin-arm64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/local-tools/darwin-x64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/local-tools/linux-x64/router_ab_local_init +0 -0
- package/cloudflare-router-ab/build/router/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/router/index.js +1 -1
- package/cloudflare-router-ab/build/router/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/signing-worker/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/signing-worker/index.js +1 -1
- package/cloudflare-router-ab/build/signing-worker/index_bg.wasm +0 -0
- package/cloudflare-router-ab/build/tenant-root-control-plane/build-stamp.json +1 -1
- package/cloudflare-router-ab/build/tenant-root-control-plane/index.js +1 -1
- package/cloudflare-router-ab/build/tenant-root-control-plane/index_bg.wasm +0 -0
- package/dist/esm/router/cloudflare/d1/auth/d1RouterApiAuthService.js +1 -1
- package/dist/esm/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.js +11 -4
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.js +46 -2
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationRead.js +7 -4
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationService.js +25 -9
- package/dist/esm/router/cloudflare/d1/registration/d1WalletRegistrationSetupExecution.js +2 -1
- package/dist/esm/router/cloudflare.js +1 -1
- package/dist/esm/router/domains/walletRegistration/walletRegistrationRoutes.js +1 -1
- package/dist/esm/router/express.js +1 -1
- package/dist/esm/router/framework/registrationSetupDispatch.js +28 -2
- package/dist/esm/storage/d1Retry.js +38 -0
- package/dist/esm/wasm/shamir3pass_runtime/pkg/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.d.ts +7 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationCommitStore.d.ts +34 -2
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationRead.d.ts +4 -1
- package/dist/types/wallet-server/src/router/cloudflare/d1/registration/d1WalletRegistrationService.d.ts +1 -1
- package/dist/types/wallet-server/src/router/framework/authServicePort.d.ts +1 -1
- package/dist/types/wallet-server/src/storage/d1Retry.d.ts +10 -0
- package/migrations/d1-signer/0078_registration_passkey_claims.sql +20 -0
- package/package.json +1 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{WorkerEntrypoint as ve}from"cloudflare:workers";var J=globalThis.__worker_init_state={criticalError:!1,instanceId:0};import X from"./index_bg.wasm";var x=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,be.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_containerstartupoptions_free(e,0)}get enableInternet(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_containerstartupoptions_enableInternet(this.__wbg_ptr),e===16777215?void 0:e!==0}get entrypoint(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;s(),e=_.__wbg_get_containerstartupoptions_entrypoint(this.__wbg_ptr);var t=ne(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*4,4),t}get env(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_containerstartupoptions_env(this.__wbg_ptr),e}set enableInternet(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_containerstartupoptions_enableInternet(this.__wbg_ptr,f(e)?16777215:e?1:0)}set entrypoint(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t=pe(e,_.__wbindgen_malloc),n=l;s(),_.__wbg_set_containerstartupoptions_entrypoint(this.__wbg_ptr,t,n)}set env(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_containerstartupoptions_env(this.__wbg_ptr,e)}};Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);var I=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ge.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingbytesource_free(e,0)}get autoAllocateChunkSize(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr),e>>>0}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s(),_.intounderlyingbytesource_cancel(e)}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingbytesource_pull(this.__wbg_ptr,e),t}start(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.intounderlyingbytesource_start(this.__wbg_ptr,e)}get type(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.intounderlyingbytesource_type(this.__wbg_ptr),ue[e]}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);var R=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,de.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingsink_free(e,0)}abort(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t=this.__destroy_into_raw(),n;return s(),n=_.intounderlyingsink_abort(t,e),n}close(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw(),t;return s(),t=_.intounderlyingsink_close(e),t}write(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingsink_write(this.__wbg_ptr,e),t}};Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);var E=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,we.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingsource_free(e,0)}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s(),_.intounderlyingsource_cancel(e)}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingsource_pull(this.__wbg_ptr,e),t}};Symbol.dispose&&(E.prototype[Symbol.dispose]=E.prototype.free);var j=class r{static __wrap(e){let t=Object.create(r.prototype);return t.__wbg_ptr=e,Object.defineProperty(t,"__wbg_inst",{value:o,writable:!0}),$.register(t,{ptr:e,instance:o},t),t}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_minifyconfig_free(e,0)}get css(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_css(this.__wbg_ptr),e!==0}get html(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_html(this.__wbg_ptr),e!==0}get js(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_js(this.__wbg_ptr),e!==0}set css(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_css(this.__wbg_ptr,e)}set html(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_html(this.__wbg_ptr,e)}set js(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_js(this.__wbg_ptr,e)}};Symbol.dispose&&(j.prototype[Symbol.dispose]=j.prototype.free);var F=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,le.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_r2range_free(e,0)}get length(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_length(this.__wbg_ptr),e[0]===0?void 0:e[1]}get offset(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_offset(this.__wbg_ptr),e[0]===0?void 0:e[1]}get suffix(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_suffix(this.__wbg_ptr),e[0]===0?void 0:e[1]}set length(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_length(this.__wbg_ptr,!f(e),f(e)?0:e)}set offset(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_offset(this.__wbg_ptr,!f(e),f(e)?0:e)}set suffix(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_suffix(this.__wbg_ptr,!f(e),f(e)?0:e)}};Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);var S=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabrouterwalletdurableobject_free(e,0)}alarm(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.routerabrouterwalletdurableobject_alarm(this.__wbg_ptr),e}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabrouterwalletdurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabrouterwalletdurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),H.register(this,{ptr:n,instance:o},this),this}webSocketClose(e,t,n,i){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let u=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),a=l,b;return s(),b=_.routerabrouterwalletdurableobject_webSocketClose(this.__wbg_ptr,e,t,u,a,i),b}webSocketError(e,t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let n;return s(),n=_.routerabrouterwalletdurableobject_webSocketError(this.__wbg_ptr,e,t),n}webSocketMessage(e,t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let n;return s(),n=_.routerabrouterwalletdurableobject_webSocketMessage(this.__wbg_ptr,e,t),n}};Symbol.dispose&&(S.prototype[Symbol.dispose]=S.prototype.free);var k=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabsigningworkerpresignsessiondurableobject_free(e,0)}alarm(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.routerabsigningworkerpresignsessiondurableobject_alarm(this.__wbg_ptr),e}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabsigningworkerpresignsessiondurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabsigningworkerpresignsessiondurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),G.register(this,{ptr:n,instance:o},this),this}};Symbol.dispose&&(k.prototype[Symbol.dispose]=k.prototype.free);var W=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabtenantrootcreationdurableobject_free(e,0)}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabtenantrootcreationdurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabtenantrootcreationdurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),K.register(this,{ptr:n,instance:o},this),this}};Symbol.dispose&&(W.prototype[Symbol.dispose]=W.prototype.free);function L(){o++,v=null,O=null,typeof numBytesDecoded<"u"&&(numBytesDecoded=0),typeof l<"u"&&(l=0),re=!1,q=new WebAssembly.Instance(X,te()),_=q.exports,_.__wbindgen_start()}function Y(){let r;return s(),r=_.__worker_init_state(),r}function Z(r,e,t){let n;return s(),n=_.fetch(r,e,t),n}function ee(){s(),_.init()}function te(){return{__proto__:null,"./index_bg.js":{__proto__:null,__wbg_Error_9dc85fe1bc224456:function(e,t){return Error(d(e,t))},__wbg_Number_4779d427bae39753:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,t){let n=String(t),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg___wbindgen_bigint_get_as_i64_8ea6736501f396b6:function(e,t){let n=t,i=typeof n=="bigint"?n:void 0;g().setBigInt64(e+8,f(i)?BigInt(0):i,!0),g().setInt32(e+0,!f(i),!0)},__wbg___wbindgen_boolean_get_b131b2f36d6b2f55:function(e){let t=e,n=typeof t=="boolean"?t:void 0;return f(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_56c147eb1a51f0c4:function(e,t){let n=V(t),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg___wbindgen_in_ce8569b2fc6f5088:function(e,t){return e in t},__wbg___wbindgen_is_bigint_df272c65456269c2:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_147961669f068cd4:function(e){return typeof e=="function"},__wbg___wbindgen_is_null_or_undefined_b02321d39cf26d8d:function(e){return e==null},__wbg___wbindgen_is_object_3a2c414391dbf751:function(e){let t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_6541b0f6ecd4e8e5:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_4410e3c20a99fa97:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_174c93ec61bab0c5:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c:function(e,t){return e==t},__wbg___wbindgen_number_get_588ed6b97f0d7e14:function(e,t){let n=t,i=typeof n=="number"?n:void 0;g().setFloat64(e+8,f(i)?0:i,!0),g().setInt32(e+0,!f(i),!0)},__wbg___wbindgen_string_get_fa2687d531ed17a5:function(e,t){let n=t,i=typeof n=="string"?n:void 0;var u=f(i)?0:y(i,_.__wbindgen_malloc,_.__wbindgen_realloc),a=l;g().setInt32(e+4,a,!0),g().setInt32(e+0,u,!0)},__wbg___wbindgen_throw_bbadd78c1bac3a77:function(e,t){throw new Error(d(e,t))},__wbg__wbg_cb_unref_c2301a3c9b78104b:function(e){e._wbg_cb_unref()},__wbg_body_442a47f02322d7b0:function(e){let t=e.body;return f(t)?0:w(t)},__wbg_body_b06d3a9c5933702e:function(e){let t=e.body;return f(t)?0:w(t)},__wbg_buffer_8524b3453cde4918:function(e){return e.buffer},__wbg_byobRequest_cc72d210de793e64:function(e){let t=e.byobRequest;return f(t)?0:w(t)},__wbg_byteLength_96807b1d9ab24a4c:function(e){return e.byteLength},__wbg_byteOffset_a9c7002428843c41:function(e){return e.byteOffset},__wbg_call_91f00ddc43e01490:function(){return c(function(e,t){return e.call(t)},arguments)},__wbg_call_ec09a4cf93377d3a:function(){return c(function(e,t,n){return e.call(t,n)},arguments)},__wbg_cancel_f3a197b26dc88b39:function(e){return e.cancel()},__wbg_catch_66060324c27be6f7:function(e,t){return e.catch(t)},__wbg_cause_5f2ec35e043cc9cf:function(e){return e.cause},__wbg_cf_22a1527cd02b5acd:function(){return c(function(e){let t=e.cf;return f(t)?0:w(t)},arguments)},__wbg_cf_ee73de251a6dda8a:function(){return c(function(e){let t=e.cf;return f(t)?0:w(t)},arguments)},__wbg_close_388d99468213b286:function(){return c(function(e){e.close()},arguments)},__wbg_close_4857e22d08b71356:function(){return c(function(e){e.close()},arguments)},__wbg_constructor_04971ae0b51c1fc5:function(e){return e.constructor},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_delete_0332d9732b7b743f:function(){return c(function(e,t,n){var i=ne(t,n).slice();return _.__wbindgen_free(t,n*4,4),e.delete(i)},arguments)},__wbg_delete_e21a892409559f6e:function(){return c(function(e,t,n){return e.delete(d(t,n))},arguments)},__wbg_done_6a8439e544ec6206:function(e){return e.done},__wbg_enqueue_bbeb09ba0b140f76:function(){return c(function(e,t){e.enqueue(t)},arguments)},__wbg_entries_5a6a7e7e0df09fe5:function(e){return Object.entries(e)},__wbg_error_6651fee1c71e5da9:function(e){console.error(e)},__wbg_error_9a99766f65a03031:function(e,t){console.error(e,t)},__wbg_fetch_1d1b09eaf160ddf3:function(e,t,n){return e.fetch(t,n)},__wbg_fetch_931fc4244e17ef2d:function(e,t,n,i){return e.fetch(d(t,n),i)},__wbg_fetch_b447ca2a0c0e6583:function(){return c(function(e,t){return e.fetch(t)},arguments)},__wbg_fetch_be42f5d2be38cba1:function(){return c(function(e,t){return e.fetch(t)},arguments)},__wbg_getAlarm_5528fdbdd50b2988:function(){return c(function(e,t){return e.getAlarm(t)},arguments)},__wbg_getByName_5f8a4ae327c50115:function(){return c(function(e,t,n){return e.getByName(d(t,n))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return c(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getReader_bb0230851fbf986b:function(){return c(function(e){return e.getReader()},arguments)},__wbg_getTime_ef2e115ede346a26:function(e){return e.getTime()},__wbg_get_44e98e27bda25b5b:function(){return c(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_4b90d6d8c5deb5d5:function(e,t){return e[t>>>0]},__wbg_get_52a8a619f7b88df6:function(){return c(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_6e0eec3a0a32f612:function(){return c(function(e,t,n){return e.get(d(t,n))},arguments)},__wbg_get_a82defe8d6b5b2e5:function(){return c(function(e,t,n,i){let u=t.get(d(n,i));var a=f(u)?0:y(u,_.__wbindgen_malloc,_.__wbindgen_realloc),b=l;g().setInt32(e+4,b,!0),g().setInt32(e+0,a,!0)},arguments)},__wbg_get_a87a6c1024dddd3b:function(){return c(function(e,t,n){return e.get(d(t,n))},arguments)},__wbg_get_c538c7fb0359c222:function(){return c(function(e,t){let n=Reflect.get(e,t);return f(n)?0:w(n)},arguments)},__wbg_get_done_c21b9933fc9a9e9c:function(e){let t=e.done;return f(t)?16777215:t?1:0},__wbg_get_unchecked_46e778e3cec74b5e:function(e,t){return e[t>>>0]},__wbg_get_value_ad568c7d3db9073f:function(e){return e.value},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_headers_5b19cf40627ae54d:function(e){return e.headers},__wbg_headers_e1e94862a6a36f9e:function(e){return e.headers},__wbg_idFromName_32b0b5012b5f6535:function(){return c(function(e,t,n){return e.idFromName(d(t,n))},arguments)},__wbg_id_0c05f441a81ef0fc:function(){return c(function(e){return e.id},arguments)},__wbg_instanceId_3970204fcbf0c41d:function(e){return e.instanceId},__wbg_instanceof_ArrayBuffer_a581da923203f29f:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Error_cb5ebd65d798655e:function(e){let t;try{t=e instanceof Error}catch{t=!1}return t},__wbg_instanceof_Map_7f94c740225003e2:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_ReadableStream_b1eab376911b1b77:function(e){let t;try{t=e instanceof ReadableStream}catch{t=!1}return t},__wbg_instanceof_Response_36a65a969abaa7c6:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_b6fe1ac89eba107e:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_139f48e3c057ede8:function(e){return Array.isArray(e)},__wbg_isSafeInteger_c22ccb4af2201fe9:function(e){return Number.isSafeInteger(e)},__wbg_iterator_9b36cebf3be7b7cd:function(){return Symbol.iterator},__wbg_json_d44033e4c5c27d14:function(){return c(function(e){return e.json()},arguments)},__wbg_keys_6fe253f5073ff078:function(e){return e.keys()},__wbg_keys_f365fabedba1fe04:function(e){return e.keys()},__wbg_length_68a9d5278d084f4f:function(e){return e.length},__wbg_length_fb04d16d7bdf6d4c:function(e){return e.length},__wbg_list_1e28f18cc3692a47:function(){return c(function(e,t){return e.list(t)},arguments)},__wbg_list_fc2e1da79650bd5a:function(){return c(function(e,t){return e.list(t)},arguments)},__wbg_log_6614a4effdb4e983:function(e){console.log(e)},__wbg_message_5c6ab4dd6c4b34e8:function(e){return e.message},__wbg_method_f687b49ca8e2b38d:function(e,t){let n=t.method,i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg_minifyconfig_new:function(e){return j.__wrap(e)},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_name_72adaf2fce06bbe8:function(e){return e.name},__wbg_name_f60e249a46c5285a:function(e){return e.name},__wbg_new_0_878c6ec3a1c600f3:function(){return new Date},__wbg_new_0b303268aa395a38:function(){return new Array},__wbg_new_189262ff31890c23:function(){return c(function(){return new Headers},arguments)},__wbg_new_20b778a4c5c691c3:function(){return new Object},__wbg_new_5fae30e6b23db8df:function(e,t){return new Error(d(e,t))},__wbg_new_883c0db065f06efd:function(){return new Map},__wbg_new_a21cf41c5c809e4c:function(e){return new Date(e)},__wbg_new_b06772b280cc6e52:function(e){return new Uint8Array(e)},__wbg_new_typed_90c3f6c29ba36d19:function(e,t){try{var n={a:e,b:t},i=(a,b)=>{let p=n.a;n.a=0;try{return ce(p,n.b,a,b)}finally{n.a=p}};return new Promise(i)}finally{n.a=0}},__wbg_new_with_byte_offset_and_length_9e1e664fe1a5d385:function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},__wbg_new_with_length_4b57a7a5dc67221c:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_opt_buffer_source_and_init_f51f4fbe98d29f2e:function(){return c(function(e,t){return new Response(e,t)},arguments)},__wbg_new_with_opt_readable_stream_and_init_def67835ea705e4d:function(){return c(function(e,t){return new Response(e,t)},arguments)},__wbg_new_with_opt_str_and_init_11bb6f5faad68c85:function(){return c(function(e,t,n){return new Response(e===0?void 0:d(e,t),n)},arguments)},__wbg_new_with_str_and_init_df876572184fe639:function(){return c(function(e,t,n){return new Request(d(e,t),n)},arguments)},__wbg_next_8cb028b6ba50743f:function(){return c(function(e){return e.next()},arguments)},__wbg_next_cfd0b146c9538df8:function(e){return e.next},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_bce4dc999095ea77:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_956c7493c68e29b4:function(e,t,n){Uint8Array.prototype.set.call(M(e,t),n)},__wbg_put_27edc2ab773a21be:function(){return c(function(e,t,n,i){return e.put(d(t,n),i)},arguments)},__wbg_queueMicrotask_4698f900840e3286:function(e){queueMicrotask(e)},__wbg_queueMicrotask_477a5533c7100338:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return c(function(e,t){e.randomFillSync(t)},arguments)},__wbg_read_8426c146431f2905:function(e){return e.read()},__wbg_releaseLock_188846ef719acb10:function(e){e.releaseLock()},__wbg_require_b4edbdcf3e2a1ef0:function(){return c(function(){return module.require},arguments)},__wbg_resolve_0183de2e8c6b1d54:function(e){return Promise.resolve(e)},__wbg_respond_3cdb4cf32683fd79:function(){return c(function(e,t){e.respond(t>>>0)},arguments)},__wbg_setAlarm_c9229fb49928e287:function(){return c(function(e,t,n){return e.setAlarm(t,n)},arguments)},__wbg_set_3ab3dfede3bae139:function(){return c(function(e,t,n,i,u){e.set(d(t,n),d(i,u))},arguments)},__wbg_set_5f806304fb633ab3:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_86698c227e5b9dad:function(e,t,n){e.set(M(t,n))},__wbg_set_a6ba3ac0e634b822:function(){return c(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_body_d1153b16a2b95ca1:function(e,t){e.body=t},__wbg_set_cache_5a01a8b5e6ca6cf2:function(e,t){e.cache=ae[t]},__wbg_set_criticalError_3b493d341796397b:function(e,t){e.criticalError=t!==0},__wbg_set_da33c120a6584674:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_178db2684a27c112:function(e,t){e.headers=t},__wbg_set_headers_877ed41890d28af2:function(e,t){e.headers=t},__wbg_set_instanceId_2e5d2db011e9f6af:function(e,t){e.instanceId=t>>>0},__wbg_set_method_b4ede299b2064f37:function(e,t,n){e.method=d(t,n)},__wbg_set_redirect_97b881e7430f3438:function(e,t){e.redirect=fe[t]},__wbg_set_signal_9022b5aa06a6ce5b:function(e,t){e.signal=t},__wbg_set_status_56097e6101a48227:function(e,t){e.status=t},__wbg_size_74fdf4919eb82558:function(e){return e.size},__wbg_static_accessor_GLOBAL_60a4124bab7dcc9a:function(){let e=typeof global>"u"?null:global;return f(e)?0:w(e)},__wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13:function(){let e=typeof globalThis>"u"?null:globalThis;return f(e)?0:w(e)},__wbg_static_accessor_INIT_STATE_2271957acdc7fe6e:function(){return J},__wbg_static_accessor_SELF_4c95f759a91e9aae:function(){let e=typeof self>"u"?null:self;return f(e)?0:w(e)},__wbg_static_accessor_WINDOW_44b435597f9e9ee7:function(){let e=typeof window>"u"?null:window;return f(e)?0:w(e)},__wbg_status_9e6505cfa3e73a7c:function(e){return e.status},__wbg_storage_e350ca27f103b85e:function(){return c(function(e){return e.storage},arguments)},__wbg_subarray_42216645a367cd7a:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_254bab9b266a77a5:function(e,t,n){return e.then(t,n)},__wbg_then_3ea18602c6a5123b:function(e,t){return e.then(t)},__wbg_toString_c3e29dc77827b5c7:function(){return c(function(e,t){let n=t.toString(),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},arguments)},__wbg_transaction_afcd84163102ab81:function(){return c(function(e,t){return e.transaction(t)},arguments)},__wbg_url_74200ddca55ab638:function(e,t){let n=t.url,i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg_value_3d3defe09fb1ffca:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_view_15fa5865c6b336e3:function(e){let t=e.view;return f(t)?0:w(t)},__wbg_webSocket_651aa54cd4107a97:function(){return c(function(e){let t=e.webSocket;return f(t)?0:w(t)},arguments)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t,oe)},__wbindgen_cast_0000000000000002:function(e,t){return C(e,t,ie)},__wbindgen_cast_0000000000000003:function(e,t){return C(e,t,se)},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e){return e},__wbindgen_cast_0000000000000006:function(e,t){return M(e,t)},__wbindgen_cast_0000000000000007:function(e,t){return d(e,t)},__wbindgen_cast_0000000000000008:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=_.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function s(){if(re){L();return}}function ie(r,e,t){s(),_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___wasm_bindgen_41f132779d44f7df___JsValue______true_(r,e,t)}function oe(r,e,t){let n;return s(),n=_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___worker_sys_959aebd343b3f505___types__durable_object__transaction__DurableObjectTransaction__js_sys_1e928aaf8b129fc7___Promise__true_(r,e,t),n}function se(r,e,t){let n;if(s(),n=_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___wasm_bindgen_41f132779d44f7df___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_41f132779d44f7df___JsError___true_(r,e,t),n[1])throw he(n[0])}function ce(r,e,t,n){s(),_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___js_sys_1e928aaf8b129fc7___Function_fn_wasm_bindgen_41f132779d44f7df___JsValue_____wasm_bindgen_41f132779d44f7df___sys__Undefined___js_sys_1e928aaf8b129fc7___Function_fn_wasm_bindgen_41f132779d44f7df___JsValue_____wasm_bindgen_41f132779d44f7df___sys__Undefined_______true_(r,e,t,n)}var ue=["bytes"],ae=["default","no-store","reload","no-cache","force-cache","only-if-cached"],fe=["follow","error","manual"],o=0,be=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_containerstartupoptions_free(r,1)}),ge=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingbytesource_free(r,1)}),de=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingsink_free(r,1)}),we=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingsource_free(r,1)}),$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_minifyconfig_free(r,1)}),le=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_r2range_free(r,1)}),H=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabrouterwalletdurableobject_free(r,1)}),G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabsigningworkerpresignsessiondurableobject_free(r,1)}),K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabtenantrootcreationdurableobject_free(r,1)});function w(r){let e=_.__externref_table_alloc();return _.__wbindgen_externrefs.set(e,r),e}var Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>{r.instance===o&&_.__wbindgen_destroy_closure(r.a,r.b)});function V(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,u="[";i>0&&(u+=V(r[0]));for(let a=1;a<i;a++)u+=", "+V(r[a]);return u+="]",u}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}
|
|
1
|
+
import{WorkerEntrypoint as ve}from"cloudflare:workers";var J=globalThis.__worker_init_state={criticalError:!1,instanceId:0};import X from"./index_bg.wasm";var x=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,be.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_containerstartupoptions_free(e,0)}get enableInternet(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_containerstartupoptions_enableInternet(this.__wbg_ptr),e===16777215?void 0:e!==0}get entrypoint(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;s(),e=_.__wbg_get_containerstartupoptions_entrypoint(this.__wbg_ptr);var t=ne(e[0],e[1]).slice();return _.__wbindgen_free(e[0],e[1]*4,4),t}get env(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_containerstartupoptions_env(this.__wbg_ptr),e}set enableInternet(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_containerstartupoptions_enableInternet(this.__wbg_ptr,f(e)?16777215:e?1:0)}set entrypoint(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t=pe(e,_.__wbindgen_malloc),n=l;s(),_.__wbg_set_containerstartupoptions_entrypoint(this.__wbg_ptr,t,n)}set env(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_containerstartupoptions_env(this.__wbg_ptr,e)}};Symbol.dispose&&(x.prototype[Symbol.dispose]=x.prototype.free);var I=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ge.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingbytesource_free(e,0)}get autoAllocateChunkSize(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.intounderlyingbytesource_autoAllocateChunkSize(this.__wbg_ptr),e>>>0}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s(),_.intounderlyingbytesource_cancel(e)}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingbytesource_pull(this.__wbg_ptr,e),t}start(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.intounderlyingbytesource_start(this.__wbg_ptr,e)}get type(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.intounderlyingbytesource_type(this.__wbg_ptr),ue[e]}};Symbol.dispose&&(I.prototype[Symbol.dispose]=I.prototype.free);var R=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,de.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingsink_free(e,0)}abort(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t=this.__destroy_into_raw(),n;return s(),n=_.intounderlyingsink_abort(t,e),n}close(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw(),t;return s(),t=_.intounderlyingsink_close(e),t}write(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingsink_write(this.__wbg_ptr,e),t}};Symbol.dispose&&(R.prototype[Symbol.dispose]=R.prototype.free);var E=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,we.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_intounderlyingsource_free(e,0)}cancel(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e=this.__destroy_into_raw();s(),_.intounderlyingsource_cancel(e)}pull(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.intounderlyingsource_pull(this.__wbg_ptr,e),t}};Symbol.dispose&&(E.prototype[Symbol.dispose]=E.prototype.free);var j=class r{static __wrap(e){let t=Object.create(r.prototype);return t.__wbg_ptr=e,Object.defineProperty(t,"__wbg_inst",{value:o,writable:!0}),$.register(t,{ptr:e,instance:o},t),t}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,$.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_minifyconfig_free(e,0)}get css(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_css(this.__wbg_ptr),e!==0}get html(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_html(this.__wbg_ptr),e!==0}get js(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_minifyconfig_js(this.__wbg_ptr),e!==0}set css(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_css(this.__wbg_ptr,e)}set html(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_html(this.__wbg_ptr,e)}set js(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_minifyconfig_js(this.__wbg_ptr,e)}};Symbol.dispose&&(j.prototype[Symbol.dispose]=j.prototype.free);var F=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,le.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_r2range_free(e,0)}get length(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_length(this.__wbg_ptr),e[0]===0?void 0:e[1]}get offset(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_offset(this.__wbg_ptr),e[0]===0?void 0:e[1]}get suffix(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.__wbg_get_r2range_suffix(this.__wbg_ptr),e[0]===0?void 0:e[1]}set length(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_length(this.__wbg_ptr,!f(e),f(e)?0:e)}set offset(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_offset(this.__wbg_ptr,!f(e),f(e)?0:e)}set suffix(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");s(),_.__wbg_set_r2range_suffix(this.__wbg_ptr,!f(e),f(e)?0:e)}};Symbol.dispose&&(F.prototype[Symbol.dispose]=F.prototype.free);var S=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,H.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabrouterwalletdurableobject_free(e,0)}alarm(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.routerabrouterwalletdurableobject_alarm(this.__wbg_ptr),e}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabrouterwalletdurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabrouterwalletdurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),H.register(this,{ptr:n,instance:o},this),this}webSocketClose(e,t,n,i){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let u=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),a=l,b;return s(),b=_.routerabrouterwalletdurableobject_webSocketClose(this.__wbg_ptr,e,t,u,a,i),b}webSocketError(e,t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let n;return s(),n=_.routerabrouterwalletdurableobject_webSocketError(this.__wbg_ptr,e,t),n}webSocketMessage(e,t){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let n;return s(),n=_.routerabrouterwalletdurableobject_webSocketMessage(this.__wbg_ptr,e,t),n}};Symbol.dispose&&(S.prototype[Symbol.dispose]=S.prototype.free);var k=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,G.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabsigningworkerpresignsessiondurableobject_free(e,0)}alarm(){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let e;return s(),e=_.routerabsigningworkerpresignsessiondurableobject_alarm(this.__wbg_ptr),e}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabsigningworkerpresignsessiondurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabsigningworkerpresignsessiondurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),G.register(this,{ptr:n,instance:o},this),this}};Symbol.dispose&&(k.prototype[Symbol.dispose]=k.prototype.free);var W=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){let e=this.__destroy_into_raw();s(),_.__wbg_routerabtenantrootcreationdurableobject_free(e,0)}fetch(e){if(this.__wbg_inst!==void 0&&this.__wbg_inst!==o)throw new Error("Invalid stale object from previous Wasm instance");let t;return s(),t=_.routerabtenantrootcreationdurableobject_fetch(this.__wbg_ptr,e),t}constructor(e,t){let n;return s(),n=_.routerabtenantrootcreationdurableobject_new(e,t),this.__wbg_ptr=n,Object.defineProperty(this,"__wbg_inst",{value:o,writable:!0}),K.register(this,{ptr:n,instance:o},this),this}};Symbol.dispose&&(W.prototype[Symbol.dispose]=W.prototype.free);function L(){o++,v=null,O=null,typeof numBytesDecoded<"u"&&(numBytesDecoded=0),typeof l<"u"&&(l=0),re=!1,q=new WebAssembly.Instance(X,te()),_=q.exports,_.__wbindgen_start()}function Y(){let r;return s(),r=_.__worker_init_state(),r}function Z(r,e,t){let n;return s(),n=_.fetch(r,e,t),n}function ee(){s(),_.init()}function te(){return{__proto__:null,"./index_bg.js":{__proto__:null,__wbg_Error_9dc85fe1bc224456:function(e,t){return Error(d(e,t))},__wbg_Number_4779d427bae39753:function(e){return Number(e)},__wbg_String_8564e559799eccda:function(e,t){let n=String(t),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg___wbindgen_bigint_get_as_i64_8ea6736501f396b6:function(e,t){let n=t,i=typeof n=="bigint"?n:void 0;g().setBigInt64(e+8,f(i)?BigInt(0):i,!0),g().setInt32(e+0,!f(i),!0)},__wbg___wbindgen_boolean_get_b131b2f36d6b2f55:function(e){let t=e,n=typeof t=="boolean"?t:void 0;return f(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_56c147eb1a51f0c4:function(e,t){let n=V(t),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg___wbindgen_in_ce8569b2fc6f5088:function(e,t){return e in t},__wbg___wbindgen_is_bigint_df272c65456269c2:function(e){return typeof e=="bigint"},__wbg___wbindgen_is_function_147961669f068cd4:function(e){return typeof e=="function"},__wbg___wbindgen_is_null_or_undefined_b02321d39cf26d8d:function(e){return e==null},__wbg___wbindgen_is_object_3a2c414391dbf751:function(e){let t=e;return typeof t=="object"&&t!==null},__wbg___wbindgen_is_string_6541b0f6ecd4e8e5:function(e){return typeof e=="string"},__wbg___wbindgen_is_undefined_4410e3c20a99fa97:function(e){return e===void 0},__wbg___wbindgen_jsval_eq_174c93ec61bab0c5:function(e,t){return e===t},__wbg___wbindgen_jsval_loose_eq_e07e3b1f5db6da6c:function(e,t){return e==t},__wbg___wbindgen_number_get_588ed6b97f0d7e14:function(e,t){let n=t,i=typeof n=="number"?n:void 0;g().setFloat64(e+8,f(i)?0:i,!0),g().setInt32(e+0,!f(i),!0)},__wbg___wbindgen_string_get_fa2687d531ed17a5:function(e,t){let n=t,i=typeof n=="string"?n:void 0;var u=f(i)?0:y(i,_.__wbindgen_malloc,_.__wbindgen_realloc),a=l;g().setInt32(e+4,a,!0),g().setInt32(e+0,u,!0)},__wbg___wbindgen_throw_bbadd78c1bac3a77:function(e,t){throw new Error(d(e,t))},__wbg__wbg_cb_unref_c2301a3c9b78104b:function(e){e._wbg_cb_unref()},__wbg_body_442a47f02322d7b0:function(e){let t=e.body;return f(t)?0:w(t)},__wbg_body_b06d3a9c5933702e:function(e){let t=e.body;return f(t)?0:w(t)},__wbg_buffer_8524b3453cde4918:function(e){return e.buffer},__wbg_byobRequest_cc72d210de793e64:function(e){let t=e.byobRequest;return f(t)?0:w(t)},__wbg_byteLength_96807b1d9ab24a4c:function(e){return e.byteLength},__wbg_byteOffset_a9c7002428843c41:function(e){return e.byteOffset},__wbg_call_91f00ddc43e01490:function(){return c(function(e,t){return e.call(t)},arguments)},__wbg_call_ec09a4cf93377d3a:function(){return c(function(e,t,n){return e.call(t,n)},arguments)},__wbg_cancel_f3a197b26dc88b39:function(e){return e.cancel()},__wbg_catch_66060324c27be6f7:function(e,t){return e.catch(t)},__wbg_cause_5f2ec35e043cc9cf:function(e){return e.cause},__wbg_cf_22a1527cd02b5acd:function(){return c(function(e){let t=e.cf;return f(t)?0:w(t)},arguments)},__wbg_cf_ee73de251a6dda8a:function(){return c(function(e){let t=e.cf;return f(t)?0:w(t)},arguments)},__wbg_close_388d99468213b286:function(){return c(function(e){e.close()},arguments)},__wbg_close_4857e22d08b71356:function(){return c(function(e){e.close()},arguments)},__wbg_constructor_04971ae0b51c1fc5:function(e){return e.constructor},__wbg_crypto_38df2bab126b63dc:function(e){return e.crypto},__wbg_delete_0332d9732b7b743f:function(){return c(function(e,t,n){var i=ne(t,n).slice();return _.__wbindgen_free(t,n*4,4),e.delete(i)},arguments)},__wbg_delete_e21a892409559f6e:function(){return c(function(e,t,n){return e.delete(d(t,n))},arguments)},__wbg_done_6a8439e544ec6206:function(e){return e.done},__wbg_enqueue_bbeb09ba0b140f76:function(){return c(function(e,t){e.enqueue(t)},arguments)},__wbg_entries_5a6a7e7e0df09fe5:function(e){return Object.entries(e)},__wbg_error_6651fee1c71e5da9:function(e){console.error(e)},__wbg_error_9a99766f65a03031:function(e,t){console.error(e,t)},__wbg_fetch_1d1b09eaf160ddf3:function(e,t,n){return e.fetch(t,n)},__wbg_fetch_931fc4244e17ef2d:function(e,t,n,i){return e.fetch(d(t,n),i)},__wbg_fetch_b447ca2a0c0e6583:function(){return c(function(e,t){return e.fetch(t)},arguments)},__wbg_fetch_be42f5d2be38cba1:function(){return c(function(e,t){return e.fetch(t)},arguments)},__wbg_getAlarm_5528fdbdd50b2988:function(){return c(function(e,t){return e.getAlarm(t)},arguments)},__wbg_getByName_5f8a4ae327c50115:function(){return c(function(e,t,n){return e.getByName(d(t,n))},arguments)},__wbg_getRandomValues_c44a50d8cfdaebeb:function(){return c(function(e,t){e.getRandomValues(t)},arguments)},__wbg_getReader_bb0230851fbf986b:function(){return c(function(e){return e.getReader()},arguments)},__wbg_getTime_ef2e115ede346a26:function(e){return e.getTime()},__wbg_get_44e98e27bda25b5b:function(){return c(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_4b90d6d8c5deb5d5:function(e,t){return e[t>>>0]},__wbg_get_52a8a619f7b88df6:function(){return c(function(e,t){return Reflect.get(e,t)},arguments)},__wbg_get_6e0eec3a0a32f612:function(){return c(function(e,t,n){return e.get(d(t,n))},arguments)},__wbg_get_a82defe8d6b5b2e5:function(){return c(function(e,t,n,i){let u=t.get(d(n,i));var a=f(u)?0:y(u,_.__wbindgen_malloc,_.__wbindgen_realloc),b=l;g().setInt32(e+4,b,!0),g().setInt32(e+0,a,!0)},arguments)},__wbg_get_a87a6c1024dddd3b:function(){return c(function(e,t,n){return e.get(d(t,n))},arguments)},__wbg_get_c538c7fb0359c222:function(){return c(function(e,t){let n=Reflect.get(e,t);return f(n)?0:w(n)},arguments)},__wbg_get_done_c21b9933fc9a9e9c:function(e){let t=e.done;return f(t)?16777215:t?1:0},__wbg_get_unchecked_46e778e3cec74b5e:function(e,t){return e[t>>>0]},__wbg_get_value_ad568c7d3db9073f:function(e){return e.value},__wbg_get_with_ref_key_6412cf3094599694:function(e,t){return e[t]},__wbg_headers_5b19cf40627ae54d:function(e){return e.headers},__wbg_headers_e1e94862a6a36f9e:function(e){return e.headers},__wbg_idFromName_32b0b5012b5f6535:function(){return c(function(e,t,n){return e.idFromName(d(t,n))},arguments)},__wbg_id_0c05f441a81ef0fc:function(){return c(function(e){return e.id},arguments)},__wbg_instanceId_3970204fcbf0c41d:function(e){return e.instanceId},__wbg_instanceof_ArrayBuffer_a581da923203f29f:function(e){let t;try{t=e instanceof ArrayBuffer}catch{t=!1}return t},__wbg_instanceof_Error_cb5ebd65d798655e:function(e){let t;try{t=e instanceof Error}catch{t=!1}return t},__wbg_instanceof_Map_7f94c740225003e2:function(e){let t;try{t=e instanceof Map}catch{t=!1}return t},__wbg_instanceof_ReadableStream_b1eab376911b1b77:function(e){let t;try{t=e instanceof ReadableStream}catch{t=!1}return t},__wbg_instanceof_Response_36a65a969abaa7c6:function(e){let t;try{t=e instanceof Response}catch{t=!1}return t},__wbg_instanceof_Uint8Array_b6fe1ac89eba107e:function(e){let t;try{t=e instanceof Uint8Array}catch{t=!1}return t},__wbg_isArray_139f48e3c057ede8:function(e){return Array.isArray(e)},__wbg_isSafeInteger_c22ccb4af2201fe9:function(e){return Number.isSafeInteger(e)},__wbg_iterator_9b36cebf3be7b7cd:function(){return Symbol.iterator},__wbg_json_d44033e4c5c27d14:function(){return c(function(e){return e.json()},arguments)},__wbg_keys_6fe253f5073ff078:function(e){return e.keys()},__wbg_keys_f365fabedba1fe04:function(e){return e.keys()},__wbg_length_68a9d5278d084f4f:function(e){return e.length},__wbg_length_fb04d16d7bdf6d4c:function(e){return e.length},__wbg_list_1e28f18cc3692a47:function(){return c(function(e,t){return e.list(t)},arguments)},__wbg_list_fc2e1da79650bd5a:function(){return c(function(e,t){return e.list(t)},arguments)},__wbg_log_6614a4effdb4e983:function(e){console.log(e)},__wbg_message_5c6ab4dd6c4b34e8:function(e){return e.message},__wbg_method_f687b49ca8e2b38d:function(e,t){let n=t.method,i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg_minifyconfig_new:function(e){return j.__wrap(e)},__wbg_msCrypto_bd5a034af96bcba6:function(e){return e.msCrypto},__wbg_name_72adaf2fce06bbe8:function(e){return e.name},__wbg_name_f60e249a46c5285a:function(e){return e.name},__wbg_new_0_878c6ec3a1c600f3:function(){return new Date},__wbg_new_0b303268aa395a38:function(){return new Array},__wbg_new_189262ff31890c23:function(){return c(function(){return new Headers},arguments)},__wbg_new_20b778a4c5c691c3:function(){return new Object},__wbg_new_5fae30e6b23db8df:function(e,t){return new Error(d(e,t))},__wbg_new_883c0db065f06efd:function(){return new Map},__wbg_new_a21cf41c5c809e4c:function(e){return new Date(e)},__wbg_new_b06772b280cc6e52:function(e){return new Uint8Array(e)},__wbg_new_typed_90c3f6c29ba36d19:function(e,t){try{var n={a:e,b:t},i=(a,b)=>{let p=n.a;n.a=0;try{return ce(p,n.b,a,b)}finally{n.a=p}};return new Promise(i)}finally{n.a=0}},__wbg_new_with_byte_offset_and_length_9e1e664fe1a5d385:function(e,t,n){return new Uint8Array(e,t>>>0,n>>>0)},__wbg_new_with_length_4b57a7a5dc67221c:function(e){return new Uint8Array(e>>>0)},__wbg_new_with_opt_buffer_source_and_init_f51f4fbe98d29f2e:function(){return c(function(e,t){return new Response(e,t)},arguments)},__wbg_new_with_opt_readable_stream_and_init_def67835ea705e4d:function(){return c(function(e,t){return new Response(e,t)},arguments)},__wbg_new_with_opt_str_and_init_11bb6f5faad68c85:function(){return c(function(e,t,n){return new Response(e===0?void 0:d(e,t),n)},arguments)},__wbg_new_with_str_and_init_df876572184fe639:function(){return c(function(e,t,n){return new Request(d(e,t),n)},arguments)},__wbg_next_8cb028b6ba50743f:function(){return c(function(e){return e.next()},arguments)},__wbg_next_cfd0b146c9538df8:function(e){return e.next},__wbg_node_84ea875411254db1:function(e){return e.node},__wbg_now_bce4dc999095ea77:function(){return Date.now()},__wbg_process_44c7a14e11e9f69e:function(e){return e.process},__wbg_prototypesetcall_956c7493c68e29b4:function(e,t,n){Uint8Array.prototype.set.call(M(e,t),n)},__wbg_put_27edc2ab773a21be:function(){return c(function(e,t,n,i){return e.put(d(t,n),i)},arguments)},__wbg_queueMicrotask_4698f900840e3286:function(e){queueMicrotask(e)},__wbg_queueMicrotask_477a5533c7100338:function(e){return e.queueMicrotask},__wbg_randomFillSync_6c25eac9869eb53c:function(){return c(function(e,t){e.randomFillSync(t)},arguments)},__wbg_read_8426c146431f2905:function(e){return e.read()},__wbg_releaseLock_188846ef719acb10:function(e){e.releaseLock()},__wbg_require_b4edbdcf3e2a1ef0:function(){return c(function(){return module.require},arguments)},__wbg_resolve_0183de2e8c6b1d54:function(e){return Promise.resolve(e)},__wbg_respond_3cdb4cf32683fd79:function(){return c(function(e,t){e.respond(t>>>0)},arguments)},__wbg_setAlarm_c9229fb49928e287:function(){return c(function(e,t,n){return e.setAlarm(t,n)},arguments)},__wbg_set_3ab3dfede3bae139:function(){return c(function(e,t,n,i,u){e.set(d(t,n),d(i,u))},arguments)},__wbg_set_5f806304fb633ab3:function(e,t,n){return e.set(t,n)},__wbg_set_6be42768c690e380:function(e,t,n){e[t]=n},__wbg_set_86698c227e5b9dad:function(e,t,n){e.set(M(t,n))},__wbg_set_a6ba3ac0e634b822:function(){return c(function(e,t,n){return Reflect.set(e,t,n)},arguments)},__wbg_set_body_d1153b16a2b95ca1:function(e,t){e.body=t},__wbg_set_cache_5a01a8b5e6ca6cf2:function(e,t){e.cache=ae[t]},__wbg_set_criticalError_3b493d341796397b:function(e,t){e.criticalError=t!==0},__wbg_set_da33c120a6584674:function(e,t,n){e[t>>>0]=n},__wbg_set_headers_178db2684a27c112:function(e,t){e.headers=t},__wbg_set_headers_877ed41890d28af2:function(e,t){e.headers=t},__wbg_set_instanceId_2e5d2db011e9f6af:function(e,t){e.instanceId=t>>>0},__wbg_set_method_b4ede299b2064f37:function(e,t,n){e.method=d(t,n)},__wbg_set_redirect_97b881e7430f3438:function(e,t){e.redirect=fe[t]},__wbg_set_signal_9022b5aa06a6ce5b:function(e,t){e.signal=t},__wbg_set_status_56097e6101a48227:function(e,t){e.status=t},__wbg_size_74fdf4919eb82558:function(e){return e.size},__wbg_static_accessor_GLOBAL_60a4124bab7dcc9a:function(){let e=typeof global>"u"?null:global;return f(e)?0:w(e)},__wbg_static_accessor_GLOBAL_THIS_95ca6460658b5d13:function(){let e=typeof globalThis>"u"?null:globalThis;return f(e)?0:w(e)},__wbg_static_accessor_INIT_STATE_2271957acdc7fe6e:function(){return J},__wbg_static_accessor_SELF_4c95f759a91e9aae:function(){let e=typeof self>"u"?null:self;return f(e)?0:w(e)},__wbg_static_accessor_WINDOW_44b435597f9e9ee7:function(){let e=typeof window>"u"?null:window;return f(e)?0:w(e)},__wbg_status_9e6505cfa3e73a7c:function(e){return e.status},__wbg_storage_e350ca27f103b85e:function(){return c(function(e){return e.storage},arguments)},__wbg_subarray_42216645a367cd7a:function(e,t,n){return e.subarray(t>>>0,n>>>0)},__wbg_then_254bab9b266a77a5:function(e,t,n){return e.then(t,n)},__wbg_then_3ea18602c6a5123b:function(e,t){return e.then(t)},__wbg_toString_c3e29dc77827b5c7:function(){return c(function(e,t){let n=t.toString(),i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},arguments)},__wbg_transaction_afcd84163102ab81:function(){return c(function(e,t){return e.transaction(t)},arguments)},__wbg_url_74200ddca55ab638:function(e,t){let n=t.url,i=y(n,_.__wbindgen_malloc,_.__wbindgen_realloc),u=l;g().setInt32(e+4,u,!0),g().setInt32(e+0,i,!0)},__wbg_value_3d3defe09fb1ffca:function(e){return e.value},__wbg_versions_276b2795b1c6a219:function(e){return e.versions},__wbg_view_15fa5865c6b336e3:function(e){let t=e.view;return f(t)?0:w(t)},__wbg_waitUntil_909855b1aeec03d5:function(){return c(function(e,t){e.waitUntil(t)},arguments)},__wbg_webSocket_651aa54cd4107a97:function(){return c(function(e){let t=e.webSocket;return f(t)?0:w(t)},arguments)},__wbindgen_cast_0000000000000001:function(e,t){return C(e,t,oe)},__wbindgen_cast_0000000000000002:function(e,t){return C(e,t,ie)},__wbindgen_cast_0000000000000003:function(e,t){return C(e,t,se)},__wbindgen_cast_0000000000000004:function(e){return e},__wbindgen_cast_0000000000000005:function(e){return e},__wbindgen_cast_0000000000000006:function(e,t){return M(e,t)},__wbindgen_cast_0000000000000007:function(e,t){return d(e,t)},__wbindgen_cast_0000000000000008:function(e){return BigInt.asUintN(64,e)},__wbindgen_init_externref_table:function(){let e=_.__wbindgen_externrefs,t=e.grow(4);e.set(0,void 0),e.set(t+0,void 0),e.set(t+1,null),e.set(t+2,!0),e.set(t+3,!1)}}}}function s(){if(re){L();return}}function ie(r,e,t){s(),_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___wasm_bindgen_41f132779d44f7df___JsValue______true_(r,e,t)}function oe(r,e,t){let n;return s(),n=_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___worker_sys_959aebd343b3f505___types__durable_object__transaction__DurableObjectTransaction__js_sys_1e928aaf8b129fc7___Promise__true_(r,e,t),n}function se(r,e,t){let n;if(s(),n=_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___wasm_bindgen_41f132779d44f7df___JsValue__core_608f92abc48d28da___result__Result_____wasm_bindgen_41f132779d44f7df___JsError___true_(r,e,t),n[1])throw he(n[0])}function ce(r,e,t,n){s(),_.wasm_bindgen_41f132779d44f7df___convert__closures_____invoke___js_sys_1e928aaf8b129fc7___Function_fn_wasm_bindgen_41f132779d44f7df___JsValue_____wasm_bindgen_41f132779d44f7df___sys__Undefined___js_sys_1e928aaf8b129fc7___Function_fn_wasm_bindgen_41f132779d44f7df___JsValue_____wasm_bindgen_41f132779d44f7df___sys__Undefined_______true_(r,e,t,n)}var ue=["bytes"],ae=["default","no-store","reload","no-cache","force-cache","only-if-cached"],fe=["follow","error","manual"],o=0,be=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_containerstartupoptions_free(r,1)}),ge=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingbytesource_free(r,1)}),de=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingsink_free(r,1)}),we=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_intounderlyingsource_free(r,1)}),$=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_minifyconfig_free(r,1)}),le=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_r2range_free(r,1)}),H=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabrouterwalletdurableobject_free(r,1)}),G=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabsigningworkerpresignsessiondurableobject_free(r,1)}),K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(({ptr:r,instance:e})=>{e===o&&_.__wbg_routerabtenantrootcreationdurableobject_free(r,1)});function w(r){let e=_.__externref_table_alloc();return _.__wbindgen_externrefs.set(e,r),e}var Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(r=>{r.instance===o&&_.__wbindgen_destroy_closure(r.a,r.b)});function V(r){let e=typeof r;if(e=="number"||e=="boolean"||r==null)return`${r}`;if(e=="string")return`"${r}"`;if(e=="symbol"){let i=r.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=r.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(r)){let i=r.length,u="[";i>0&&(u+=V(r[0]));for(let a=1;a<i;a++)u+=", "+V(r[a]);return u+="]",u}let t=/\[object ([^\]]+)\]/.exec(toString.call(r)),n;if(t&&t.length>1)n=t[1];else return toString.call(r);if(n=="Object")try{return"Object("+JSON.stringify(r)+")"}catch{return"Object"}return r instanceof Error?`${r.name}: ${r.message}
|
|
2
2
|
${r.stack}`:n}function ne(r,e){r=r>>>0;let t=g(),n=[];for(let i=r;i<r+4*e;i+=4)n.push(_.__wbindgen_externrefs.get(t.getUint32(i,!0)));return _.__externref_drop_slice(r,e),n}function M(r,e){return r=r>>>0,z().subarray(r/1,r/1+e)}var v=null;function g(){return(v===null||v.buffer.detached===!0||v.buffer.detached===void 0&&v.buffer!==_.memory.buffer)&&(v=new DataView(_.memory.buffer)),v}function d(r,e){return ye(r>>>0,e)}var O=null;function z(){return(O===null||O.byteLength===0)&&(O=new Uint8Array(_.memory.buffer)),O}function c(r,e){try{return r.apply(this,e)}catch(t){let n=w(t);_.__wbindgen_exn_store(n)}}function f(r){return r==null}function C(r,e,t){let n={a:r,b:e,cnt:1,instance:o},i=(...u)=>{if(n.instance!==o)throw new Error("Cannot invoke closure from previous WASM instance");n.cnt++;let a=n.a;n.a=0;try{return t(a,n.b,...u)}finally{n.a=a,i._wbg_cb_unref()}};return i._wbg_cb_unref=()=>{--n.cnt===0&&(_.__wbindgen_destroy_closure(n.a,n.b),n.a=0,Q.unregister(n))},Q.register(i,n,n),i}function pe(r,e){let t=e(r.length*4,4)>>>0;for(let n=0;n<r.length;n++){let i=w(r[n]);g().setUint32(t+4*n,i,!0)}return l=r.length,t}function y(r,e,t){if(t===void 0){let b=P.encode(r),p=e(b.length,1)>>>0;return z().subarray(p,p+b.length).set(b),l=b.length,p}let n=r.length,i=e(n,1)>>>0,u=z(),a=0;for(;a<n;a++){let b=r.charCodeAt(a);if(b>127)break;u[i+a]=b}if(a!==n){a!==0&&(r=r.slice(a)),i=t(i,n,n=a+r.length*3,1)>>>0;let b=z().subarray(i+a,i+n),p=P.encodeInto(r,b);a+=p.written,i=t(i,n,a,1)>>>0}return l=a,i}var re=!1;function he(r){let e=_.__wbindgen_externrefs.get(r);return _.__externref_table_dealloc(r),e}var _e=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});_e.decode();function ye(r,e){return _e.decode(z().subarray(r,r+e))}var P=new TextEncoder;"encodeInto"in P||(P.encodeInto=function(r,e){let t=P.encode(r);return e.set(t),{read:r.length,written:t.length}});var l=0,q=new WebAssembly.Instance(X,te()),_=q.exports;_.__wbindgen_start();Error.stackTraceLimit=100;var m=Y();function B(){m.criticalError&&(console.log("Reinitializing Wasm application"),L(),m.criticalError=!1,m.instanceId++)}addEventListener("error",r=>{N(r.error)});function N(r){r instanceof WebAssembly.RuntimeError&&(console.error("Critical",r),m.criticalError=!0)}var T=class extends ve{};T.prototype.fetch=function(e){return Z.call(this,e,this.env,this.ctx)};T.prototype.init=ee;var je={set:(r,e,t,n)=>Reflect.set(r.instance,e,t,n),has:(r,e)=>Reflect.has(r.instance,e),deleteProperty:(r,e)=>Reflect.deleteProperty(r.instance,e),apply:(r,e,t)=>Reflect.apply(r.instance,e,t),construct:(r,e,t)=>Reflect.construct(r.instance,e,t),getPrototypeOf:r=>Reflect.getPrototypeOf(r.instance),setPrototypeOf:(r,e)=>Reflect.setPrototypeOf(r.instance,e),isExtensible:r=>Reflect.isExtensible(r.instance),preventExtensions:r=>Reflect.preventExtensions(r.instance),getOwnPropertyDescriptor:(r,e)=>Reflect.getOwnPropertyDescriptor(r.instance,e),defineProperty:(r,e,t)=>Reflect.defineProperty(r.instance,e,t),ownKeys:r=>Reflect.ownKeys(r.instance)},h={construct(r,e,t){try{B();let n={instance:Reflect.construct(r,e,t),instanceId:m.instanceId,ctor:r,args:e,newTarget:t};return new Proxy(n,{...je,get(i,u,a){i.instanceId!==m.instanceId&&(i.instance=Reflect.construct(i.ctor,i.args,i.newTarget),i.instanceId=m.instanceId);let b=Reflect.get(i.instance,u,a);return typeof b!="function"?b:b.constructor===Function?new Proxy(b,{apply(p,U,D){B();try{return p.apply(U,D)}catch(A){throw N(A),A}}}):new Proxy(b,{async apply(p,U,D){B();try{return await p.apply(U,D)}catch(A){throw N(A),A}}})}})}catch(n){throw m.criticalError=!0,n}}},Fe=new Proxy(T,h),Se=new Proxy(x,h),ke=new Proxy(I,h),We=new Proxy(R,h),Ae=new Proxy(E,h),Oe=new Proxy(j,h),ze=new Proxy(F,h),Pe=new Proxy(S,h),Te=new Proxy(k,h),Ue=new Proxy(W,h);export{Se as ContainerStartupOptions,ke as IntoUnderlyingByteSource,We as IntoUnderlyingSink,Ae as IntoUnderlyingSource,Oe as MinifyConfig,ze as R2Range,Pe as RouterAbRouterWalletDurableObject,Te as RouterAbSigningWorkerPresignSessionDurableObject,Ue as RouterAbTenantRootCreationDurableObject,Fe as default};
|
|
Binary file
|
|
@@ -846,7 +846,7 @@ function createCloudflareD1RouterApiAuthAssembly(input) {
|
|
|
846
846
|
tenantRootCustodyLineage: options.tenantRootCustodyLineage,
|
|
847
847
|
getWalletStore,
|
|
848
848
|
activateSideEffects: walletRegistrationActivateSideEffectStore(options),
|
|
849
|
-
registrationRead: new D1WalletRegistrationRead(options.database, options.registrationAuthority ?? null, walletRegistrationNearProvisioningSideEffectStore(options), getRegistrationCeremonyIntentStore, yaoLifecycleDecisions),
|
|
849
|
+
registrationRead: new D1WalletRegistrationRead(options.database, options.registrationAuthority ?? null, walletRegistrationNearProvisioningSideEffectStore(options), getRegistrationCeremonyIntentStore, yaoLifecycleDecisions, walletRegistrationCommitStore),
|
|
850
850
|
walletRegistrationCommitStore,
|
|
851
851
|
walletCustodyCommitStore,
|
|
852
852
|
walletAuthMethods,
|
|
@@ -2,6 +2,7 @@ import { normalizeOptionalTrimmedString } from "../../../../shared-ts/src/utils/
|
|
|
2
2
|
import { isPlainObject } from "../../../../shared-ts/src/utils/validation.js";
|
|
3
3
|
import { prepareD1RegistrationHomeReservation } from "./d1WalletExecutionAuthority.js";
|
|
4
4
|
import { parseD1StoredAddAuthMethodIntent, parseD1StoredAddSignerIntent, parseD1StoredWalletAddAuthMethodCeremony, parseD1StoredWalletAddAuthMethodFinalizeReplay, parseD1StoredWalletAddSignerCeremony, parseD1StoredWalletAddSignerFinalizeReplay, parseD1StoredWalletRegistrationCeremony } from "./d1RegistrationCeremonyRecords.js";
|
|
5
|
+
import { retryTransientD1 } from "../../../../storage/d1Retry.js";
|
|
5
6
|
import { D1RegistrationCeremonyRecordStore } from "./d1RegistrationCeremonyRecordStore.js";
|
|
6
7
|
//#region src/router/cloudflare/d1/registration/d1RegistrationCeremonyStore.ts
|
|
7
8
|
var CloudflareD1RegistrationCeremonyIntentStore = class {
|
|
@@ -10,15 +11,21 @@ var CloudflareD1RegistrationCeremonyIntentStore = class {
|
|
|
10
11
|
this.storage = new D1RegistrationCeremonyRecordStore(input);
|
|
11
12
|
}
|
|
12
13
|
async getSetupCeremony(ceremonyId) {
|
|
13
|
-
const stored = await this.storage.get("setup-ceremony", ceremonyId);
|
|
14
|
+
const stored = await retryTransientD1(() => this.storage.get("setup-ceremony", ceremonyId));
|
|
14
15
|
if (!stored) return null;
|
|
15
16
|
const ceremony = parseD1StoredWalletRegistrationCeremony(stored.value);
|
|
16
17
|
if (!ceremony) throw new Error("Registration setup snapshot is invalid");
|
|
17
18
|
return ceremony;
|
|
18
19
|
}
|
|
19
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* One batch stores the setup snapshot, ceremony, and authenticated execution identity.
|
|
22
|
+
*
|
|
23
|
+
* The batch is safe to repeat after a transient fault. Its inserts ignore an
|
|
24
|
+
* existing row, its reads return the stored winner, and the home reservation
|
|
25
|
+
* accepts its own earlier row. A repeat after a lost commit is an exact retry.
|
|
26
|
+
*/
|
|
20
27
|
async reserveSetupCeremony(proposed, ownershipGeneration) {
|
|
21
|
-
const stored = await this.storage.insertOrReadWithCopy({
|
|
28
|
+
const stored = await retryTransientD1(() => this.storage.insertOrReadWithCopy({
|
|
22
29
|
scope: "setup-ceremony",
|
|
23
30
|
id: proposed.registrationCeremonyId,
|
|
24
31
|
value: encodeRecord(proposed),
|
|
@@ -27,7 +34,7 @@ var CloudflareD1RegistrationCeremonyIntentStore = class {
|
|
|
27
34
|
walletId: proposed.intent.walletId,
|
|
28
35
|
ceremonyId: proposed.registrationCeremonyId,
|
|
29
36
|
ownershipGeneration
|
|
30
|
-
}));
|
|
37
|
+
})));
|
|
31
38
|
const ceremony = parseD1StoredWalletRegistrationCeremony(stored.record.value);
|
|
32
39
|
if (!ceremony || !sameSetupReservation(ceremony, proposed)) throw new Error("Registration setup snapshot conflicts with its reservation");
|
|
33
40
|
const current = parseD1StoredWalletRegistrationCeremony(stored.copy.value);
|
|
@@ -201,20 +201,64 @@ function emailOtpCommitStatements(input) {
|
|
|
201
201
|
case "email_otp_wallet_registration_commit_v1": return input.emailOtp.statements;
|
|
202
202
|
}
|
|
203
203
|
}
|
|
204
|
+
function heldClaimCovers(held, authority) {
|
|
205
|
+
return held !== null && held.walletId === authority.walletId && held.rpId === authority.rpId && held.credentialIdB64u === authority.credentialIdB64u;
|
|
206
|
+
}
|
|
204
207
|
var CloudflareD1WalletRegistrationCommitStore = class {
|
|
205
208
|
constructor(input) {
|
|
206
209
|
this.credentialClaims = input.credentialClaims;
|
|
207
210
|
this.database = input.database;
|
|
208
211
|
this.scope = normalizeScope(input);
|
|
209
212
|
}
|
|
210
|
-
async reserveAuthority(authority) {
|
|
211
|
-
if (authority.kind === "passkey") await reservePasskeyCredential(this.credentialClaims, {
|
|
213
|
+
async reserveAuthority(authority, held = null) {
|
|
214
|
+
if (authority.kind === "passkey" && !heldClaimCovers(held, authority)) await reservePasskeyCredential(this.credentialClaims, {
|
|
212
215
|
walletId: authority.walletId,
|
|
213
216
|
rpId: authority.rpId,
|
|
214
217
|
credentialIdB64u: authority.credentialIdB64u
|
|
215
218
|
});
|
|
216
219
|
return this.commit.bind(this, authority);
|
|
217
220
|
}
|
|
221
|
+
async claimPasskeyAhead(input) {
|
|
222
|
+
const { authority } = input;
|
|
223
|
+
if (authority.kind !== "passkey" || !this.credentialClaims) return;
|
|
224
|
+
if (!await this.credentialClaims.claim({
|
|
225
|
+
walletId: authority.walletId,
|
|
226
|
+
rpId: authority.rpId,
|
|
227
|
+
credentialIdB64u: authority.credentialIdB64u
|
|
228
|
+
})) return;
|
|
229
|
+
await this.database.prepare(`INSERT OR IGNORE INTO registration_passkey_claims (
|
|
230
|
+
namespace, org_id, project_id, env_id, registration_ceremony_id,
|
|
231
|
+
wallet_id, rp_id, credential_id_b64u, claimed_at_ms
|
|
232
|
+
) VALUES (?1, ?2, ?3, ?4, ?5, ?6, ?7, ?8, ?9)`).bind(this.scope.namespace, this.scope.orgId, this.scope.projectId, this.scope.envId, input.registrationCeremonyId, authority.walletId, authority.rpId, authority.credentialIdB64u, input.nowMs).run();
|
|
233
|
+
}
|
|
234
|
+
prepareHeldPasskeyClaimRead(registrationCeremonyId) {
|
|
235
|
+
return this.database.prepare(`SELECT wallet_id, rp_id, credential_id_b64u
|
|
236
|
+
FROM registration_passkey_claims
|
|
237
|
+
WHERE namespace = ?1
|
|
238
|
+
AND org_id = ?2
|
|
239
|
+
AND project_id = ?3
|
|
240
|
+
AND env_id = ?4
|
|
241
|
+
AND registration_ceremony_id = ?5`).bind(this.scope.namespace, this.scope.orgId, this.scope.projectId, this.scope.envId, registrationCeremonyId);
|
|
242
|
+
}
|
|
243
|
+
parseHeldPasskeyClaimRead(result) {
|
|
244
|
+
if (!result.success) throw new Error("Registration passkey claim read failed");
|
|
245
|
+
const row = result.results?.[0];
|
|
246
|
+
if (!row) return null;
|
|
247
|
+
if (typeof row.wallet_id !== "string" || typeof row.rp_id !== "string" || typeof row.credential_id_b64u !== "string") throw new Error("Stored registration passkey claim is invalid");
|
|
248
|
+
return {
|
|
249
|
+
walletId: row.wallet_id,
|
|
250
|
+
rpId: row.rp_id,
|
|
251
|
+
credentialIdB64u: row.credential_id_b64u
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
async deleteHeldPasskeyClaim(registrationCeremonyId) {
|
|
255
|
+
await this.database.prepare(`DELETE FROM registration_passkey_claims
|
|
256
|
+
WHERE namespace = ?1
|
|
257
|
+
AND org_id = ?2
|
|
258
|
+
AND project_id = ?3
|
|
259
|
+
AND env_id = ?4
|
|
260
|
+
AND registration_ceremony_id = ?5`).bind(this.scope.namespace, this.scope.orgId, this.scope.projectId, this.scope.envId, registrationCeremonyId).run();
|
|
261
|
+
}
|
|
218
262
|
async commit(authority, input, executeBatch) {
|
|
219
263
|
assertCommitWalletIdentity(input, authority);
|
|
220
264
|
const ed25519Signer = input.walletSigners.find(isEd25519Signer);
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
//#region src/router/cloudflare/d1/registration/d1WalletRegistrationRead.ts
|
|
2
2
|
/** Read admission and immutable finalization state from one D1 snapshot. */
|
|
3
3
|
var D1WalletRegistrationRead = class {
|
|
4
|
-
constructor(database, authority, operations, getCeremonies, decisions) {
|
|
4
|
+
constructor(database, authority, operations, getCeremonies, decisions, passkeyClaims) {
|
|
5
5
|
this.database = database;
|
|
6
6
|
this.authority = authority;
|
|
7
7
|
this.operations = operations;
|
|
8
8
|
this.getCeremonies = getCeremonies;
|
|
9
9
|
this.decisions = decisions;
|
|
10
|
+
this.passkeyClaims = passkeyClaims;
|
|
10
11
|
}
|
|
11
12
|
async readRespond(home) {
|
|
12
13
|
if (!this.authority) return {
|
|
@@ -37,10 +38,11 @@ var D1WalletRegistrationRead = class {
|
|
|
37
38
|
this.authority.prepareHomeRead(home),
|
|
38
39
|
this.operations.prepareRead(operationKey),
|
|
39
40
|
ceremonies.prepareCeremonyRead(home.ceremonyId),
|
|
40
|
-
this.decisions.prepareRead(home.ceremonyId)
|
|
41
|
+
this.decisions.prepareRead(home.ceremonyId),
|
|
42
|
+
this.passkeyClaims.prepareHeldPasskeyClaimRead(home.ceremonyId)
|
|
41
43
|
]);
|
|
42
|
-
const [homeRead, operationRead, ceremonyRead, decisionRead] = results;
|
|
43
|
-
if (results.length !==
|
|
44
|
+
const [homeRead, operationRead, ceremonyRead, decisionRead, passkeyClaimRead] = results;
|
|
45
|
+
if (results.length !== 5 || !homeRead || !operationRead || !ceremonyRead || !decisionRead || !passkeyClaimRead) throw new Error("Registration finalization D1 batch returned incomplete results");
|
|
44
46
|
const admission = await this.authority.admitHomeRead(home, homeRead);
|
|
45
47
|
if (!admission.ok) return admission;
|
|
46
48
|
if (!ceremonyRead.success) throw new Error("Registration ceremony D1 read failed");
|
|
@@ -48,6 +50,7 @@ var D1WalletRegistrationRead = class {
|
|
|
48
50
|
ok: true,
|
|
49
51
|
operation: this.operations.parseReadResult(operationRead),
|
|
50
52
|
decision: this.decisions.parseRead(home.ceremonyId, decisionRead),
|
|
53
|
+
heldPasskeyClaim: this.passkeyClaims.parseHeldPasskeyClaimRead(passkeyClaimRead),
|
|
51
54
|
readCeremony: ceremonies.parseCeremonyRead.bind(ceremonies, home.ceremonyId, ceremonyRead)
|
|
52
55
|
};
|
|
53
56
|
}
|
|
@@ -529,9 +529,7 @@ function assertNeverRegistrationReceiptCommit(value) {
|
|
|
529
529
|
throw new Error(`Unsupported registration receipt commit: ${String(value)}`);
|
|
530
530
|
}
|
|
531
531
|
async function cleanupFinalizedRegistrationCeremony(input) {
|
|
532
|
-
|
|
533
|
-
await input.store.deleteCeremony(input.registrationCeremonyId);
|
|
534
|
-
} catch {}
|
|
532
|
+
await Promise.allSettled([input.store.deleteCeremony(input.registrationCeremonyId), input.passkeyClaims?.deleteHeldPasskeyClaim(input.registrationCeremonyId)]);
|
|
535
533
|
}
|
|
536
534
|
function d1RegistrationRouteDiagnostics(recorder) {
|
|
537
535
|
return {
|
|
@@ -1690,7 +1688,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
1690
1688
|
};
|
|
1691
1689
|
}
|
|
1692
1690
|
}
|
|
1693
|
-
async respondWalletRegistration(input, traceContext, timingSink) {
|
|
1691
|
+
async respondWalletRegistration(input, traceContext, timingSink, waitUntil) {
|
|
1694
1692
|
const serverTiming = timingSink ?? [];
|
|
1695
1693
|
const totalStartedAtMs = Date.now();
|
|
1696
1694
|
const mark = (name, startedAtMs) => {
|
|
@@ -1769,6 +1767,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
1769
1767
|
ownershipGeneration: homeAdmission.ownershipGeneration,
|
|
1770
1768
|
startedDispatchRoot,
|
|
1771
1769
|
expectedOrigin,
|
|
1770
|
+
waitUntil,
|
|
1772
1771
|
...input.userAgent ? { userAgent: input.userAgent } : {}
|
|
1773
1772
|
});
|
|
1774
1773
|
if (!ecdsaBranch) return {
|
|
@@ -2167,7 +2166,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2167
2166
|
ed25519: args.input.ed25519,
|
|
2168
2167
|
emailOtpEnrollment: args.input.emailOtpEnrollment,
|
|
2169
2168
|
walletCustodyCommit: args.input.walletCustodyCommit
|
|
2170
|
-
}, effectivePrepared, source, args.serverTiming, initialSessionPlan, args.lifecycleDecision);
|
|
2169
|
+
}, effectivePrepared, source, args.serverTiming, initialSessionPlan, args.lifecycleDecision, args.heldPasskeyClaim);
|
|
2171
2170
|
if (!execution.ok) return unissuedRegistrationCommit(throwIfRouterAbEd25519YaoRetryableSideEffectFailureV1(execution));
|
|
2172
2171
|
const finalized = execution.finalized;
|
|
2173
2172
|
if (finalized.kind !== "near_ed25519") {
|
|
@@ -2414,7 +2413,8 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2414
2413
|
setupClaims: verified.claims,
|
|
2415
2414
|
authoritySource: verified.source,
|
|
2416
2415
|
preparedCeremony: () => preparedCeremony,
|
|
2417
|
-
lifecycleDecision: initial.decision
|
|
2416
|
+
lifecycleDecision: initial.decision,
|
|
2417
|
+
heldPasskeyClaim: initial.heldPasskeyClaim
|
|
2418
2418
|
}),
|
|
2419
2419
|
projectReceipt: (execution) => projectWalletRegistrationSessionCommitReceiptV2({
|
|
2420
2420
|
operation: "near_provisioning",
|
|
@@ -2475,7 +2475,8 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2475
2475
|
startedAtMs: Date.now(),
|
|
2476
2476
|
promise: cleanupFinalizedRegistrationCeremony({
|
|
2477
2477
|
store: this.getRegistrationCeremonyIntentStore(),
|
|
2478
|
-
registrationCeremonyId: input.registrationCeremonyId
|
|
2478
|
+
registrationCeremonyId: input.registrationCeremonyId,
|
|
2479
|
+
passkeyClaims: this.walletRegistrationCommitStore
|
|
2479
2480
|
})
|
|
2480
2481
|
});
|
|
2481
2482
|
if (waitUntil) waitUntil(cleanup);
|
|
@@ -2650,6 +2651,16 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
2650
2651
|
expected: input.snapshot,
|
|
2651
2652
|
next: authorizedCeremony(admitted.admissionRequest)
|
|
2652
2653
|
});
|
|
2654
|
+
if (!stored && input.waitUntil && verifiedAuthority.kind === "passkey") input.waitUntil(this.walletRegistrationCommitStore.claimPasskeyAhead({
|
|
2655
|
+
registrationCeremonyId: ceremony.registrationCeremonyId,
|
|
2656
|
+
authority: verifiedAuthority,
|
|
2657
|
+
nowMs: Date.now()
|
|
2658
|
+
}).catch((error) => {
|
|
2659
|
+
console.warn("[wallet-registration] early passkey claim failed", {
|
|
2660
|
+
registrationCeremonyId: ceremony.registrationCeremonyId,
|
|
2661
|
+
reason: errorMessage(error)
|
|
2662
|
+
});
|
|
2663
|
+
}));
|
|
2653
2664
|
return {
|
|
2654
2665
|
ok: true,
|
|
2655
2666
|
registrationCeremonyId: ceremony.registrationCeremonyId,
|
|
@@ -3215,7 +3226,7 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
3215
3226
|
};
|
|
3216
3227
|
}
|
|
3217
3228
|
}
|
|
3218
|
-
async executeWalletRegistrationFinalize(request, prepared, source, serverTiming, initialSessionPlan, lifecycleDecision) {
|
|
3229
|
+
async executeWalletRegistrationFinalize(request, prepared, source, serverTiming, initialSessionPlan, lifecycleDecision, heldPasskeyClaim = null) {
|
|
3219
3230
|
const finalizeTiming = createD1RegistrationRouteTimingRecorder("wallets_register_finalize");
|
|
3220
3231
|
const totalTiming = startD1RegistrationRouteTiming("registerFinalizeTotalMs");
|
|
3221
3232
|
let startedCustody = null;
|
|
@@ -3450,7 +3461,12 @@ var CloudflareD1WalletRegistrationService = class {
|
|
|
3450
3461
|
},
|
|
3451
3462
|
consumerBinding: requestFingerprint
|
|
3452
3463
|
})
|
|
3453
|
-
}),
|
|
3464
|
+
}), recordRegistrationPromiseTiming({
|
|
3465
|
+
sink: serverTiming,
|
|
3466
|
+
name: "near_finalize_authority_reserve",
|
|
3467
|
+
startedAtMs: Date.now(),
|
|
3468
|
+
promise: this.walletRegistrationCommitStore.reserveAuthority(ceremonyAuthority, heldPasskeyClaim)
|
|
3469
|
+
})]);
|
|
3454
3470
|
if (activationConsumption.status === "rejected") throw activationConsumption.reason;
|
|
3455
3471
|
if (authorityReservation.status === "rejected") throw authorityReservation.reason;
|
|
3456
3472
|
const consumed = activationConsumption.value;
|
|
@@ -4,6 +4,7 @@ import { registrationPreparationIdFromString } from "../../../../core/types.js";
|
|
|
4
4
|
import { buildStoredWalletRegistrationEvmFamilyEcdsaPreparedBranch, findStoredWalletRegistrationEvmFamilyEcdsaBranch } from "../../../../core/RegistrationCeremonyStore.js";
|
|
5
5
|
import { routerAbEcdsaStrictRegistrationFactsBindingJson } from "../../../domains/ecdsa/routerAbEcdsaStrictRegistration.js";
|
|
6
6
|
import { buildRegistrationIntent, inferRuntimePolicyScopeFromSigningRoot } from "./d1RegistrationCeremonyRecords.js";
|
|
7
|
+
import { isTransientD1Error } from "../../../../storage/d1Retry.js";
|
|
7
8
|
import { errorMessage, registrationIntentSignerBranches, registrationPreparedContextEcdsaChainTargets, resolveRegistrationPreparedContextFromPlan } from "./d1RegistrationSetupSupport.js";
|
|
8
9
|
import { buildWalletRegistrationSetupSignature, normalizeWalletRegistrationSetupRequest, walletRegistrationSetupError, walletRegistrationSetupExpiresAtMs, walletRegistrationSetupIntentDigest } from "./d1WalletRegistrationSetup.js";
|
|
9
10
|
import { buildD1EvmFamilyEcdsaRegistrationPrepare } from "./d1EvmFamilyEcdsaRegistrationBranch.js";
|
|
@@ -29,7 +30,7 @@ async function executeD1WalletRegistrationSetup(input, dependencies) {
|
|
|
29
30
|
if (startup.status === "rejected") throw startup.reason;
|
|
30
31
|
return setup.value;
|
|
31
32
|
} catch (error) {
|
|
32
|
-
return walletRegistrationSetupError("internal", errorMessage(error) || "Failed to set up wallet registration");
|
|
33
|
+
return walletRegistrationSetupError(isTransientD1Error(error) ? "storage_unavailable" : "internal", errorMessage(error) || "Failed to set up wallet registration");
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
36
|
async function completeReservedRegistrationSetup(input, dependencies, admitted, normalized, expiresAtMs) {
|
|
@@ -13961,7 +13961,7 @@ async function handleRouterApiWalletRegistrationRespond(input) {
|
|
|
13961
13961
|
...parsed.value,
|
|
13962
13962
|
verifier: session,
|
|
13963
13963
|
...registrationUserAgentFromHeaders(input.headers) ? { userAgent: registrationUserAgentFromHeaders(input.headers) } : {}
|
|
13964
|
-
}, traceContext.value ?? void 0, serverTiming);
|
|
13964
|
+
}, traceContext.value ?? void 0, serverTiming, input.waitUntil);
|
|
13965
13965
|
return routeJson(result.ok ? 200 : 400, result, { headers: ecdsaGatewayServerTimingHeaders(serverTiming) });
|
|
13966
13966
|
}
|
|
13967
13967
|
async function handleRouterApiWalletRegistrationNearAdmission(input) {
|
|
@@ -1641,7 +1641,7 @@ async function handleRouterApiWalletRegistrationRespond(input) {
|
|
|
1641
1641
|
...parsed.value,
|
|
1642
1642
|
verifier: session,
|
|
1643
1643
|
...registrationUserAgentFromHeaders(input.headers) ? { userAgent: registrationUserAgentFromHeaders(input.headers) } : {}
|
|
1644
|
-
}, traceContext.value ?? void 0, serverTiming);
|
|
1644
|
+
}, traceContext.value ?? void 0, serverTiming, input.waitUntil);
|
|
1645
1645
|
return routeJson(result.ok ? 200 : 400, result, { headers: ecdsaGatewayServerTimingHeaders(serverTiming) });
|
|
1646
1646
|
}
|
|
1647
1647
|
async function handleRouterApiWalletRegistrationNearAdmission(input) {
|
|
@@ -9314,7 +9314,7 @@ async function handleRouterApiWalletRegistrationRespond(input) {
|
|
|
9314
9314
|
...parsed.value,
|
|
9315
9315
|
verifier: session,
|
|
9316
9316
|
...registrationUserAgentFromHeaders(input.headers) ? { userAgent: registrationUserAgentFromHeaders(input.headers) } : {}
|
|
9317
|
-
}, traceContext.value ?? void 0, serverTiming);
|
|
9317
|
+
}, traceContext.value ?? void 0, serverTiming, input.waitUntil);
|
|
9318
9318
|
return routeJson(result.ok ? 200 : 400, result, { headers: ecdsaGatewayServerTimingHeaders(serverTiming) });
|
|
9319
9319
|
}
|
|
9320
9320
|
async function handleRouterApiWalletRegistrationNearAdmission(input) {
|
|
@@ -1,12 +1,38 @@
|
|
|
1
1
|
//#region src/router/framework/registrationSetupDispatch.ts
|
|
2
|
+
/** A transient storage fault outlived its retries. The same request can succeed later. */
|
|
3
|
+
const SETUP_STORAGE_UNAVAILABLE = {
|
|
4
|
+
status: 503,
|
|
5
|
+
message: "Wallet registration setup is temporarily unavailable. Try again."
|
|
6
|
+
};
|
|
7
|
+
const SETUP_INTERNAL_FAILURE = {
|
|
8
|
+
status: 500,
|
|
9
|
+
message: "Wallet registration setup failed"
|
|
10
|
+
};
|
|
2
11
|
async function dispatchWalletRegistrationSetup(context, input) {
|
|
3
12
|
const forwarded = await context.dispatcher?.dispatch(input);
|
|
4
13
|
if (forwarded) return forwarded;
|
|
5
14
|
const result = await context.local.setupWalletRegistration(input);
|
|
6
|
-
return {
|
|
7
|
-
status:
|
|
15
|
+
if (result.ok) return {
|
|
16
|
+
status: 200,
|
|
17
|
+
body: result
|
|
18
|
+
};
|
|
19
|
+
const serverFailure = result.code === "storage_unavailable" ? SETUP_STORAGE_UNAVAILABLE : result.code === "internal" ? SETUP_INTERNAL_FAILURE : null;
|
|
20
|
+
if (!serverFailure) return {
|
|
21
|
+
status: 400,
|
|
8
22
|
body: result
|
|
9
23
|
};
|
|
24
|
+
console.error("[wallet-registration] setup failed", {
|
|
25
|
+
code: result.code,
|
|
26
|
+
reason: result.message
|
|
27
|
+
});
|
|
28
|
+
return {
|
|
29
|
+
status: serverFailure.status,
|
|
30
|
+
body: {
|
|
31
|
+
ok: false,
|
|
32
|
+
code: result.code,
|
|
33
|
+
message: serverFailure.message
|
|
34
|
+
}
|
|
35
|
+
};
|
|
10
36
|
}
|
|
11
37
|
//#endregion
|
|
12
38
|
export { dispatchWalletRegistrationSetup };
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
//#region src/storage/d1Retry.ts
|
|
2
|
+
/**
|
|
3
|
+
* The faults Cloudflare documents as safe to retry for D1: the connection to
|
|
4
|
+
* the database dropped, or the database restarted under the query. The request
|
|
5
|
+
* itself was sound. D1 retries read-only queries on its own; writes reach the
|
|
6
|
+
* caller.
|
|
7
|
+
*/
|
|
8
|
+
const TRANSIENT_D1_ERROR_FRAGMENTS = [
|
|
9
|
+
"Network connection lost",
|
|
10
|
+
"storage caused object to be reset",
|
|
11
|
+
"reset because its code was updated"
|
|
12
|
+
];
|
|
13
|
+
/** One wait before each retry, so an operation runs three times at most. */
|
|
14
|
+
const TRANSIENT_D1_RETRY_DELAYS_MS = [25, 100];
|
|
15
|
+
function isTransientD1Error(error) {
|
|
16
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
17
|
+
return TRANSIENT_D1_ERROR_FRAGMENTS.some((fragment) => message.includes(fragment));
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Runs `operation` again after a transient D1 fault. Such a fault does not say
|
|
21
|
+
* whether a write committed, so `operation` must give the same result when it
|
|
22
|
+
* runs after its own earlier commit: reads, `INSERT OR IGNORE`, and conditional
|
|
23
|
+
* writes that accept their own outcome. It must build its statements on each
|
|
24
|
+
* run. Every other error, and the last transient one, reaches the caller.
|
|
25
|
+
*/
|
|
26
|
+
async function retryTransientD1(operation) {
|
|
27
|
+
for (const delayMs of TRANSIENT_D1_RETRY_DELAYS_MS) try {
|
|
28
|
+
return await operation();
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (!isTransientD1Error(error)) throw error;
|
|
31
|
+
await new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
32
|
+
}
|
|
33
|
+
return await operation();
|
|
34
|
+
}
|
|
35
|
+
//#endregion
|
|
36
|
+
export { isTransientD1Error, retryTransientD1 };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=d1Retry.js.map
|
|
Binary file
|
|
@@ -22,7 +22,13 @@ export declare class CloudflareD1RegistrationCeremonyIntentStore {
|
|
|
22
22
|
private readonly storage;
|
|
23
23
|
constructor(input: RegistrationCeremonyIntentStoreConfig);
|
|
24
24
|
getSetupCeremony(ceremonyId: string): Promise<StoredWalletRegistrationCeremony | null>;
|
|
25
|
-
/**
|
|
25
|
+
/**
|
|
26
|
+
* One batch stores the setup snapshot, ceremony, and authenticated execution identity.
|
|
27
|
+
*
|
|
28
|
+
* The batch is safe to repeat after a transient fault. Its inserts ignore an
|
|
29
|
+
* existing row, its reads return the stored winner, and the home reservation
|
|
30
|
+
* accepts its own earlier row. A repeat after a lost commit is an exact retry.
|
|
31
|
+
*/
|
|
26
32
|
reserveSetupCeremony(proposed: StoredWalletRegistrationCeremony, ownershipGeneration: number): Promise<StoredWalletRegistrationCeremony>;
|
|
27
33
|
getCeremony(registrationCeremonyId: string): Promise<StoredWalletRegistrationCeremony | null>;
|
|
28
34
|
prepareCeremonyRead(registrationCeremonyId: string): D1PreparedStatementLike;
|
|
@@ -31,8 +31,32 @@ type D1WalletRegistrationCommitInput = (D1WalletRegistrationCommitBase & D1Walle
|
|
|
31
31
|
readonly kind: 'email_otp_wallet_registration_commit_v1';
|
|
32
32
|
readonly emailOtp: D1EmailOtpRegistrationCommitPlan;
|
|
33
33
|
});
|
|
34
|
+
/** A passkey claim that shared authority granted for one ceremony before its finalization. */
|
|
35
|
+
export type HeldRegistrationPasskeyClaim = {
|
|
36
|
+
readonly walletId: string;
|
|
37
|
+
readonly rpId: string;
|
|
38
|
+
readonly credentialIdB64u: string;
|
|
39
|
+
};
|
|
34
40
|
export interface D1WalletRegistrationCommitStore {
|
|
35
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Claims the authority's passkey through shared authority, unless `held`
|
|
43
|
+
* records that the same claim was already granted for this ceremony.
|
|
44
|
+
*/
|
|
45
|
+
reserveAuthority(authority: RegistrationAuthority, held?: HeldRegistrationPasskeyClaim | null): Promise<ReservedWalletRegistrationCommit>;
|
|
46
|
+
/**
|
|
47
|
+
* Claims a verified passkey before finalization and records a granted
|
|
48
|
+
* claim. A refusal records nothing, so finalization claims again and
|
|
49
|
+
* reports it.
|
|
50
|
+
*/
|
|
51
|
+
claimPasskeyAhead(input: {
|
|
52
|
+
readonly registrationCeremonyId: string;
|
|
53
|
+
readonly authority: RegistrationAuthority;
|
|
54
|
+
readonly nowMs: number;
|
|
55
|
+
}): Promise<void>;
|
|
56
|
+
prepareHeldPasskeyClaimRead(registrationCeremonyId: string): D1PreparedStatementLike;
|
|
57
|
+
parseHeldPasskeyClaimRead(result: D1ResultLike<Record<string, unknown>>): HeldRegistrationPasskeyClaim | null;
|
|
58
|
+
/** Removes the record of a finalized ceremony. Shared authority keeps the claim. */
|
|
59
|
+
deleteHeldPasskeyClaim(registrationCeremonyId: string): Promise<void>;
|
|
36
60
|
}
|
|
37
61
|
export declare class CloudflareD1WalletRegistrationCommitStore implements D1WalletRegistrationCommitStore {
|
|
38
62
|
private readonly database;
|
|
@@ -46,7 +70,15 @@ export declare class CloudflareD1WalletRegistrationCommitStore implements D1Wall
|
|
|
46
70
|
readonly projectId: string;
|
|
47
71
|
readonly envId: string;
|
|
48
72
|
});
|
|
49
|
-
reserveAuthority(authority: RegistrationAuthority): Promise<ReservedWalletRegistrationCommit>;
|
|
73
|
+
reserveAuthority(authority: RegistrationAuthority, held?: HeldRegistrationPasskeyClaim | null): Promise<ReservedWalletRegistrationCommit>;
|
|
74
|
+
claimPasskeyAhead(input: {
|
|
75
|
+
readonly registrationCeremonyId: string;
|
|
76
|
+
readonly authority: RegistrationAuthority;
|
|
77
|
+
readonly nowMs: number;
|
|
78
|
+
}): Promise<void>;
|
|
79
|
+
prepareHeldPasskeyClaimRead(registrationCeremonyId: string): D1PreparedStatementLike;
|
|
80
|
+
parseHeldPasskeyClaimRead(result: D1ResultLike<Record<string, unknown>>): HeldRegistrationPasskeyClaim | null;
|
|
81
|
+
deleteHeldPasskeyClaim(registrationCeremonyId: string): Promise<void>;
|
|
50
82
|
private commit;
|
|
51
83
|
}
|
|
52
84
|
export {};
|