@revibase/wallet-adapter 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +3 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
'use strict';var core=require('@revibase/core'),core$1=require('@wallet-standard/core'),server=require('@simplewebauthn/server');var bc="revibase:SignAndSendTransaction",wc="revibase:BuildTransaction",vc="revibase:SignAndSendTokenTransfer",Pc="revibase:BuildTokenTransferTransaction",Fc="revibase:SignMessage";var Fn=1,Bn=2,zn=3,xn=4,kn=5,Wn=6,Gn=7,Vn=8,Hn=9,Kn=10,Yn=-32700,$n=-32603,jn=-32602,Xn=-32601,Zn=-32600,Qn=-32019,qn=-32018,Jn=-32017,er=-32016,tr=-32015,nr=-32014,rr=-32013,ir=-32012,or=-32011,ar=-32010,sr=-32009,cr=-32008,dr=-32007,ur=-32006,Ir=-32005,Ar=-32004,_r=-32003,Tr=-32002,lr=-32001,Ie=28e5,Ae=2800001,Er=2800002,Xe=2800003,Ze=2800004,Qe=2800005,qe=2800006,Je=2800007,et=2800008,tt=2800009,nt=2800010,rt=2800011,gr=323e4,Rr=32300001,Dr=3230002,Nr=3230003,Sr=3230004,fr=361e4,Cr=3610001,Or=3610002,mr=3610003,Mr=3610004,pr=3610005,hr=3610006,yr=3610007,Lr=3611e3,Ur=3704e3,br=3704001,wr=3704002,vr=3704003,Pr=3704004,Fr=4128e3,Br=4128001,zr=4128002,xr=4615e3,kr=4615001,Wr=4615002,Gr=4615003,Vr=4615004,Hr=4615005,Kr=4615006,Yr=4615007,$r=4615008,jr=4615009,Xr=4615010,Zr=4615011,Qr=4615012,qr=4615013,Jr=4615014,ei=4615015,ti=4615016,ni=4615017,ri=4615018,ii=4615019,oi=4615020,ai=4615021,si=4615022,ci=4615023,di=4615024,ui=4615025,Ii=4615026,Ai=4615027,_i=4615028,Ti=4615029,li=4615030,Ei=4615031,gi=4615032,Ri=4615033,Di=4615034,Ni=4615035,Si=4615036,fi=4615037,Ci=4615038,Oi=4615039,mi=4615040,Mi=4615041,pi=4615042,hi=4615043,yi=4615044,Li=4615045,Ui=4615046,bi=4615047,wi=4615048,vi=4615049,Pi=4615050,Fi=4615051,Bi=4615052,zi=4615053,xi=4615054,ki=5508e3,Wi=5508001,Gi=5508002,Vi=5508003,Hi=5508004,Ki=5508005,Yi=5508006,$i=5508007,ji=5508008,Xi=5508009,Zi=5508010,Qi=5508011,_e=5663e3,j=5663001,Te=5663002,le=5663003,Ee=5663004,it=5663005,ot=5663006,at=5663007,st=5663008,ct=5663009,qi=5663010,Ji=5663011,dt=5663012,eo=5663013,to=5663014,ut=5663015,ge=5663016,It=5663017,At=5663018,_t=5663019,Tt=5663020,Re=5663021,lt=5663022,no=705e4,ro=7050001,io=7050002,oo=7050003,ao=7050004,so=7050005,co=7050006,uo=7050007,Io=7050008,Ao=7050009,_o=7050010,To=7050011,lo=7050012,Eo=7050013,go=7050014,Ro=7050015,Do=7050016,No=7050017,So=7050018,fo=7050019,Co=7050020,Oo=7050021,mo=7050022,Mo=7050023,po=7050024,ho=7050025,yo=7050026,Lo=7050027,Uo=7050028,bo=7050029,wo=7050030,vo=7050031,Po=7050032,Fo=7050033,Bo=7050034,zo=7050035,xo=7050036,ko=7618e3,Wo=7618001,Go=7618002,Vo=7618003,Et=8078e3,De=8078001,gt=8078002,Rt=8078003,Dt=8078004,Nt=8078005,St=8078006,Ne=8078007,ft=8078008,Ct=8078009,Ot=8078010,Se=8078011,V=8078012,mt=8078013,Mt=8078014,pt=8078015,ht=8078016,fe=8078017,yt=8078018,Ho=8078019,Lt=8078020,Ut=8078021,bt=8078022,wt=8078023,Ko=81e5,Yo=8100001,$o=8100002,jo=8100003,Xo=819e4,Zo=8190001,Qo=8190002,qo=8190003,Jo=8190004,ea=99e5,ta=9900001,na=9900002,ra=9900003,ia=9900004,oa=9900005,aa=9900006;function vt(e){return Array.isArray(e)?"%5B"+e.map(vt).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function sa([e,t]){return `${e}=${vt(t)}`}function ca(e){let t=Object.entries(e).map(sa).join("&");return Buffer.from(t,"utf8").toString("base64")}var da={[gr]:"Account not found at address: $address",[Sr]:"Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",[Nr]:"Expected decoded account at address: $address",[Dr]:"Failed to decode account data at address: $address",[Rr]:"Accounts not found at addresses: $addresses",[tt]:"Unable to find a viable program address bump seed.",[Er]:"$putativeAddress is not a base58-encoded address.",[Ie]:"Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",[Xe]:"The `CryptoKey` must be an `Ed25519` public key.",[rt]:"$putativeOffCurveAddress is not a base58-encoded off-curve address.",[et]:"Invalid seeds; point must fall off the Ed25519 curve.",[Ze]:"Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",[qe]:"A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",[Je]:"The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",[Qe]:"Expected program derived address bump to be in the range [0, 255], got: $bump.",[nt]:"Program address cannot end with PDA marker.",[Ae]:"Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",[xn]:"Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.",[Fn]:"The network has progressed past the last block for which this transaction could have been committed.",[Et]:"Codec [$codecDescription] cannot decode empty byte arrays.",[bt]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[Lt]:"Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",[Nt]:"Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",[St]:"Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",[Dt]:"Encoder and decoder must either both be fixed-size or variable-size.",[ft]:"Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",[gt]:"Expected a fixed-size codec, got a variable-size one.",[mt]:"Codec [$codecDescription] expected a positive byte length, got $bytesLength.",[Rt]:"Expected a variable-size codec, got a fixed-size one.",[Ho]:"Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",[De]:"Codec [$codecDescription] expected $expected bytes, got $bytesLength.",[yt]:"Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",[Ct]:"Invalid discriminated union variant. Expected one of [$variants], got $value.",[Ot]:"Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",[pt]:"Invalid literal union variant. Expected one of [$variants], got $value.",[Ne]:"Expected [$codecDescription] to have $expected items, got $actual.",[V]:"Invalid value $value for base $base with alphabet $alphabet.",[ht]:"Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",[Se]:"Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",[Mt]:"Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",[Ut]:"Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",[fe]:"Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",[wt]:"This decoder expected a byte array of exactly $expectedLength bytes, but $numExcessBytes unexpected excess bytes remained after decoding. Are you sure that you have chosen the correct decoder for this data?",[Lr]:"No random values implementation could be found.",[jr]:"instruction requires an uninitialized account",[ci]:"instruction tries to borrow reference for an account which is already borrowed",[di]:"instruction left account with an outstanding borrowed reference",[ai]:"program other than the account's owner changed the size of the account data",[Hr]:"account data too small for instruction",[si]:"instruction expected an executable account",[Ui]:"An account does not have enough lamports to be rent-exempt",[wi]:"Program arithmetic overflowed",[Li]:"Failed to serialize or deserialize account data: $encodedData",[xi]:"Builtin programs must consume compute units",[gi]:"Cross-program invocation call depth too deep",[Ci]:"Computational budget exceeded",[Ii]:"custom program error: #$code",[ni]:"instruction contains duplicate accounts",[ui]:"instruction modifications of multiply-passed account differ",[li]:"executable accounts must be rent exempt",[_i]:"instruction changed executable accounts data",[Ti]:"instruction changed the balance of an executable account",[ri]:"instruction changed executable bit of an account",[Jr]:"instruction modified data of an account it does not own",[qr]:"instruction spent from the balance of an account it does not own",[kr]:"generic instruction error",[Pi]:"Provided owner is not allowed",[hi]:"Account is immutable",[yi]:"Incorrect authority provided",[Yr]:"incorrect program id for instruction",[Kr]:"insufficient funds for instruction",[Vr]:"invalid account data for instruction",[bi]:"Invalid account owner",[Wr]:"invalid program argument",[Ai]:"program returned invalid error code",[Gr]:"invalid instruction data",[fi]:"Failed to reallocate account data",[Si]:"Provided seeds do not result in a valid address",[Fi]:"Accounts data allocations exceeded the maximum allowed per transaction",[Bi]:"Max accounts exceeded",[zi]:"Max instruction trace length exceeded",[Ni]:"Length of the seed is too long for address generation",[Ri]:"An account required by the instruction is missing",[$r]:"missing required signature for instruction",[Qr]:"instruction illegally modified the program id of an account",[oi]:"insufficient account keys for instruction",[Oi]:"Cross-program invocation with unauthorized signer or writable account",[mi]:"Failed to create program execution environment",[pi]:"Program failed to compile",[Mi]:"Program failed to complete",[ti]:"instruction modified data of a read-only account",[ei]:"instruction changed the balance of a read-only account",[Di]:"Cross-program invocation reentrancy not allowed for this instruction",[ii]:"instruction modified rent epoch of an account",[Zr]:"sum of account balances before and after instruction do not match",[Xr]:"instruction requires an initialized account",[xr]:"",[Ei]:"Unsupported program id",[vi]:"Unsupported sysvar",[oa]:"Invalid instruction plan kind: $kind.",[Go]:"The provided instruction plan is empty.",[Vo]:"The provided transaction plan failed to execute. See the `transactionPlanResult` attribute and the `cause` error for more details.",[ko]:"The provided message has insufficient capacity to accommodate the next instruction(s) in this plan. Expected at least $numBytesRequired free byte(s), got $numFreeBytes byte(s).",[aa]:"Invalid transaction plan kind: $kind.",[Wo]:"No more instructions to pack; the message packer has completed the instruction plan.",[Fr]:"The instruction does not have any accounts.",[Br]:"The instruction does not have any data.",[zr]:"Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",[kn]:"Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",[Bn]:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[na]:"Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ia]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[ta]:"Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ea]:"Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ra]:"Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[$n]:"JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",[jn]:"JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",[Zn]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[Xn]:"JSON-RPC error: The method does not exist / is not available ($__serverMessage)",[Yn]:"JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",[ir]:"$__serverMessage",[lr]:"$__serverMessage",[Ar]:"$__serverMessage",[nr]:"$__serverMessage",[Jn]:"Epoch rewards period still active at slot $slot",[ar]:"$__serverMessage",[sr]:"$__serverMessage",[Qn]:"Failed to query long-term storage; please try again",[er]:"Minimum context slot has not been reached",[Ir]:"Node is unhealthy; behind by $numSlotsBehind slots",[cr]:"No snapshot",[Tr]:"Transaction simulation failed",[qn]:"Rewards cannot be found because slot $slot is not the epoch boundary. This may be due to gap in the queried node's local ledger or long-term storage",[dr]:"$__serverMessage",[or]:"Transaction history is not available from this node",[ur]:"$__serverMessage",[rr]:"Transaction signature length mismatch",[_r]:"Transaction signature verification failure",[tr]:"$__serverMessage",[Ur]:"Key pair bytes must be of length 64, got $byteLength.",[br]:"Expected private key bytes with length 32. Actual length: $actualLength.",[wr]:"Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",[Pr]:"The provided private key does not match the provided public key.",[vr]:"Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",[Wn]:"Lamports value must be in the range [0, 2e64-1]",[Gn]:"`$value` cannot be parsed as a `BigInt`",[Kn]:"$message",[Vn]:"`$value` cannot be parsed as a `Number`",[zn]:"No nonce account could be found at address `$nonceAccountAddress`",[Xo]:"The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",[Qo]:"WebSocket was closed before payload could be added to the send buffer",[qo]:"WebSocket connection closed",[Jo]:"WebSocket failed to connect",[Zo]:"Failed to obtain a subscription id from the server",[jo]:"Could not find an API plan for RPC method: `$method`",[Ko]:"The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",[$o]:"HTTP error ($statusCode): $message",[Yo]:"HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",[ki]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[Wi]:"The provided value does not implement the `KeyPairSigner` interface",[Vi]:"The provided value does not implement the `MessageModifyingSigner` interface",[Hi]:"The provided value does not implement the `MessagePartialSigner` interface",[Gi]:"The provided value does not implement any of the `MessageSigner` interfaces",[Yi]:"The provided value does not implement the `TransactionModifyingSigner` interface",[$i]:"The provided value does not implement the `TransactionPartialSigner` interface",[ji]:"The provided value does not implement the `TransactionSendingSigner` interface",[Ki]:"The provided value does not implement any of the `TransactionSigner` interfaces",[Xi]:"More than one `TransactionSendingSigner` was identified.",[Zi]:"No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",[Qi]:"Wallet account signers do not support signing multiple messages/transactions in a single operation",[yr]:"Cannot export a non-extractable key.",[Cr]:"No digest implementation could be found.",[fr]:"Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",[Or]:`This runtime does not support the generation of Ed25519 key pairs.
|
|
1
|
+
'use strict';var core=require('@revibase/core'),core$1=require('@wallet-standard/core'),server=require('@simplewebauthn/server');var bc="revibase:SignAndSendTransaction",wc="revibase:BuildTransaction",vc="revibase:SignAndSendTokenTransfer",Pc="revibase:BuildTokenTransferTransaction",Fc="revibase:SignMessage";var Fn=1,Bn=2,zn=3,xn=4,kn=5,Wn=6,Gn=7,Vn=8,Hn=9,Kn=10,Yn=-32700,$n=-32603,jn=-32602,Xn=-32601,Zn=-32600,qn=-32019,Qn=-32018,Jn=-32017,er=-32016,tr=-32015,nr=-32014,rr=-32013,ir=-32012,or=-32011,ar=-32010,sr=-32009,cr=-32008,dr=-32007,ur=-32006,Ir=-32005,Ar=-32004,_r=-32003,Tr=-32002,lr=-32001,Ie=28e5,Ae=2800001,Er=2800002,Xe=2800003,Ze=2800004,qe=2800005,Qe=2800006,Je=2800007,et=2800008,tt=2800009,nt=2800010,rt=2800011,gr=323e4,Rr=32300001,Dr=3230002,Nr=3230003,Sr=3230004,fr=361e4,Cr=3610001,Or=3610002,mr=3610003,Mr=3610004,pr=3610005,hr=3610006,yr=3610007,Lr=3611e3,Ur=3704e3,br=3704001,wr=3704002,vr=3704003,Pr=3704004,Fr=4128e3,Br=4128001,zr=4128002,xr=4615e3,kr=4615001,Wr=4615002,Gr=4615003,Vr=4615004,Hr=4615005,Kr=4615006,Yr=4615007,$r=4615008,jr=4615009,Xr=4615010,Zr=4615011,qr=4615012,Qr=4615013,Jr=4615014,ei=4615015,ti=4615016,ni=4615017,ri=4615018,ii=4615019,oi=4615020,ai=4615021,si=4615022,ci=4615023,di=4615024,ui=4615025,Ii=4615026,Ai=4615027,_i=4615028,Ti=4615029,li=4615030,Ei=4615031,gi=4615032,Ri=4615033,Di=4615034,Ni=4615035,Si=4615036,fi=4615037,Ci=4615038,Oi=4615039,mi=4615040,Mi=4615041,pi=4615042,hi=4615043,yi=4615044,Li=4615045,Ui=4615046,bi=4615047,wi=4615048,vi=4615049,Pi=4615050,Fi=4615051,Bi=4615052,zi=4615053,xi=4615054,ki=5508e3,Wi=5508001,Gi=5508002,Vi=5508003,Hi=5508004,Ki=5508005,Yi=5508006,$i=5508007,ji=5508008,Xi=5508009,Zi=5508010,qi=5508011,_e=5663e3,j=5663001,Te=5663002,le=5663003,Ee=5663004,it=5663005,ot=5663006,at=5663007,st=5663008,ct=5663009,Qi=5663010,Ji=5663011,dt=5663012,eo=5663013,to=5663014,ut=5663015,ge=5663016,It=5663017,At=5663018,_t=5663019,Tt=5663020,Re=5663021,lt=5663022,no=705e4,ro=7050001,io=7050002,oo=7050003,ao=7050004,so=7050005,co=7050006,uo=7050007,Io=7050008,Ao=7050009,_o=7050010,To=7050011,lo=7050012,Eo=7050013,go=7050014,Ro=7050015,Do=7050016,No=7050017,So=7050018,fo=7050019,Co=7050020,Oo=7050021,mo=7050022,Mo=7050023,po=7050024,ho=7050025,yo=7050026,Lo=7050027,Uo=7050028,bo=7050029,wo=7050030,vo=7050031,Po=7050032,Fo=7050033,Bo=7050034,zo=7050035,xo=7050036,ko=7618e3,Wo=7618001,Go=7618002,Vo=7618003,Et=8078e3,De=8078001,gt=8078002,Rt=8078003,Dt=8078004,Nt=8078005,St=8078006,Ne=8078007,ft=8078008,Ct=8078009,Ot=8078010,Se=8078011,V=8078012,mt=8078013,Mt=8078014,pt=8078015,ht=8078016,fe=8078017,yt=8078018,Ho=8078019,Lt=8078020,Ut=8078021,bt=8078022,wt=8078023,Ko=81e5,Yo=8100001,$o=8100002,jo=8100003,Xo=819e4,Zo=8190001,qo=8190002,Qo=8190003,Jo=8190004,ea=99e5,ta=9900001,na=9900002,ra=9900003,ia=9900004,oa=9900005,aa=9900006;function vt(e){return Array.isArray(e)?"%5B"+e.map(vt).join("%2C%20")+"%5D":typeof e=="bigint"?`${e}n`:encodeURIComponent(String(e!=null&&Object.getPrototypeOf(e)===null?{...e}:e))}function sa([e,t]){return `${e}=${vt(t)}`}function ca(e){let t=Object.entries(e).map(sa).join("&");return Buffer.from(t,"utf8").toString("base64")}var da={[gr]:"Account not found at address: $address",[Sr]:"Not all accounts were decoded. Encoded accounts found at addresses: $addresses.",[Nr]:"Expected decoded account at address: $address",[Dr]:"Failed to decode account data at address: $address",[Rr]:"Accounts not found at addresses: $addresses",[tt]:"Unable to find a viable program address bump seed.",[Er]:"$putativeAddress is not a base58-encoded address.",[Ie]:"Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.",[Xe]:"The `CryptoKey` must be an `Ed25519` public key.",[rt]:"$putativeOffCurveAddress is not a base58-encoded off-curve address.",[et]:"Invalid seeds; point must fall off the Ed25519 curve.",[Ze]:"Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].",[Qe]:"A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.",[Je]:"The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.",[qe]:"Expected program derived address bump to be in the range [0, 255], got: $bump.",[nt]:"Program address cannot end with PDA marker.",[Ae]:"Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.",[xn]:"Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.",[Fn]:"The network has progressed past the last block for which this transaction could have been committed.",[Et]:"Codec [$codecDescription] cannot decode empty byte arrays.",[bt]:"Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.",[Lt]:"Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].",[Nt]:"Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].",[St]:"Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].",[Dt]:"Encoder and decoder must either both be fixed-size or variable-size.",[ft]:"Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.",[gt]:"Expected a fixed-size codec, got a variable-size one.",[mt]:"Codec [$codecDescription] expected a positive byte length, got $bytesLength.",[Rt]:"Expected a variable-size codec, got a fixed-size one.",[Ho]:"Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].",[De]:"Codec [$codecDescription] expected $expected bytes, got $bytesLength.",[yt]:"Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].",[Ct]:"Invalid discriminated union variant. Expected one of [$variants], got $value.",[Ot]:"Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.",[pt]:"Invalid literal union variant. Expected one of [$variants], got $value.",[Ne]:"Expected [$codecDescription] to have $expected items, got $actual.",[V]:"Invalid value $value for base $base with alphabet $alphabet.",[ht]:"Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.",[Se]:"Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.",[Mt]:"Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.",[Ut]:"Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].",[fe]:"Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.",[wt]:"This decoder expected a byte array of exactly $expectedLength bytes, but $numExcessBytes unexpected excess bytes remained after decoding. Are you sure that you have chosen the correct decoder for this data?",[Lr]:"No random values implementation could be found.",[jr]:"instruction requires an uninitialized account",[ci]:"instruction tries to borrow reference for an account which is already borrowed",[di]:"instruction left account with an outstanding borrowed reference",[ai]:"program other than the account's owner changed the size of the account data",[Hr]:"account data too small for instruction",[si]:"instruction expected an executable account",[Ui]:"An account does not have enough lamports to be rent-exempt",[wi]:"Program arithmetic overflowed",[Li]:"Failed to serialize or deserialize account data: $encodedData",[xi]:"Builtin programs must consume compute units",[gi]:"Cross-program invocation call depth too deep",[Ci]:"Computational budget exceeded",[Ii]:"custom program error: #$code",[ni]:"instruction contains duplicate accounts",[ui]:"instruction modifications of multiply-passed account differ",[li]:"executable accounts must be rent exempt",[_i]:"instruction changed executable accounts data",[Ti]:"instruction changed the balance of an executable account",[ri]:"instruction changed executable bit of an account",[Jr]:"instruction modified data of an account it does not own",[Qr]:"instruction spent from the balance of an account it does not own",[kr]:"generic instruction error",[Pi]:"Provided owner is not allowed",[hi]:"Account is immutable",[yi]:"Incorrect authority provided",[Yr]:"incorrect program id for instruction",[Kr]:"insufficient funds for instruction",[Vr]:"invalid account data for instruction",[bi]:"Invalid account owner",[Wr]:"invalid program argument",[Ai]:"program returned invalid error code",[Gr]:"invalid instruction data",[fi]:"Failed to reallocate account data",[Si]:"Provided seeds do not result in a valid address",[Fi]:"Accounts data allocations exceeded the maximum allowed per transaction",[Bi]:"Max accounts exceeded",[zi]:"Max instruction trace length exceeded",[Ni]:"Length of the seed is too long for address generation",[Ri]:"An account required by the instruction is missing",[$r]:"missing required signature for instruction",[qr]:"instruction illegally modified the program id of an account",[oi]:"insufficient account keys for instruction",[Oi]:"Cross-program invocation with unauthorized signer or writable account",[mi]:"Failed to create program execution environment",[pi]:"Program failed to compile",[Mi]:"Program failed to complete",[ti]:"instruction modified data of a read-only account",[ei]:"instruction changed the balance of a read-only account",[Di]:"Cross-program invocation reentrancy not allowed for this instruction",[ii]:"instruction modified rent epoch of an account",[Zr]:"sum of account balances before and after instruction do not match",[Xr]:"instruction requires an initialized account",[xr]:"",[Ei]:"Unsupported program id",[vi]:"Unsupported sysvar",[oa]:"Invalid instruction plan kind: $kind.",[Go]:"The provided instruction plan is empty.",[Vo]:"The provided transaction plan failed to execute. See the `transactionPlanResult` attribute and the `cause` error for more details.",[ko]:"The provided message has insufficient capacity to accommodate the next instruction(s) in this plan. Expected at least $numBytesRequired free byte(s), got $numFreeBytes byte(s).",[aa]:"Invalid transaction plan kind: $kind.",[Wo]:"No more instructions to pack; the message packer has completed the instruction plan.",[Fr]:"The instruction does not have any accounts.",[Br]:"The instruction does not have any data.",[zr]:"Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.",[kn]:"Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.",[Bn]:"The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`",[na]:"Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ia]:"Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.",[ta]:"Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ea]:"Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[ra]:"Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant",[$n]:"JSON-RPC error: Internal JSON-RPC error ($__serverMessage)",[jn]:"JSON-RPC error: Invalid method parameter(s) ($__serverMessage)",[Zn]:"JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)",[Xn]:"JSON-RPC error: The method does not exist / is not available ($__serverMessage)",[Yn]:"JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)",[ir]:"$__serverMessage",[lr]:"$__serverMessage",[Ar]:"$__serverMessage",[nr]:"$__serverMessage",[Jn]:"Epoch rewards period still active at slot $slot",[ar]:"$__serverMessage",[sr]:"$__serverMessage",[qn]:"Failed to query long-term storage; please try again",[er]:"Minimum context slot has not been reached",[Ir]:"Node is unhealthy; behind by $numSlotsBehind slots",[cr]:"No snapshot",[Tr]:"Transaction simulation failed",[Qn]:"Rewards cannot be found because slot $slot is not the epoch boundary. This may be due to gap in the queried node's local ledger or long-term storage",[dr]:"$__serverMessage",[or]:"Transaction history is not available from this node",[ur]:"$__serverMessage",[rr]:"Transaction signature length mismatch",[_r]:"Transaction signature verification failure",[tr]:"$__serverMessage",[Ur]:"Key pair bytes must be of length 64, got $byteLength.",[br]:"Expected private key bytes with length 32. Actual length: $actualLength.",[wr]:"Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.",[Pr]:"The provided private key does not match the provided public key.",[vr]:"Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.",[Wn]:"Lamports value must be in the range [0, 2e64-1]",[Gn]:"`$value` cannot be parsed as a `BigInt`",[Kn]:"$message",[Vn]:"`$value` cannot be parsed as a `Number`",[zn]:"No nonce account could be found at address `$nonceAccountAddress`",[Xo]:"The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.",[qo]:"WebSocket was closed before payload could be added to the send buffer",[Qo]:"WebSocket connection closed",[Jo]:"WebSocket failed to connect",[Zo]:"Failed to obtain a subscription id from the server",[jo]:"Could not find an API plan for RPC method: `$method`",[Ko]:"The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.",[$o]:"HTTP error ($statusCode): $message",[Yo]:"HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.",[ki]:"Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.",[Wi]:"The provided value does not implement the `KeyPairSigner` interface",[Vi]:"The provided value does not implement the `MessageModifyingSigner` interface",[Hi]:"The provided value does not implement the `MessagePartialSigner` interface",[Gi]:"The provided value does not implement any of the `MessageSigner` interfaces",[Yi]:"The provided value does not implement the `TransactionModifyingSigner` interface",[$i]:"The provided value does not implement the `TransactionPartialSigner` interface",[ji]:"The provided value does not implement the `TransactionSendingSigner` interface",[Ki]:"The provided value does not implement any of the `TransactionSigner` interfaces",[Xi]:"More than one `TransactionSendingSigner` was identified.",[Zi]:"No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",[qi]:"Wallet account signers do not support signing multiple messages/transactions in a single operation",[yr]:"Cannot export a non-extractable key.",[Cr]:"No digest implementation could be found.",[fr]:"Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.",[Or]:`This runtime does not support the generation of Ed25519 key pairs.
|
|
2
2
|
|
|
3
3
|
Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519.
|
|
4
4
|
|
|
5
|
-
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`,[mr]:"No signature verification implementation could be found.",[Mr]:"No key generation implementation could be found.",[pr]:"No signing implementation could be found.",[hr]:"No key export implementation could be found.",[Hn]:"Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",[Do]:"Transaction processing left an account with an outstanding borrowed reference",[ro]:"Account in use",[io]:"Account loaded twice",[oo]:"Attempt to debit an account but found no record of a prior credit.",[Mo]:"Transaction loads an address table account that doesn't exist",[uo]:"This transaction has already been processed",[Io]:"Blockhash not found",[Ao]:"Loader call chain is too deep",[Ro]:"Transactions are currently disabled due to cluster maintenance",[wo]:"Transaction contains a duplicate instruction ($index) that is not allowed",[so]:"Insufficient funds for fee",[vo]:"Transaction results in an account ($accountIndex) with insufficient funds for rent",[co]:"This account may not be used to pay transaction fees",[To]:"Transaction contains an invalid account reference",[ho]:"Transaction loads an address table account with invalid data",[yo]:"Transaction address table lookup uses an invalid index",[po]:"Transaction loads an address table account with an invalid owner",[Fo]:"LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",[Eo]:"This program may not be used for executing instructions",[Lo]:"Transaction leaves an account with a lower balance than rent-exempt minimum",[fo]:"Transaction loads a writable account that cannot be written",[Po]:"Transaction exceeded max loaded accounts data size cap",[_o]:"Transaction requires a fee but has no signature present",[ao]:"Attempt to load a program that does not exist",[zo]:"Execution of the program referenced by account at index $accountIndex is temporarily restricted.",[Bo]:"ResanitizationNeeded",[go]:"Transaction failed to sanitize accounts offsets correctly",[lo]:"Transaction did not pass signature verification",[mo]:"Transaction locked too many accounts",[xo]:"Sum of account balances before and after transaction do not match",[no]:"The transaction failed with the error `$errorName`",[So]:"Transaction version is unsupported",[Oo]:"Transaction would exceed account data limit within the block",[bo]:"Transaction would exceed total account data limit",[Co]:"Transaction would exceed max account limit within the block",[No]:"Transaction would exceed max Block Cost Limit",[Uo]:"Transaction would exceed max Vote Cost Limit",[ut]:"Attempted to sign a transaction with an address that is not a signer for it",[qi]:"Transaction is missing an address at index: $index.",[ge]:"Transaction has no expected signers therefore it cannot be encoded",[Tt]:"Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",[Te]:"Transaction does not have a blockhash lifetime",[le]:"Transaction is not a durable nonce transaction",[it]:"Contents of these address lookup tables unknown: $lookupTableAddresses",[ot]:"Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved",[st]:"No fee payer set in CompiledTransaction",[at]:"Could not find program address at index $index",[At]:"Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more",[_t]:"Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more",[Ji]:"Transaction is missing a fee payer.",[dt]:"Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",[to]:"Transaction first instruction is not advance nonce account instruction.",[eo]:"Transaction with no instructions cannot be durable nonce transaction.",[_e]:"This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",[j]:"This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",[It]:"The transaction message expected the transaction to have $numRequiredSignatures signatures, got $signaturesLength.",[ct]:"Transaction is missing signatures for addresses: $addresses.",[Ee]:"Transaction version must be in the range [0, 127]. `$actualVersion` given",[Re]:"This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 0.",[lt]:"The transaction has a durable nonce lifetime (with nonce `$nonce`), but the nonce account address is in a lookup table. The lifetime constraint cannot be constructed without fetching the lookup tables for the transaction."},O="i",f="t";function ua(e,t={}){let n=da[e];if(n.length===0)return "";let r;function i(o){if(r[f]===2){let a=n.slice(r[O]+1,o);s.push(a in t?`${t[a]}`:`$${a}`);}else r[f]===1&&s.push(n.slice(r[O],o));}let s=[];return n.split("").forEach((o,a)=>{if(a===0){r={[O]:0,[f]:n[0]==="\\"?0:n[0]==="$"?2:1};return}let c;switch(r[f]){case 0:c={[O]:a,[f]:1};break;case 1:o==="\\"?c={[O]:a,[f]:0}:o==="$"&&(c={[O]:a,[f]:2});break;case 2:o==="\\"?c={[O]:a,[f]:0}:o==="$"?c={[O]:a,[f]:2}:o.match(/\w/)||(c={[O]:a,[f]:1});break}c&&(r!==c&&i(a),r=c);}),i(),s.join("")}function Ia(e,t={}){if(process.env.NODE_ENV!=="production")return ua(e,t);{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${ca(t)}'`),`${n}\``}}var T=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;t&&Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([s,o])=>{s==="cause"?r={cause:o.value}:(n===void 0&&(n={}),Object.defineProperty(n,s,o));});let i=Ia(e,n);super(i,r),this.context=n===void 0?{}:n,this.context.__code=e,this.name="SolanaError";}};function Aa(e,t){if(e.length>=t)return e;let n=new Uint8Array(t).fill(0);return n.set(e),n}var _a=(e,t)=>Aa(e.length<=t?e:e.slice(0,t),t);function h(e,t){return "fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function l(e){return Object.freeze({...e,encode:t=>{let n=new Uint8Array(h(t,e));return e.write(t,n,0),n}})}function P(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function R(e){return "fixedSize"in e&&typeof e.fixedSize=="number"}function Ta(e){return !R(e)}function Ce(e,t,n,r=0){let i=n.length-r;if(i<t)throw new T(De,{bytesLength:i,codecDescription:e,expected:t})}function Pt(e,t){let n=(o,a,c)=>{let d=e.encode(o);return c=t.write(d.length,a,c),a.set(d,c),c+d.length};if(R(t)&&R(e))return l({...e,fixedSize:t.fixedSize+e.fixedSize,write:n});let r=R(t)?t.fixedSize:t.maxSize??null,i=R(e)?e.fixedSize:e.maxSize??null,s=r!==null&&i!==null?r+i:null;return l({...e,...s!==null?{maxSize:s}:{},getSizeFromValue:o=>{let a=h(o,e);return h(a,t)+a},write:n})}function F(e,t){return l({fixedSize:t,write:(n,r,i)=>{let s=e.encode(n),o=s.length>t?s.slice(0,t):s;return r.set(o,i),i+t}})}function H(e,t){return P({fixedSize:t,read:(n,r)=>{Ce("fixCodecSize",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),R(e)&&(n=_a(n,e.fixedSize));let[i]=e.read(n,0);return [i,r+t]}})}function D(e,t){return l({...Ta(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,i)=>e.write(t(n),r,i)})}function la(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new T(V,{alphabet:e,base:e.length,value:n})}var Ea=e=>l({getSizeFromValue:t=>{let[n,r]=Ft(t,e[0]);if(!r)return t.length;let i=Bt(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(la(e,t),t==="")return r;let[i,s]=Ft(t,e[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let o=Bt(s,e),a=[];for(;o>0n;)a.unshift(Number(o%256n)),o/=256n;let c=[...Array(i.length).fill(0),...a];return n.set(c,r),r+c.length}}),ga=e=>P({read(t,n){let r=n===0?t:t.slice(n);if(r.length===0)return ["",0];let i=r.findIndex(c=>c!==0);i=i===-1?r.length:i;let s=e[0].repeat(i);if(i===r.length)return [s,t.length];let o=r.slice(i).reduce((c,d)=>c*256n+BigInt(d),0n),a=Ra(o,e);return [s+a,t.length]}});function Ft(e,t){let[n,r]=e.split(new RegExp(`((?!${t}).*)`));return [n,r]}function Bt(e,t){let n=BigInt(t.length),r=0n;for(let i of e)r*=n,r+=BigInt(t.indexOf(i));return r}function Ra(e,t){let n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join("")}var zt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",X=()=>Ea(zt),x=()=>ga(zt);var Z=()=>P({read:(e,t=0)=>[Buffer.from(e,t).toString("base64"),e.length]});var Oe,me;function Me(){return Oe||(Oe=X()),Oe}function Na(){return me||(me=x()),me}function xt(e){if(e.length<32||e.length>44)return false;let t=Me();try{return t.encode(e).byteLength===32}catch{return false}}function pe(e){if(e.length<32||e.length>44)throw new T(Ae,{actualLength:e.length});let r=Me().encode(e).byteLength;if(r!==32)throw new T(Ie,{actualLength:r})}function k(e){return pe(e),e}function m(){return D(F(Me(),32),e=>k(e))}function K(){return H(Na(),32)}function Q(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:false,localeMatcher:"best fit",numeric:false,sensitivity:"variant",usage:"sort"}).compare}function kt(e,t,n,r){if(r<t||r>n)throw new T(Se,{codecDescription:e,max:n,min:t,value:r})}function Sa(e){return e?.endian!==1}function he(e){return l({fixedSize:e.size,write(t,n,r){e.range&&kt(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,Sa(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}var M=()=>l({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,n)=>{kt("shortU16",0,65535,e);let r=[0];for(let i=0;;i+=1){let s=Number(e)>>i*7;if(s===0)break;let o=127&s;r[i]=o,i>0&&(r[i-1]|=128);}return t.set(r,n),n+r.length}});var q=(e={})=>he({config:e,name:"u32",range:[0,4294967295],set:(t,n,r)=>t.setUint32(0,Number(n),r),size:4});var J=(e={})=>he({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,r)=>t.setBigUint64(0,BigInt(n),r),size:8});var p=()=>he({name:"u8",range:[0,255],set:(e,t)=>e.setUint8(0,Number(t)),size:1});function Oa(e,t,n){if(t!==n)throw new T(Ne,{actual:n,codecDescription:e,expected:t})}function ma(e){return e.reduce((t,n)=>t===null||n===null?null:Math.max(t,n),0)}function Wt(e){return e.reduce((t,n)=>t===null||n===null?null:t+n,0)}function Kt(e){return R(e)?e.fixedSize:null}function Le(e){return R(e)?e.fixedSize:e.maxSize??null}function y(e,t={}){let n=t.size??q(),r=Gt(n,Kt(e)),i=Gt(n,Le(e))??void 0;return l({...r!==null?{fixedSize:r}:{getSizeFromValue:s=>(typeof n=="object"?h(s.length,n):0)+[...s].reduce((a,c)=>a+h(c,e),0),maxSize:i},write:(s,o,a)=>(typeof n=="number"&&Oa("array",n,s.length),typeof n=="object"&&(a=n.write(s.length,o,a)),s.forEach(c=>{a=e.write(c,o,a);}),a)})}function Gt(e,t){return typeof e!="number"?null:e===0?0:t===null?null:t*e}function Y(){return l({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function Yt(e){return l({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function $t(e,t){let n=Ma(e),r=(s,o,a)=>{let c=t(s);return Vt(e,c),e[c].write(s,o,a)};if(n!==null)return l({fixedSize:n,write:r});let i=pa(e);return l({...i!==null?{maxSize:i}:{},getSizeFromValue:s=>{let o=t(s);return Vt(e,o),h(s,e[o])},write:r})}function Vt(e,t){if(typeof e[t]>"u")throw new T(fe,{maxRange:e.length-1,minRange:0,variant:t})}function Ma(e){if(e.length===0)return 0;if(!R(e[0]))return null;let t=e[0].fixedSize;return e.every(r=>R(r)&&r.fixedSize===t)?t:null}function pa(e){return ma(e.map(t=>Le(t)))}function N(e){let t=e.map(([,i])=>i),n=Wt(t.map(Kt)),r=Wt(t.map(Le))??void 0;return l({...n===null?{getSizeFromValue:i=>e.map(([s,o])=>h(i[s],o)).reduce((s,o)=>s+o,0),maxSize:r}:{fixedSize:n},write:(i,s,o)=>(e.forEach(([a,c])=>{o=c.write(i[a],s,o);}),o)})}function Ue(e,...t){return t.reduce((n,r)=>r(n),e)}var L=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(L||{});var ha=1;function U(e){return e>=2}function W(e){return (e&ha)!==0}function be(e,t){return e|t}function jt(e){return xt(e)}function Xt(){return K()}function nn(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.blockhash=="string"&&typeof e.lifetimeConstraint.lastValidBlockHeight=="bigint"&&jt(e.lifetimeConstraint.blockhash)}function rn(e,t){return "lifetimeConstraint"in t&&t.lifetimeConstraint&&"blockhash"in t.lifetimeConstraint&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight?t:Object.freeze({...t,lifetimeConstraint:Object.freeze(e)})}function ba(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new T(V,{alphabet:e,base:e.length,value:n})}var wa=e=>l({getSizeFromValue:t=>{let[n,r]=Zt(t,e[0]);if(!r)return t.length;let i=Qt(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(ba(e,t),t==="")return r;let[i,s]=Zt(t,e[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let o=Qt(s,e),a=[];for(;o>0n;)a.unshift(Number(o%256n)),o/=256n;let c=[...Array(i.length).fill(0),...a];return n.set(c,r),r+c.length}});function Zt(e,t){let[n,r]=e.split(new RegExp(`((?!${t}).*)`));return [n,r]}function Qt(e,t){let n=BigInt(t.length),r=0n;for(let i of e)r*=n,r+=BigInt(t.indexOf(i));return r}var va="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Pa=()=>wa(va);var we;function Fa(){if(!we){let e=y(p(),{size:M()});we=N([["lookupTableAddress",m()],["writableIndexes",e],["readonlyIndexes",e]]);}return we}var ve;function Pe(){return ve||(ve=p()),ve}function Ba(){return N([["numSignerAccounts",Pe()],["numReadonlySignerAccounts",Pe()],["numReadonlyNonSignerAccounts",Pe()]])}var Fe;function za(){return Fe||(Fe=D(N([["programAddressIndex",p()],["accountIndices",y(p(),{size:M()})],["data",Pt(Y(),M())]]),e=>e.accountIndices!==void 0&&e.data!==void 0?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),Fe}var xa=0,ka=128;function Wa(){return l({getSizeFromValue:e=>e==="legacy"?0:1,maxSize:1,write:(e,t,n)=>{if(e==="legacy")return n;if(e<0||e>127)throw new T(Ee,{actualVersion:e});if(e>xa)throw new T(Re,{unsupportedVersion:e});return t.set([e|ka],n),n+1}})}function qt(){return N(on())}function Jt(){return D(N([...on(),["addressTableLookups",Ga()]]),e=>e.version==="legacy"?e:{...e,addressTableLookups:e.addressTableLookups??[]})}function on(){let e=$t([Yt(new Uint8Array(32)),F(Pa(),32)],t=>t===void 0?0:1);return [["version",Wa()],["header",Ba()],["staticAccounts",y(m(),{size:M()})],["lifetimeToken",e],["instructions",y(za(),{size:M()})]]}function Ga(){return y(Fa(),{size:M()})}function an(){return l({getSizeFromValue:e=>e.version==="legacy"?qt().getSizeFromValue(e):Jt().getSizeFromValue(e),write:(e,t,n)=>e.version==="legacy"?qt().write(e,t,n):Jt().write(e,t,n)})}function en(e,t,n){e[t]=n(e[t]??{role:L.READONLY});}var E=Symbol("AddressMapTypeProperty");function Va(e,t){let n={[e]:{[E]:0,role:L.WRITABLE_SIGNER}},r=new Set;for(let i of t){en(n,i.programAddress,o=>{if(r.add(i.programAddress),E in o){if(W(o.role))switch(o[E]){case 0:throw new T(_e,{programAddress:i.programAddress});default:throw new T(j,{programAddress:i.programAddress})}if(o[E]===2)return o}return {[E]:2,role:L.READONLY}});let s;if(i.accounts)for(let o of i.accounts)en(n,o.address,a=>{let{address:c,...d}=o;if(E in a)switch(a[E]){case 0:return a;case 1:{let u=be(a.role,d.role);if("lookupTableAddress"in d){if(a.lookupTableAddress!==d.lookupTableAddress&&(s||=Q())(d.lookupTableAddress,a.lookupTableAddress)<0)return {[E]:1,...d,role:u}}else if(U(d.role))return {[E]:2,role:u};return a.role!==u?{...a,role:u}:a}case 2:{let u=be(a.role,d.role);if(r.has(o.address)){if(W(d.role))throw new T(j,{programAddress:o.address});return a.role!==u?{...a,role:u}:a}else return "lookupTableAddress"in d&&!U(a.role)?{...d,[E]:1,role:u}:a.role!==u?{...a,role:u}:a}}return "lookupTableAddress"in d?{...d,[E]:1}:{...d,[E]:2}});}return n}function Ha(e){let t;return Object.entries(e).sort(([r,i],[s,o])=>{if(i[E]!==o[E]){if(i[E]===0)return -1;if(o[E]===0)return 1;if(i[E]===2)return -1;if(o[E]===2)return 1}let a=U(i.role);if(a!==U(o.role))return a?-1:1;let c=W(i.role);return c!==W(o.role)?c?-1:1:(t||=Q(),i[E]===1&&o[E]===1&&i.lookupTableAddress!==o.lookupTableAddress?t(i.lookupTableAddress,o.lookupTableAddress):t(r,s))}).map(([r,i])=>({address:r,...i}))}function Ka(e){let t={};for(let n of e){if(!("lookupTableAddress"in n))continue;let r=t[n.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};n.role===L.WRITABLE?r.writableIndexes.push(n.addressIndex):r.readonlyIndexes.push(n.addressIndex);}return Object.keys(t).sort(Q()).map(n=>({lookupTableAddress:n,...t[n]}))}function Ya(e){let t=0,n=0,r=0;for(let i of e){if("lookupTableAddress"in i)break;let s=W(i.role);U(i.role)?(r++,s||n++):s||t++;}return {numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:n,numSignerAccounts:r}}function $a(e){let t={};for(let[n,r]of e.entries())t[r.address]=n;return t}function ja(e,t){let n=$a(t);return e.map(({accounts:r,data:i,programAddress:s})=>({programAddressIndex:n[s],...r?{accountIndices:r.map(({address:o})=>n[o])}:null,...i?{data:i}:null}))}function Xa(e){return "nonce"in e?e.nonce:e.blockhash}function Za(e){let t=e.findIndex(r=>"lookupTableAddress"in r);return (t===-1?e:e.slice(0,t)).map(({address:r})=>r)}function sn(e){let t=Va(e.feePayer.address,e.instructions),n=Ha(t),r=e.lifetimeConstraint;return {...e.version!=="legacy"?{addressTableLookups:Ka(n)}:null,...r?{lifetimeToken:Xa(r)}:null,header:Ya(n),instructions:ja(e.instructions,n),staticAccounts:Za(n),version:e.version}}function Qa(e,t,n){for(let[r,i]of Object.entries(n))for(let s=0;s<i.length;s++)if(e===i[s])return {address:e,addressIndex:s,lookupTableAddress:r,role:t}}function cn(e,t){let n=new Set(e.instructions.map(o=>o.programAddress)),r=new Set(Object.values(t).flatMap(o=>o).filter(o=>!n.has(o))),i=[],s=false;for(let o of e.instructions){if(!o.accounts){i.push(o);continue}let a=[],c=false;for(let d of o.accounts){if("lookupTableAddress"in d||!r.has(d.address)||U(d.role)){a.push(d);continue}let u=Qa(d.address,d.role,t);a.push(Object.freeze(u)),c=true,s=true;}i.push(Object.freeze(c?{...o,accounts:a}:o));}return Object.freeze(s?{...e,instructions:i}:e)}function dn(e){return Object.freeze({instructions:Object.freeze([]),version:e.version})}var qa="SysvarRecentB1ockHashes11111111111111111111",Ja="11111111111111111111111111111111";function es(e){return e.programAddress===Ja&&e.data!=null&&ts(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===L.WRITABLE&&e.accounts[1].address===qa&&e.accounts[1].role===L.READONLY&&e.accounts[2].address!=null&&U(e.accounts[2].role)}function ts(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Be(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&es(e.instructions[0])}function un(e,t){return Object.freeze({...t,instructions:Object.freeze([...t.instructions,...e])})}function In(e,t){return Object.freeze({...t,instructions:Object.freeze([...e,...t.instructions])})}function ns(e){let t=Object.values(e);if(t.length===0)throw new T(ge);return t.map(n=>n||new Uint8Array(64).fill(0))}function rs(){return D(y(F(Y(),64),{size:M()}),ns)}function ze(){return N([["signatures",rs()],["messageBytes",Y()]])}function xe(e){let t=sn(e),n=an().encode(t),r=t.staticAccounts.slice(0,t.header.numSignerAccounts),i={};for(let o of r)i[o]=null;let s;return nn(e)?s={blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:Be(e)&&(s={nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address}),Object.freeze({...s?{lifetimeConstraint:s}:void 0,messageBytes:n,signatures:Object.freeze(i)})}function ke(e){let t=ze().encode(e);return Z().decode(t)}function An(e,t){Object.freeze(e);let n={...t,feePayer:e};return Object.freeze(n),n}function _n(e){return Object.freeze({address:e,signMessages:n=>Promise.resolve(n.map(()=>Object.freeze({}))),signTransactions:n=>Promise.resolve(n.map(()=>Object.freeze({})))})}var ee="ComputeBudget111111111111111111111111111111";var We=2;function Ge(){return D(N([["discriminator",p()],["units",q()]]),e=>({...e,discriminator:We}))}function te(e,t){let n=ee,r={...e};return Object.freeze({data:Ge().encode(r),programAddress:n})}var Ve=3;function He(){return D(N([["discriminator",p()],["microLamports",J()]]),e=>({...e,discriminator:Ve}))}function ne(e,t){let n=ee,r={...e};return Object.freeze({data:He().encode(r),programAddress:n})}var re="11111111111111111111111111111111";var Tn=0,ln=1,En=2,gn=3,Rn=4,Dn=5,Nn=6,Sn=7,fn=8;process.env.NODE_ENV!=="production"&&({[Tn]:"an account with the same address already exists",[Dn]:"provided address does not match addressed derived from seed",[gn]:"cannot allocate account data of this length",[En]:"cannot assign account to this program id",[Rn]:"length of requested seed is too long",[Sn]:"stored nonce is still in recent_blockhashes",[Nn]:"advancing stored nonce requires a populated RecentBlockhashes sysvar",[fn]:"specified nonce does not match stored nonce",[ln]:"account does not have enough SOL to perform the operation"});var Ke="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";var C="https://auth.revibase.com",ie="https://api.revibase.com",Cn="revibase.com";function b(e=`${C}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let t=window.innerWidth||screen.availWidth,n=window.innerHeight||screen.availHeight,r=t<=768,i,s,o,a;if(r)i=t,s=n,o=0,a=0;else {let u=window.screenLeft??window.screenX,I=window.screenTop??window.screenY,A=window.innerWidth??document.documentElement.clientWidth??screen.width,_=window.innerHeight??document.documentElement.clientHeight??screen.height;i=500,s=600,a=u+(A-i)/2,o=I+(_-s)/2;}let c=[`width=${i}`,`height=${s}`,`top=${o}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",c);return d&&d.focus(),d}var Qs=600*1e3,qs=500;async function oe({authUrl:e,payload:t,signature:n,popUp:r=null}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((i,s)=>{let o=new URL(e).origin,a=false,c=null,d=()=>{if(!a){a=true,clearTimeout(u),clearInterval(I),c?.close();try{r&&!r.closed&&r.close();}catch{}}},u=setTimeout(()=>{d(),s(new Error("Authentication timed out"));},Qs),I=setInterval(()=>{r?.closed&&(d(),s(new Error("User closed the authentication window")));},qs);if(!r)r=b(e);else try{r.location.href!==e&&r.location.replace(e);}catch{r.location.replace(e);}if(!r){d(),s(new Error("Popup blocked. Please enable popups."));return}let A=_=>{_.origin===o&&_.data?.type==="popup-connect"&&_.ports?.[0]&&(c=_.ports[0],c.start(),c.postMessage({type:"popup-init",payload:t,signature:n}),c.onmessage=g=>{let S=g.data;switch(S.type){case "popup-complete":d(),i(S.payload);break;case "popup-error":d(),s(new Error(S.error));break;case "popup-closed":d(),s(new Error("User closed the authentication window"));break}},window.removeEventListener("message",A));};window.addEventListener("message",A);})}function ae(e){let t=`${e.domain} wants you to sign in with your account.`,n=[];return e.nonce&&n.push(`Nonce: ${e.nonce}`),n.length&&(t+=`
|
|
5
|
+
For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`,[mr]:"No signature verification implementation could be found.",[Mr]:"No key generation implementation could be found.",[pr]:"No signing implementation could be found.",[hr]:"No key export implementation could be found.",[Hn]:"Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given",[Do]:"Transaction processing left an account with an outstanding borrowed reference",[ro]:"Account in use",[io]:"Account loaded twice",[oo]:"Attempt to debit an account but found no record of a prior credit.",[Mo]:"Transaction loads an address table account that doesn't exist",[uo]:"This transaction has already been processed",[Io]:"Blockhash not found",[Ao]:"Loader call chain is too deep",[Ro]:"Transactions are currently disabled due to cluster maintenance",[wo]:"Transaction contains a duplicate instruction ($index) that is not allowed",[so]:"Insufficient funds for fee",[vo]:"Transaction results in an account ($accountIndex) with insufficient funds for rent",[co]:"This account may not be used to pay transaction fees",[To]:"Transaction contains an invalid account reference",[ho]:"Transaction loads an address table account with invalid data",[yo]:"Transaction address table lookup uses an invalid index",[po]:"Transaction loads an address table account with an invalid owner",[Fo]:"LoadedAccountsDataSizeLimit set for transaction must be greater than 0.",[Eo]:"This program may not be used for executing instructions",[Lo]:"Transaction leaves an account with a lower balance than rent-exempt minimum",[fo]:"Transaction loads a writable account that cannot be written",[Po]:"Transaction exceeded max loaded accounts data size cap",[_o]:"Transaction requires a fee but has no signature present",[ao]:"Attempt to load a program that does not exist",[zo]:"Execution of the program referenced by account at index $accountIndex is temporarily restricted.",[Bo]:"ResanitizationNeeded",[go]:"Transaction failed to sanitize accounts offsets correctly",[lo]:"Transaction did not pass signature verification",[mo]:"Transaction locked too many accounts",[xo]:"Sum of account balances before and after transaction do not match",[no]:"The transaction failed with the error `$errorName`",[So]:"Transaction version is unsupported",[Oo]:"Transaction would exceed account data limit within the block",[bo]:"Transaction would exceed total account data limit",[Co]:"Transaction would exceed max account limit within the block",[No]:"Transaction would exceed max Block Cost Limit",[Uo]:"Transaction would exceed max Vote Cost Limit",[ut]:"Attempted to sign a transaction with an address that is not a signer for it",[Qi]:"Transaction is missing an address at index: $index.",[ge]:"Transaction has no expected signers therefore it cannot be encoded",[Tt]:"Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",[Te]:"Transaction does not have a blockhash lifetime",[le]:"Transaction is not a durable nonce transaction",[it]:"Contents of these address lookup tables unknown: $lookupTableAddresses",[ot]:"Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved",[st]:"No fee payer set in CompiledTransaction",[at]:"Could not find program address at index $index",[At]:"Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more",[_t]:"Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more",[Ji]:"Transaction is missing a fee payer.",[dt]:"Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.",[to]:"Transaction first instruction is not advance nonce account instruction.",[eo]:"Transaction with no instructions cannot be durable nonce transaction.",[_e]:"This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees",[j]:"This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable",[It]:"The transaction message expected the transaction to have $numRequiredSignatures signatures, got $signaturesLength.",[ct]:"Transaction is missing signatures for addresses: $addresses.",[Ee]:"Transaction version must be in the range [0, 127]. `$actualVersion` given",[Re]:"This version of Kit does not support decoding transactions with version $unsupportedVersion. The current max supported version is 0.",[lt]:"The transaction has a durable nonce lifetime (with nonce `$nonce`), but the nonce account address is in a lookup table. The lifetime constraint cannot be constructed without fetching the lookup tables for the transaction."},O="i",f="t";function ua(e,t={}){let n=da[e];if(n.length===0)return "";let r;function i(o){if(r[f]===2){let a=n.slice(r[O]+1,o);s.push(a in t?`${t[a]}`:`$${a}`);}else r[f]===1&&s.push(n.slice(r[O],o));}let s=[];return n.split("").forEach((o,a)=>{if(a===0){r={[O]:0,[f]:n[0]==="\\"?0:n[0]==="$"?2:1};return}let c;switch(r[f]){case 0:c={[O]:a,[f]:1};break;case 1:o==="\\"?c={[O]:a,[f]:0}:o==="$"&&(c={[O]:a,[f]:2});break;case 2:o==="\\"?c={[O]:a,[f]:0}:o==="$"?c={[O]:a,[f]:2}:o.match(/\w/)||(c={[O]:a,[f]:1});break}c&&(r!==c&&i(a),r=c);}),i(),s.join("")}function Ia(e,t={}){if(process.env.NODE_ENV!=="production")return ua(e,t);{let n=`Solana error #${e}; Decode this error by running \`npx @solana/errors decode -- ${e}`;return Object.keys(t).length&&(n+=` '${ca(t)}'`),`${n}\``}}var T=class extends Error{cause=this.cause;context;constructor(...[e,t]){let n,r;t&&Object.entries(Object.getOwnPropertyDescriptors(t)).forEach(([s,o])=>{s==="cause"?r={cause:o.value}:(n===void 0&&(n={}),Object.defineProperty(n,s,o));});let i=Ia(e,n);super(i,r),this.context=n===void 0?{}:n,this.context.__code=e,this.name="SolanaError";}};function Aa(e,t){if(e.length>=t)return e;let n=new Uint8Array(t).fill(0);return n.set(e),n}var _a=(e,t)=>Aa(e.length<=t?e:e.slice(0,t),t);function h(e,t){return "fixedSize"in t?t.fixedSize:t.getSizeFromValue(e)}function l(e){return Object.freeze({...e,encode:t=>{let n=new Uint8Array(h(t,e));return e.write(t,n,0),n}})}function P(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}function R(e){return "fixedSize"in e&&typeof e.fixedSize=="number"}function Ta(e){return !R(e)}function Ce(e,t,n,r=0){let i=n.length-r;if(i<t)throw new T(De,{bytesLength:i,codecDescription:e,expected:t})}function Pt(e,t){let n=(o,a,c)=>{let d=e.encode(o);return c=t.write(d.length,a,c),a.set(d,c),c+d.length};if(R(t)&&R(e))return l({...e,fixedSize:t.fixedSize+e.fixedSize,write:n});let r=R(t)?t.fixedSize:t.maxSize??null,i=R(e)?e.fixedSize:e.maxSize??null,s=r!==null&&i!==null?r+i:null;return l({...e,...s!==null?{maxSize:s}:{},getSizeFromValue:o=>{let a=h(o,e);return h(a,t)+a},write:n})}function F(e,t){return l({fixedSize:t,write:(n,r,i)=>{let s=e.encode(n),o=s.length>t?s.slice(0,t):s;return r.set(o,i),i+t}})}function H(e,t){return P({fixedSize:t,read:(n,r)=>{Ce("fixCodecSize",t,n,r),(r>0||n.length>t)&&(n=n.slice(r,r+t)),R(e)&&(n=_a(n,e.fixedSize));let[i]=e.read(n,0);return [i,r+t]}})}function D(e,t){return l({...Ta(e)?{...e,getSizeFromValue:n=>e.getSizeFromValue(t(n))}:e,write:(n,r,i)=>e.write(t(n),r,i)})}function la(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new T(V,{alphabet:e,base:e.length,value:n})}var Ea=e=>l({getSizeFromValue:t=>{let[n,r]=Ft(t,e[0]);if(!r)return t.length;let i=Bt(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(la(e,t),t==="")return r;let[i,s]=Ft(t,e[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let o=Bt(s,e),a=[];for(;o>0n;)a.unshift(Number(o%256n)),o/=256n;let c=[...Array(i.length).fill(0),...a];return n.set(c,r),r+c.length}}),ga=e=>P({read(t,n){let r=n===0?t:t.slice(n);if(r.length===0)return ["",0];let i=r.findIndex(c=>c!==0);i=i===-1?r.length:i;let s=e[0].repeat(i);if(i===r.length)return [s,t.length];let o=r.slice(i).reduce((c,d)=>c*256n+BigInt(d),0n),a=Ra(o,e);return [s+a,t.length]}});function Ft(e,t){let[n,r]=e.split(new RegExp(`((?!${t}).*)`));return [n,r]}function Bt(e,t){let n=BigInt(t.length),r=0n;for(let i of e)r*=n,r+=BigInt(t.indexOf(i));return r}function Ra(e,t){let n=BigInt(t.length),r=[];for(;e>0n;)r.unshift(t[Number(e%n)]),e/=n;return r.join("")}var zt="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",X=()=>Ea(zt),x=()=>ga(zt);var Z=()=>P({read:(e,t=0)=>[Buffer.from(e,t).toString("base64"),e.length]});var Oe,me;function Me(){return Oe||(Oe=X()),Oe}function Na(){return me||(me=x()),me}function xt(e){if(e.length<32||e.length>44)return false;let t=Me();try{return t.encode(e).byteLength===32}catch{return false}}function pe(e){if(e.length<32||e.length>44)throw new T(Ae,{actualLength:e.length});let r=Me().encode(e).byteLength;if(r!==32)throw new T(Ie,{actualLength:r})}function k(e){return pe(e),e}function m(){return D(F(Me(),32),e=>k(e))}function K(){return H(Na(),32)}function q(){return new Intl.Collator("en",{caseFirst:"lower",ignorePunctuation:false,localeMatcher:"best fit",numeric:false,sensitivity:"variant",usage:"sort"}).compare}function kt(e,t,n,r){if(r<t||r>n)throw new T(Se,{codecDescription:e,max:n,min:t,value:r})}function Sa(e){return e?.endian!==1}function he(e){return l({fixedSize:e.size,write(t,n,r){e.range&&kt(e.name,e.range[0],e.range[1],t);let i=new ArrayBuffer(e.size);return e.set(new DataView(i),t,Sa(e.config)),n.set(new Uint8Array(i),r),r+e.size}})}var M=()=>l({getSizeFromValue:e=>e<=127?1:e<=16383?2:3,maxSize:3,write:(e,t,n)=>{kt("shortU16",0,65535,e);let r=[0];for(let i=0;;i+=1){let s=Number(e)>>i*7;if(s===0)break;let o=127&s;r[i]=o,i>0&&(r[i-1]|=128);}return t.set(r,n),n+r.length}});var Q=(e={})=>he({config:e,name:"u32",range:[0,4294967295],set:(t,n,r)=>t.setUint32(0,Number(n),r),size:4});var J=(e={})=>he({config:e,name:"u64",range:[0n,BigInt("0xffffffffffffffff")],set:(t,n,r)=>t.setBigUint64(0,BigInt(n),r),size:8});var p=()=>he({name:"u8",range:[0,255],set:(e,t)=>e.setUint8(0,Number(t)),size:1});function Oa(e,t,n){if(t!==n)throw new T(Ne,{actual:n,codecDescription:e,expected:t})}function ma(e){return e.reduce((t,n)=>t===null||n===null?null:Math.max(t,n),0)}function Wt(e){return e.reduce((t,n)=>t===null||n===null?null:t+n,0)}function Kt(e){return R(e)?e.fixedSize:null}function Le(e){return R(e)?e.fixedSize:e.maxSize??null}function y(e,t={}){let n=t.size??Q(),r=Gt(n,Kt(e)),i=Gt(n,Le(e))??void 0;return l({...r!==null?{fixedSize:r}:{getSizeFromValue:s=>(typeof n=="object"?h(s.length,n):0)+[...s].reduce((a,c)=>a+h(c,e),0),maxSize:i},write:(s,o,a)=>(typeof n=="number"&&Oa("array",n,s.length),typeof n=="object"&&(a=n.write(s.length,o,a)),s.forEach(c=>{a=e.write(c,o,a);}),a)})}function Gt(e,t){return typeof e!="number"?null:e===0?0:t===null?null:t*e}function Y(){return l({getSizeFromValue:e=>e.length,write:(e,t,n)=>(t.set(e,n),n+e.length)})}function Yt(e){return l({fixedSize:e.length,write:(t,n,r)=>(n.set(e,r),r+e.length)})}function $t(e,t){let n=Ma(e),r=(s,o,a)=>{let c=t(s);return Vt(e,c),e[c].write(s,o,a)};if(n!==null)return l({fixedSize:n,write:r});let i=pa(e);return l({...i!==null?{maxSize:i}:{},getSizeFromValue:s=>{let o=t(s);return Vt(e,o),h(s,e[o])},write:r})}function Vt(e,t){if(typeof e[t]>"u")throw new T(fe,{maxRange:e.length-1,minRange:0,variant:t})}function Ma(e){if(e.length===0)return 0;if(!R(e[0]))return null;let t=e[0].fixedSize;return e.every(r=>R(r)&&r.fixedSize===t)?t:null}function pa(e){return ma(e.map(t=>Le(t)))}function N(e){let t=e.map(([,i])=>i),n=Wt(t.map(Kt)),r=Wt(t.map(Le))??void 0;return l({...n===null?{getSizeFromValue:i=>e.map(([s,o])=>h(i[s],o)).reduce((s,o)=>s+o,0),maxSize:r}:{fixedSize:n},write:(i,s,o)=>(e.forEach(([a,c])=>{o=c.write(i[a],s,o);}),o)})}function Ue(e,...t){return t.reduce((n,r)=>r(n),e)}var L=(e=>(e[e.WRITABLE_SIGNER=3]="WRITABLE_SIGNER",e[e.READONLY_SIGNER=2]="READONLY_SIGNER",e[e.WRITABLE=1]="WRITABLE",e[e.READONLY=0]="READONLY",e))(L||{});var ha=1;function U(e){return e>=2}function W(e){return (e&ha)!==0}function be(e,t){return e|t}function jt(e){return xt(e)}function Xt(){return K()}function nn(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.blockhash=="string"&&typeof e.lifetimeConstraint.lastValidBlockHeight=="bigint"&&jt(e.lifetimeConstraint.blockhash)}function rn(e,t){return "lifetimeConstraint"in t&&t.lifetimeConstraint&&"blockhash"in t.lifetimeConstraint&&t.lifetimeConstraint.blockhash===e.blockhash&&t.lifetimeConstraint.lastValidBlockHeight===e.lastValidBlockHeight?t:Object.freeze({...t,lifetimeConstraint:Object.freeze(e)})}function ba(e,t,n=t){if(!t.match(new RegExp(`^[${e}]*$`)))throw new T(V,{alphabet:e,base:e.length,value:n})}var wa=e=>l({getSizeFromValue:t=>{let[n,r]=Zt(t,e[0]);if(!r)return t.length;let i=qt(r,e);return n.length+Math.ceil(i.toString(16).length/2)},write(t,n,r){if(ba(e,t),t==="")return r;let[i,s]=Zt(t,e[0]);if(!s)return n.set(new Uint8Array(i.length).fill(0),r),r+i.length;let o=qt(s,e),a=[];for(;o>0n;)a.unshift(Number(o%256n)),o/=256n;let c=[...Array(i.length).fill(0),...a];return n.set(c,r),r+c.length}});function Zt(e,t){let[n,r]=e.split(new RegExp(`((?!${t}).*)`));return [n,r]}function qt(e,t){let n=BigInt(t.length),r=0n;for(let i of e)r*=n,r+=BigInt(t.indexOf(i));return r}var va="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",Pa=()=>wa(va);var we;function Fa(){if(!we){let e=y(p(),{size:M()});we=N([["lookupTableAddress",m()],["writableIndexes",e],["readonlyIndexes",e]]);}return we}var ve;function Pe(){return ve||(ve=p()),ve}function Ba(){return N([["numSignerAccounts",Pe()],["numReadonlySignerAccounts",Pe()],["numReadonlyNonSignerAccounts",Pe()]])}var Fe;function za(){return Fe||(Fe=D(N([["programAddressIndex",p()],["accountIndices",y(p(),{size:M()})],["data",Pt(Y(),M())]]),e=>e.accountIndices!==void 0&&e.data!==void 0?e:{...e,accountIndices:e.accountIndices??[],data:e.data??new Uint8Array(0)})),Fe}var xa=0,ka=128;function Wa(){return l({getSizeFromValue:e=>e==="legacy"?0:1,maxSize:1,write:(e,t,n)=>{if(e==="legacy")return n;if(e<0||e>127)throw new T(Ee,{actualVersion:e});if(e>xa)throw new T(Re,{unsupportedVersion:e});return t.set([e|ka],n),n+1}})}function Qt(){return N(on())}function Jt(){return D(N([...on(),["addressTableLookups",Ga()]]),e=>e.version==="legacy"?e:{...e,addressTableLookups:e.addressTableLookups??[]})}function on(){let e=$t([Yt(new Uint8Array(32)),F(Pa(),32)],t=>t===void 0?0:1);return [["version",Wa()],["header",Ba()],["staticAccounts",y(m(),{size:M()})],["lifetimeToken",e],["instructions",y(za(),{size:M()})]]}function Ga(){return y(Fa(),{size:M()})}function an(){return l({getSizeFromValue:e=>e.version==="legacy"?Qt().getSizeFromValue(e):Jt().getSizeFromValue(e),write:(e,t,n)=>e.version==="legacy"?Qt().write(e,t,n):Jt().write(e,t,n)})}function en(e,t,n){e[t]=n(e[t]??{role:L.READONLY});}var E=Symbol("AddressMapTypeProperty");function Va(e,t){let n={[e]:{[E]:0,role:L.WRITABLE_SIGNER}},r=new Set;for(let i of t){en(n,i.programAddress,o=>{if(r.add(i.programAddress),E in o){if(W(o.role))switch(o[E]){case 0:throw new T(_e,{programAddress:i.programAddress});default:throw new T(j,{programAddress:i.programAddress})}if(o[E]===2)return o}return {[E]:2,role:L.READONLY}});let s;if(i.accounts)for(let o of i.accounts)en(n,o.address,a=>{let{address:c,...d}=o;if(E in a)switch(a[E]){case 0:return a;case 1:{let u=be(a.role,d.role);if("lookupTableAddress"in d){if(a.lookupTableAddress!==d.lookupTableAddress&&(s||=q())(d.lookupTableAddress,a.lookupTableAddress)<0)return {[E]:1,...d,role:u}}else if(U(d.role))return {[E]:2,role:u};return a.role!==u?{...a,role:u}:a}case 2:{let u=be(a.role,d.role);if(r.has(o.address)){if(W(d.role))throw new T(j,{programAddress:o.address});return a.role!==u?{...a,role:u}:a}else return "lookupTableAddress"in d&&!U(a.role)?{...d,[E]:1,role:u}:a.role!==u?{...a,role:u}:a}}return "lookupTableAddress"in d?{...d,[E]:1}:{...d,[E]:2}});}return n}function Ha(e){let t;return Object.entries(e).sort(([r,i],[s,o])=>{if(i[E]!==o[E]){if(i[E]===0)return -1;if(o[E]===0)return 1;if(i[E]===2)return -1;if(o[E]===2)return 1}let a=U(i.role);if(a!==U(o.role))return a?-1:1;let c=W(i.role);return c!==W(o.role)?c?-1:1:(t||=q(),i[E]===1&&o[E]===1&&i.lookupTableAddress!==o.lookupTableAddress?t(i.lookupTableAddress,o.lookupTableAddress):t(r,s))}).map(([r,i])=>({address:r,...i}))}function Ka(e){let t={};for(let n of e){if(!("lookupTableAddress"in n))continue;let r=t[n.lookupTableAddress]||={readonlyIndexes:[],writableIndexes:[]};n.role===L.WRITABLE?r.writableIndexes.push(n.addressIndex):r.readonlyIndexes.push(n.addressIndex);}return Object.keys(t).sort(q()).map(n=>({lookupTableAddress:n,...t[n]}))}function Ya(e){let t=0,n=0,r=0;for(let i of e){if("lookupTableAddress"in i)break;let s=W(i.role);U(i.role)?(r++,s||n++):s||t++;}return {numReadonlyNonSignerAccounts:t,numReadonlySignerAccounts:n,numSignerAccounts:r}}function $a(e){let t={};for(let[n,r]of e.entries())t[r.address]=n;return t}function ja(e,t){let n=$a(t);return e.map(({accounts:r,data:i,programAddress:s})=>({programAddressIndex:n[s],...r?{accountIndices:r.map(({address:o})=>n[o])}:null,...i?{data:i}:null}))}function Xa(e){return "nonce"in e?e.nonce:e.blockhash}function Za(e){let t=e.findIndex(r=>"lookupTableAddress"in r);return (t===-1?e:e.slice(0,t)).map(({address:r})=>r)}function sn(e){let t=Va(e.feePayer.address,e.instructions),n=Ha(t),r=e.lifetimeConstraint;return {...e.version!=="legacy"?{addressTableLookups:Ka(n)}:null,...r?{lifetimeToken:Xa(r)}:null,header:Ya(n),instructions:ja(e.instructions,n),staticAccounts:Za(n),version:e.version}}function qa(e,t,n){for(let[r,i]of Object.entries(n))for(let s=0;s<i.length;s++)if(e===i[s])return {address:e,addressIndex:s,lookupTableAddress:r,role:t}}function cn(e,t){let n=new Set(e.instructions.map(o=>o.programAddress)),r=new Set(Object.values(t).flatMap(o=>o).filter(o=>!n.has(o))),i=[],s=false;for(let o of e.instructions){if(!o.accounts){i.push(o);continue}let a=[],c=false;for(let d of o.accounts){if("lookupTableAddress"in d||!r.has(d.address)||U(d.role)){a.push(d);continue}let u=qa(d.address,d.role,t);a.push(Object.freeze(u)),c=true,s=true;}i.push(Object.freeze(c?{...o,accounts:a}:o));}return Object.freeze(s?{...e,instructions:i}:e)}function dn(e){return Object.freeze({instructions:Object.freeze([]),version:e.version})}var Qa="SysvarRecentB1ockHashes11111111111111111111",Ja="11111111111111111111111111111111";function es(e){return e.programAddress===Ja&&e.data!=null&&ts(e.data)&&e.accounts?.length===3&&e.accounts[0].address!=null&&e.accounts[0].role===L.WRITABLE&&e.accounts[1].address===Qa&&e.accounts[1].role===L.READONLY&&e.accounts[2].address!=null&&U(e.accounts[2].role)}function ts(e){return e.byteLength===4&&e[0]===4&&e[1]===0&&e[2]===0&&e[3]===0}function Be(e){return "lifetimeConstraint"in e&&typeof e.lifetimeConstraint.nonce=="string"&&e.instructions[0]!=null&&es(e.instructions[0])}function un(e,t){return Object.freeze({...t,instructions:Object.freeze([...t.instructions,...e])})}function In(e,t){return Object.freeze({...t,instructions:Object.freeze([...e,...t.instructions])})}function ns(e){let t=Object.values(e);if(t.length===0)throw new T(ge);return t.map(n=>n||new Uint8Array(64).fill(0))}function rs(){return D(y(F(Y(),64),{size:M()}),ns)}function ze(){return N([["signatures",rs()],["messageBytes",Y()]])}function xe(e){let t=sn(e),n=an().encode(t),r=t.staticAccounts.slice(0,t.header.numSignerAccounts),i={};for(let o of r)i[o]=null;let s;return nn(e)?s={blockhash:e.lifetimeConstraint.blockhash,lastValidBlockHeight:e.lifetimeConstraint.lastValidBlockHeight}:Be(e)&&(s={nonce:e.lifetimeConstraint.nonce,nonceAccountAddress:e.instructions[0].accounts[0].address}),Object.freeze({...s?{lifetimeConstraint:s}:void 0,messageBytes:n,signatures:Object.freeze(i)})}function ke(e){let t=ze().encode(e);return Z().decode(t)}function An(e,t){Object.freeze(e);let n={...t,feePayer:e};return Object.freeze(n),n}function _n(e){return Object.freeze({address:e,signMessages:n=>Promise.resolve(n.map(()=>Object.freeze({}))),signTransactions:n=>Promise.resolve(n.map(()=>Object.freeze({})))})}var ee="ComputeBudget111111111111111111111111111111";var We=2;function Ge(){return D(N([["discriminator",p()],["units",Q()]]),e=>({...e,discriminator:We}))}function te(e,t){let n=ee,r={...e};return Object.freeze({data:Ge().encode(r),programAddress:n})}var Ve=3;function He(){return D(N([["discriminator",p()],["microLamports",J()]]),e=>({...e,discriminator:Ve}))}function ne(e,t){let n=ee,r={...e};return Object.freeze({data:He().encode(r),programAddress:n})}var re="11111111111111111111111111111111";var Tn=0,ln=1,En=2,gn=3,Rn=4,Dn=5,Nn=6,Sn=7,fn=8;process.env.NODE_ENV!=="production"&&({[Tn]:"an account with the same address already exists",[Dn]:"provided address does not match addressed derived from seed",[gn]:"cannot allocate account data of this length",[En]:"cannot assign account to this program id",[Rn]:"length of requested seed is too long",[Sn]:"stored nonce is still in recent_blockhashes",[Nn]:"advancing stored nonce requires a populated RecentBlockhashes sysvar",[fn]:"specified nonce does not match stored nonce",[ln]:"account does not have enough SOL to perform the operation"});var Ke="TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";var C="https://auth.revibase.com",ie="https://api.revibase.com",Cn="revibase.com";function b(e=`${C}/loading`){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let t=window.innerWidth||screen.availWidth,n=window.innerHeight||screen.availHeight,r=t<=768,i,s,o,a;if(r)i=t,s=n,o=0,a=0;else {let u=window.screenLeft??window.screenX,I=window.screenTop??window.screenY,A=window.innerWidth??document.documentElement.clientWidth??screen.width,_=window.innerHeight??document.documentElement.clientHeight??screen.height;i=500,s=600,a=u+(A-i)/2,o=I+(_-s)/2;}let c=[`width=${i}`,`height=${s}`,`top=${o}`,`left=${a}`,"toolbar=no","location=no","status=no","menubar=no","scrollbars=yes","resizable=yes"].join(","),d=window.open(e,"_blank",c);return d&&d.focus(),d}async function oe(e){let t=await fetch(`${e}/getRandomPayer`),{randomPayer:n}=await t.json();return {address:k(n),async signTransactions(r){let i={publicKey:n,transactions:r.map(a=>Z().decode(ze().encode(a)))},o=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})).json();if("error"in o)throw new Error(o.error);return o.signatures.map(a=>({[k(n)]:X().encode(a)}))}}}var qs=600*1e3,Qs=500;async function ae({authUrl:e,payload:t,signature:n,popUp:r=null}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");return new Promise((i,s)=>{let o=new URL(e).origin,a=false,c=null,d=()=>{if(!a){a=true,clearTimeout(u),clearInterval(I),c?.close();try{r&&!r.closed&&r.close();}catch{}}},u=setTimeout(()=>{d(),s(new Error("Authentication timed out"));},qs),I=setInterval(()=>{r?.closed&&(d(),s(new Error("User closed the authentication window")));},Qs);if(!r)r=b(e);else try{r.location.href!==e&&r.location.replace(e);}catch{r.location.replace(e);}if(!r){d(),s(new Error("Popup blocked. Please enable popups."));return}let A=_=>{_.origin===o&&_.data?.type==="popup-connect"&&_.ports?.[0]&&(c=_.ports[0],c.start(),c.postMessage({type:"popup-init",payload:t,signature:n}),c.onmessage=g=>{let S=g.data;switch(S.type){case "popup-complete":d(),i(S.payload);break;case "popup-error":d(),s(new Error(S.error));break;case "popup-closed":d(),s(new Error("User closed the authentication window"));break}},window.removeEventListener("message",A));};window.addEventListener("message",A);})}function se(e){let t=`${e.domain} wants you to sign in with your account.`,n=[];return e.nonce&&n.push(`Nonce: ${e.nonce}`),n.length&&(t+=`
|
|
6
6
|
|
|
7
7
|
${n.join(`
|
|
8
|
-
`)}`),t}function On(){let e=crypto.getRandomValues(new Uint8Array(33)),t=crypto.getRandomValues(new Uint8Array(37)),n=crypto.getRandomValues(new Uint8Array(250)),r=crypto.getRandomValues(new Uint8Array(64));return new core.SignedSecp256r1Key(e,{originIndex:0,crossOrigin:false,authData:t,domainConfig:K().decode(crypto.getRandomValues(new Uint8Array(32))),signature:r,verifyArgs:{slotHash:crypto.getRandomValues(new Uint8Array(32)),slotNumber:BigInt(0),truncatedClientDataJson:crypto.getRandomValues(new Uint8Array(100)),clientDataJson:n},clientAndDeviceHash:crypto.getRandomValues(new Uint8Array(32)),authResponse:{id:"",rawId:"",type:"public-key",clientExtensionResults:{},response:{authenticatorData:core.bufferToBase64URLString(t),clientDataJSON:core.bufferToBase64URLString(n),signature:core.bufferToBase64URLString(r)}}})}async function mn({payer:e,index:t,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:i,compressed:s,addressesByLookupTableAddress:o,cachedAccounts:a}){let c=await core.prepareTransactionSync({payer:e,index:t,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:i,compressed:s,simulateProof:true,addressesByLookupTableAddress:o,cachedAccounts:a}),d=Ue(dn({version:0}),I=>un(c.instructions,I),I=>An(c.payer,I),I=>rn({blockhash:Xt().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)},I),I=>c.addressesByLookupTableAddress?cn(I,c.addressesByLookupTableAddress):I,I=>In([te({units:8e5}),ne({microLamports:1e3})],I),I=>xe(I)),u=ke(d).length;return console.log("Estimated Tx Size: ",u),u>1644}async function Mn(e=core.getJitoTipsConfig()){let{getJitoTipsUrl:t,priority:n}=e,i=await(await fetch(t)).json();return Math.round(i[0][n]*10**9)}async function se(e){let t=await fetch(`${e}/getRandomPayer`),{randomPayer:n}=await t.json();return {address:k(n),async signTransactions(r){let i={publicKey:n,transactions:r.map(a=>Z().decode(ze().encode(a)))},o=await(await fetch(`${e}/sign`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)})).json();if("error"in o)throw new Error(o.error);return o.signatures.map(a=>({[k(n)]:X().encode(a)}))}}}async function pn(e,t){let n;if(e.data.payload.additionalInfo.settingsIndexWithAddress)n=e.data.payload.additionalInfo.settingsIndexWithAddress;else {let r=await core.fetchUserAccountData(new core.Secp256r1Key(e.data.payload.signer),e.data.payload.userAddressTreeIndex,t);if(r.delegatedTo.__option==="None")throw Error("User has no delegated wallet");n=r.delegatedTo.value;}return n}async function hn({message:e,signer:t,popUp:n,authOrigin:r,onClientAuthorizationCallback:i}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let s=window.origin,o=`${r}?redirectOrigin=${s}`,a={phase:"start",data:{type:"message",payload:e},redirectOrigin:s,signer:t},[c,{message:d,id:u,signature:I}]=await Promise.all([Promise.resolve(n??b(o)),i(a)]),A=await oe({authUrl:o,payload:{...a,data:{...a.data,payload:d}},signature:I,popUp:c});if(A.data.type!=="message")throw new Error("Expected Message Response");return await i({...A,data:{...A.data,payload:{...A.data.payload,id:u,message:d}}})}async function $({transactionActionType:e,transactionAddress:t,transactionMessageBytes:n,signer:r,popUp:i,authOrigin:s,onClientAuthorizationCallback:o}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let a=window.origin,c=`${s}?redirectOrigin=${a}`,d={phase:"start",data:{type:"transaction",payload:{transactionActionType:e,transactionAddress:t,transactionMessageBytes:core.bufferToBase64URLString(n)}},redirectOrigin:a,signer:r},[u,{signature:I}]=await Promise.all([Promise.resolve(i??b(c)),o(d)]),A=await oe({authUrl:c,payload:d,signature:I,popUp:u});if(A.data.type!=="transaction")throw new Error("Expected Transaction Response");let{signature:_}=await o(A);return {...A.data.payload,clientSignature:{...A.data.payload.clientSignature,signature:_}}}async function yn(e){let t=await $e(e);return core.signAndSendTransaction(t)}var $e=async e=>{let{amount:t,destination:n,mint:r,payer:i,addressesByLookupTableAddress:s,tokenProgram:o=Ke,cachedAccounts:a=new Map,signer:c,authOrigin:d=C,popUp:u,onClientAuthorizationCallback:I,createAtaIfNeeded:A=true}=e,_=await $({transactionActionType:"transfer_intent",transactionAddress:r?o:re,transactionMessageBytes:new Uint8Array([...J().encode(t),...m().encode(n),...m().encode(r??re)]),signer:c,popUp:u,onClientAuthorizationCallback:I,authOrigin:d}),g;if(_.additionalInfo.settingsIndexWithAddress)g=_.additionalInfo.settingsIndexWithAddress;else {let je=await core.fetchUserAccountData(new core.Secp256r1Key(_.signer),_.userAddressTreeIndex,a);if(je.delegatedTo.__option==="None")throw Error("User has no delegated wallet");g=je.delegatedTo.value;}let[S,ue]=await Promise.all([core.fetchSettingsAccountData(g.index,g.settingsAddressTreeIndex,a),core.getSignedSecp256r1Key(_)]),{transactionManagerAddress:w,userAddressTreeIndex:B}=core.retrieveTransactionManager(_.signer,S),v=await core.getSignedTransactionManager({authResponses:[_],transactionManagerAddress:w,userAddressTreeIndex:B,cachedAccounts:a}),G=v?[ue,v]:[ue];return {instructions:r?await core.tokenTransferIntent({payer:i,index:g.index,settingsAddressTreeIndex:g.settingsAddressTreeIndex,createAtaIfNeeded:A,amount:t,signers:G,destination:n,mint:r,tokenProgram:o,compressed:S.isCompressed,cachedAccounts:a}):await core.nativeTransferIntent({payer:i,index:g.index,settingsAddressTreeIndex:g.settingsAddressTreeIndex,amount:t,signers:G,destination:n,compressed:S.isCompressed,cachedAccounts:a}),payer:i,addressesByLookupTableAddress:s}};var bn=async e=>{let t=b(),{addressesByLookupTableAddress:n,instructions:r,payer:i,onClientAuthorizationCallback:s,additionalSigners:o,signer:a,settingsIndexWithAddress:c,authOrigin:d=C,cachedAccounts:u=new Map}=e,[I,A,_]=await Promise.all([core.fetchSettingsAccountData(c.index,c.settingsAddressTreeIndex,u),core.getSettingsFromIndex(c.index),core.prepareTransactionMessage({payer:await core.getWalletAddressFromIndex(c.index),instructions:r,addressesByLookupTableAddress:n})]),{transactionManagerAddress:g,userAddressTreeIndex:S}=core.retrieveTransactionManager(a,I);if(await mn({signers:[On(),...o??[],...g?[_n(g)]:[]],compressed:I.isCompressed,payer:i,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,transactionMessageBytes:_,addressesByLookupTableAddress:n,cachedAccounts:u})){let[w,B]=await Promise.all([$({signer:a,transactionActionType:g?"execute":"create_with_preauthorized_execution",transactionAddress:A,transactionMessageBytes:new Uint8Array(_),popUp:t,onClientAuthorizationCallback:s,authOrigin:d}),Mn()]),[v,G]=await Promise.all([core.getSignedTransactionManager({authResponses:[w],transactionMessageBytes:_,transactionManagerAddress:g,userAddressTreeIndex:S}),core.getSignedSecp256r1Key(w)]);return await core.prepareTransactionBundle({compressed:I.isCompressed,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,transactionMessageBytes:_,creator:v??G,executor:v?G:void 0,jitoBundlesTipAmount:B,payer:i,additionalSigners:o,addressesByLookupTableAddress:n,cachedAccounts:u})}else {let w=await $({signer:a,transactionActionType:"sync",transactionAddress:A.toString(),transactionMessageBytes:new Uint8Array(_),popUp:t,onClientAuthorizationCallback:s,authOrigin:d}),[B,v]=await Promise.all([core.getSignedTransactionManager({authResponses:[w],transactionMessageBytes:new Uint8Array(_),transactionManagerAddress:g,userAddressTreeIndex:S}),core.getSignedSecp256r1Key(w)]);return [await core.prepareTransactionSync({compressed:I.isCompressed,signers:[v,...o??[],...B?[B]:[]],payer:i,transactionMessageBytes:_,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,addressesByLookupTableAddress:n,cachedAccounts:u})]}};function wn(e,t,n){let r={};function i(d,...u){r[d]?.forEach(({fn:I,ctx:A})=>{I.apply(A,u);});}let s=window.localStorage.getItem("Revibase:account"),{publicKey:o,member:a,settingsIndexWithAddress:c}=s?JSON.parse(s):{publicKey:null,member:null,settingsIndexWithAddress:null};return {publicKey:o,member:a,settingsIndexWithAddress:c,connect:async function(){let d=ae({domain:window.location.origin,nonce:crypto.randomUUID()}),{user:u}=await this.signMessage(d);if(!u)throw Error("Failed to verify signed message");this.publicKey=u.walletAddress,this.member=u.publicKey,this.settingsIndexWithAddress=u.settingsIndexWtihAddress,window.localStorage.setItem("Revibase:account",JSON.stringify({publicKey:this.publicKey,member:this.member,settingsIndexWithAddress:this.settingsIndexWithAddress},(I,A)=>typeof A=="bigint"?Number(A.toString()):A)),i("connect"),i("accountChanged");},disconnect:async function(){this.publicKey=null,this.member=null,this.settingsIndexWithAddress=null,window.localStorage.removeItem("Revibase:account"),i("disconnect");},signMessage:async function(d){return await hn({signer:this.member??void 0,onClientAuthorizationCallback:e,message:d,authOrigin:n??C})},buildTokenTransfer:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await se(ie);return $e({signer:this.member,payer:u,onClientAuthorizationCallback:e,...d,authOrigin:n})},signAndSendTokenTransfer:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await se(ie);return yn({signer:this.member,onClientAuthorizationCallback:e,payer:u,...d,authOrigin:n})},buildTransaction:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await se(ie);return bn({signer:this.member,settingsIndexWithAddress:this.settingsIndexWithAddress,onClientAuthorizationCallback:e,payer:u,...d,authOrigin:n})},signAndSendTransaction:async function(d){let u=await this.buildTransaction(d);if(!u.length)throw new Error("Unable to build transaction");return u.length===1?core.signAndSendTransaction(u[0]):core.signAndSendBundledTransactions(u)},on:function(d,u,I){r[d]||(r[d]=[]),r[d].push({fn:u,ctx:I});},off:function(d,u,I){r[d]=r[d]?.filter(A=>A.fn!==u||A.ctx!==I);}}}var vn="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1MDAgMjAwIDUwMDAgNTAwMCI+CiAgPHBhdGggZD0iTTMxMDAgMzAwaDM4MDBhNDAwIDQwMCAwIDAxIDQwMCA0MDB2MzgwM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GF0aCBkPSJNNDM1OSAyMjU1YTM0MCAzNDAgMCAxMCAzNDAgMzQwIDM0MCAzNDAgMCAwMC0zNDAtMzQwbTAgNTI0YTE4NCAxODQgMCAwMS0xODUtMTg0IDE4NCAxODQgMCAwMSAxODQtMTg0IDE4NCAxODQgMCAwMSAxODUgMTg0IDE4NCAxODQgMCAwMS0xODQgMTg0Ii8+Cjwvc3ZnPgo=";var ce=class extends core$1.ReadonlyWalletAccount{member;settingsIndexWithAddress;constructor(t,n,r){super(t),this.member=n,this.settingsIndexWithAddress=r;}};var de=class e{#n={};#a="1.0.0";#s="Revibase";#c=vn;#t=null;#e;get version(){return this.#a}get name(){return this.#s}get icon(){return this.#c}get chains(){return ["solana:mainnet","solana:devnet"]}get features(){return {"standard:connect":{version:"1.0.0",connect:this.#A},"standard:disconnect":{version:"1.0.0",disconnect:this.#_},"standard:events":{version:"1.0.0",on:this.#d},"revibase:SignAndSendTransaction":{version:"1.0.0",signAndSendTransaction:this.#T},"revibase:BuildTransaction":{version:"1.0.0",buildTransaction:this.#l},"revibase:SignAndSendTokenTransfer":{version:"1.0.0",signAndSendTokenTransfer:this.#E},"revibase:BuildTokenTransferTransaction":{version:"1.0.0",buildTokenTransferTransaction:this.#g},"revibase:SignMessage":{version:"1.0.0",signMessage:this.#R},"revibase:":{revibase:this.#e}}}get accounts(){return this.#t?[this.#t]:[]}constructor(t){new.target===e&&Object.freeze(this),this.#e=t,t.on("connect",this.#r,this),t.on("disconnect",this.#o,this),t.on("accountChanged",this.#I,this),this.#r();}#d=(t,n)=>(this.#n[t]?.push(n)||(this.#n[t]=[n]),()=>this.#u(t,n));#i(t,...n){this.#n[t]?.forEach(r=>r.apply(null,n));}#u(t,n){this.#n[t]=this.#n[t]?.filter(r=>n!==r);}#r=()=>{let t=this.#e.publicKey,n=this.#e.member,r=this.#e.settingsIndexWithAddress;if(t&&n&&r){let i=new Uint8Array(m().encode(k(t))),s=this.#t;(!s||s.address!==t.toString()||!core$1.bytesEqual(s.publicKey,i))&&(this.#t=new ce({address:t,publicKey:i,chains:this.chains,features:Object.keys(this.features)},n,r),this.#i("change",{accounts:this.accounts}));}};#o=()=>{this.#t&&(this.#t=null,this.#i("change",{accounts:this.accounts}));};#I=()=>{this.#t?this.#r():this.#o();};#A=async t=>(this.#t||await this.#e.connect(t),this.#r(),{accounts:this.accounts});#_=async()=>{await this.#e.disconnect();};#T=t=>this.#e.signAndSendTransaction(t);#l=t=>this.#e.buildTransaction(t);#E=t=>this.#e.signAndSendTokenTransfer(t);#g=t=>this.#e.buildTokenTransfer(t);#R=t=>this.#e.signMessage(t)};function uy(e){core.initialize({rpcEndpoint:e.rpcEndpoint,proverEndpoint:e.proverEndpoint,compressionApiEndpoint:e.compressionApiEndpoint,jitoTipsConfig:e.jitoTipsConfig}),typeof window<"u"&&core$1.registerWallet(new de(wn(e.onClientAuthorizationCallback,e.feePayer,e.authOrigin)));}async function Pn(e,t=C,n=Cn){let{payload:r}=e.data,i=r.message,s=core.createMessageChallenge(i,r.clientSignature.clientOrigin,r.deviceSignature.publicKey,r.nonce),{verified:o}=await server.verifyAuthenticationResponse({response:r.authResponse,expectedChallenge:core.bufferToBase64URLString(s),expectedRPID:n,expectedOrigin:t,requireUserVerification:false,credential:{counter:0,id:r.authResponse.id,publicKey:core.convertPubkeyCompressedToCose(r.signer)}});if(!o)throw new Error("Unable to verify message");let a=await pn(e),c=await core.getWalletAddressFromIndex(a.index),u=(await core.fetchSettingsAccountData(a.index,a.settingsAddressTreeIndex)).members.some(A=>A.role===core.UserRole.TransactionManager);return {publicKey:r.signer,walletAddress:c,settingsIndexWithAddress:a,hasTxManager:u,...r.additionalInfo}}async function Oy(e,t,n,r){if(e.phase==="start"){let{data:o}=e,a=core.createClientAuthorizationStartRequestChallenge(e),c=x().decode(new Uint8Array(await crypto.subtle.sign({name:"Ed25519"},t,new Uint8Array(a))));if(o.type==="message"){let d=o.payload??ae({domain:"your_website_name",nonce:crypto.randomUUID()});return {signature:c,message:d}}return {signature:c}}if(e.data.type==="message")return {user:await Pn({data:e.data},n,r)};let i=core.createClientAuthorizationCompleteRequestChallenge(e);return {signature:x().decode(new Uint8Array(await crypto.subtle.sign({name:"Ed25519"},t,new Uint8Array(i))))}}exports.RevibaseBuildTokenTransferTransaction=Pc;exports.RevibaseBuildTransaction=wc;exports.RevibaseSignAndSendTokenTransfer=vc;exports.RevibaseSignAndSendTransaction=bc;exports.RevibaseSignMessage=Fc;exports.initializeWallet=uy;exports.processClientAuthCallback=Oy;//# sourceMappingURL=index.cjs.map
|
|
8
|
+
`)}`),t}function On(){let e=crypto.getRandomValues(new Uint8Array(33)),t=crypto.getRandomValues(new Uint8Array(37)),n=crypto.getRandomValues(new Uint8Array(250)),r=crypto.getRandomValues(new Uint8Array(64));return new core.SignedSecp256r1Key(e,{originIndex:0,crossOrigin:false,authData:t,domainConfig:K().decode(crypto.getRandomValues(new Uint8Array(32))),signature:r,verifyArgs:{slotHash:crypto.getRandomValues(new Uint8Array(32)),slotNumber:BigInt(0),truncatedClientDataJson:crypto.getRandomValues(new Uint8Array(100)),clientDataJson:n},clientAndDeviceHash:crypto.getRandomValues(new Uint8Array(32)),authResponse:{id:"",rawId:"",type:"public-key",clientExtensionResults:{},response:{authenticatorData:core.bufferToBase64URLString(t),clientDataJSON:core.bufferToBase64URLString(n),signature:core.bufferToBase64URLString(r)}}})}async function mn({payer:e,index:t,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:i,compressed:s,addressesByLookupTableAddress:o,cachedAccounts:a}){let c=await core.prepareTransactionSync({payer:e,index:t,settingsAddressTreeIndex:n,transactionMessageBytes:r,signers:i,compressed:s,simulateProof:true,addressesByLookupTableAddress:o,cachedAccounts:a}),d=Ue(dn({version:0}),I=>un(c.instructions,I),I=>An(c.payer,I),I=>rn({blockhash:Xt().decode(crypto.getRandomValues(new Uint8Array(32))),lastValidBlockHeight:BigInt(Number.MAX_SAFE_INTEGER)},I),I=>c.addressesByLookupTableAddress?cn(I,c.addressesByLookupTableAddress):I,I=>In([te({units:8e5}),ne({microLamports:1e3})],I),I=>xe(I)),u=ke(d).length;return console.log("Estimated Tx Size: ",u),u>1644}async function Mn(e=core.getJitoTipsConfig()){let{getJitoTipsUrl:t,priority:n}=e,i=await(await fetch(t)).json();return Math.round(i[0][n]*10**9)}async function pn(e,t){let n;if(e.data.payload.additionalInfo.settingsIndexWithAddress)n=e.data.payload.additionalInfo.settingsIndexWithAddress;else {let r=await core.fetchUserAccountData(new core.Secp256r1Key(e.data.payload.signer),e.data.payload.userAddressTreeIndex,t);if(r.delegatedTo.__option==="None")throw Error("User has no delegated wallet");n=r.delegatedTo.value;}return n}async function $({transactionActionType:e,transactionAddress:t,transactionMessageBytes:n,signer:r,popUp:i,authOrigin:s,onClientAuthorizationCallback:o}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let a=window.origin,c=`${s}?redirectOrigin=${a}`,d={phase:"start",data:{type:"transaction",payload:{transactionActionType:e,transactionAddress:t,transactionMessageBytes:core.bufferToBase64URLString(n)}},redirectOrigin:a,signer:r},[u,{signature:I}]=await Promise.all([Promise.resolve(i??b(c)),o(d)]),A=await ae({authUrl:c,payload:d,signature:I,popUp:u});if(A.data.type!=="transaction")throw new Error("Expected Transaction Response");let{signature:_}=await o(A);return {...A.data.payload,clientSignature:{...A.data.payload.clientSignature,signature:_}}}async function hn(e){let t=await $e(e);return core.signAndSendTransaction(t)}var $e=async e=>{let{amount:t,destination:n,mint:r,payer:i,addressesByLookupTableAddress:s,tokenProgram:o=Ke,cachedAccounts:a=new Map,signer:c,authOrigin:d=C,popUp:u,onClientAuthorizationCallback:I,createAtaIfNeeded:A=true}=e,_=await $({transactionActionType:"transfer_intent",transactionAddress:r?o:re,transactionMessageBytes:new Uint8Array([...J().encode(t),...m().encode(n),...m().encode(r??re)]),signer:c,popUp:u,onClientAuthorizationCallback:I,authOrigin:d}),g;if(_.additionalInfo.settingsIndexWithAddress)g=_.additionalInfo.settingsIndexWithAddress;else {let je=await core.fetchUserAccountData(new core.Secp256r1Key(_.signer),_.userAddressTreeIndex,a);if(je.delegatedTo.__option==="None")throw Error("User has no delegated wallet");g=je.delegatedTo.value;}let[S,ue]=await Promise.all([core.fetchSettingsAccountData(g.index,g.settingsAddressTreeIndex,a),core.getSignedSecp256r1Key(_)]),{transactionManagerAddress:w,userAddressTreeIndex:B}=core.retrieveTransactionManager(_.signer,S),v=await core.getSignedTransactionManager({authResponses:[_],transactionManagerAddress:w,userAddressTreeIndex:B,cachedAccounts:a}),G=v?[ue,v]:[ue];return {instructions:r?await core.tokenTransferIntent({payer:i,index:g.index,settingsAddressTreeIndex:g.settingsAddressTreeIndex,createAtaIfNeeded:A,amount:t,signers:G,destination:n,mint:r,tokenProgram:o,compressed:S.isCompressed,cachedAccounts:a}):await core.nativeTransferIntent({payer:i,index:g.index,settingsAddressTreeIndex:g.settingsAddressTreeIndex,amount:t,signers:G,destination:n,compressed:S.isCompressed,cachedAccounts:a}),payer:i,addressesByLookupTableAddress:s}};var Un=async e=>{let t=b(),{addressesByLookupTableAddress:n,instructions:r,payer:i,onClientAuthorizationCallback:s,additionalSigners:o,signer:a,settingsIndexWithAddress:c,authOrigin:d=C,cachedAccounts:u=new Map}=e,[I,A,_]=await Promise.all([core.fetchSettingsAccountData(c.index,c.settingsAddressTreeIndex,u),core.getSettingsFromIndex(c.index),core.prepareTransactionMessage({payer:await core.getWalletAddressFromIndex(c.index),instructions:r,addressesByLookupTableAddress:n})]),{transactionManagerAddress:g,userAddressTreeIndex:S}=core.retrieveTransactionManager(a,I);if(await mn({signers:[On(),...o??[],...g?[_n(g)]:[]],compressed:I.isCompressed,payer:i,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,transactionMessageBytes:_,addressesByLookupTableAddress:n,cachedAccounts:u})){let[w,B]=await Promise.all([$({signer:a,transactionActionType:g?"execute":"create_with_preauthorized_execution",transactionAddress:A,transactionMessageBytes:new Uint8Array(_),popUp:t,onClientAuthorizationCallback:s,authOrigin:d}),Mn()]),[v,G]=await Promise.all([core.getSignedTransactionManager({authResponses:[w],transactionMessageBytes:_,transactionManagerAddress:g,userAddressTreeIndex:S}),core.getSignedSecp256r1Key(w)]);return await core.prepareTransactionBundle({compressed:I.isCompressed,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,transactionMessageBytes:_,creator:v??G,executor:v?G:void 0,jitoBundlesTipAmount:B,payer:i,additionalSigners:o,addressesByLookupTableAddress:n,cachedAccounts:u})}else {let w=await $({signer:a,transactionActionType:"sync",transactionAddress:A.toString(),transactionMessageBytes:new Uint8Array(_),popUp:t,onClientAuthorizationCallback:s,authOrigin:d}),[B,v]=await Promise.all([core.getSignedTransactionManager({authResponses:[w],transactionMessageBytes:new Uint8Array(_),transactionManagerAddress:g,userAddressTreeIndex:S}),core.getSignedSecp256r1Key(w)]);return [await core.prepareTransactionSync({compressed:I.isCompressed,signers:[v,...o??[],...B?[B]:[]],payer:i,transactionMessageBytes:_,index:c.index,settingsAddressTreeIndex:c.settingsAddressTreeIndex,addressesByLookupTableAddress:n,cachedAccounts:u})]}};async function bn({message:e,signer:t,popUp:n,authOrigin:r,onClientAuthorizationCallback:i}){if(typeof window>"u")throw new Error("Function can only be called in a browser environment");let s=window.origin,o=`${r}?redirectOrigin=${s}`,a={phase:"start",data:{type:"message",payload:e},redirectOrigin:s,signer:t},[c,{message:d,id:u,signature:I}]=await Promise.all([Promise.resolve(n??b(o)),i(a)]),A=await ae({authUrl:o,payload:{...a,data:{...a.data,payload:d}},signature:I,popUp:c});if(A.data.type!=="message")throw new Error("Expected Message Response");return await i({...A,data:{...A.data,payload:{...A.data.payload,id:u,message:d}}})}function wn(e,t,n){let r={};function i(d,...u){r[d]?.forEach(({fn:I,ctx:A})=>{I.apply(A,u);});}let s=window.localStorage.getItem("Revibase:account"),{publicKey:o,member:a,settingsIndexWithAddress:c}=s?JSON.parse(s):{publicKey:null,member:null,settingsIndexWithAddress:null};return {publicKey:o,member:a,settingsIndexWithAddress:c,connect:async function(){let d=se({domain:window.location.origin,nonce:crypto.randomUUID()}),{user:u}=await this.signMessage(d);if(!u)throw Error("Failed to verify signed message");this.publicKey=u.walletAddress,this.member=u.publicKey,this.settingsIndexWithAddress=u.settingsIndexWtihAddress,window.localStorage.setItem("Revibase:account",JSON.stringify({publicKey:this.publicKey,member:this.member,settingsIndexWithAddress:this.settingsIndexWithAddress},(I,A)=>typeof A=="bigint"?Number(A.toString()):A)),i("connect"),i("accountChanged");},disconnect:async function(){this.publicKey=null,this.member=null,this.settingsIndexWithAddress=null,window.localStorage.removeItem("Revibase:account"),i("disconnect");},signMessage:async function(d){return await bn({signer:this.member??void 0,onClientAuthorizationCallback:e,message:d,authOrigin:n??C})},buildTokenTransfer:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await oe(ie);return $e({signer:this.member,payer:u,onClientAuthorizationCallback:e,...d,authOrigin:n})},signAndSendTokenTransfer:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await oe(ie);return hn({signer:this.member,onClientAuthorizationCallback:e,payer:u,...d,authOrigin:n})},buildTransaction:async function(d){if(!this.member||!this.settingsIndexWithAddress||!this.publicKey)throw new Error("Wallet is not connected");let u=t??await oe(ie);return Un({signer:this.member,settingsIndexWithAddress:this.settingsIndexWithAddress,onClientAuthorizationCallback:e,payer:u,...d,authOrigin:n})},signAndSendTransaction:async function(d){let u=await this.buildTransaction(d);if(!u.length)throw new Error("Unable to build transaction");return u.length===1?core.signAndSendTransaction(u[0]):core.signAndSendBundledTransactions(u)},on:function(d,u,I){r[d]||(r[d]=[]),r[d].push({fn:u,ctx:I});},off:function(d,u,I){r[d]=r[d]?.filter(A=>A.fn!==u||A.ctx!==I);}}}var vn="data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjI1MDAgMjAwIDUwMDAgNTAwMCI+CiAgPH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DAwLTQ0LTVsLTgtMWExNDAwIDE0MDAgMCAwMC00Mi00aC0zdi0yNDAiLz4KICA8cGF0aCBkPSJNNDM1OSAyMjU1YTM0MCAzNDAgMCAxMCAzNDAgMzQwIDM0MCAzNDAgMCAwMC0zNDAtMzQwbTAgNTI0YTE4NCAxODQgMCAwMS0xODUtMTg0IDE4NCAxODQgMCAwMSAxODQtMTg0IDE4NCAxODQgMCAwMSAxODUgMTg0IDE4NCAxODQgMCAwMS0xODQgMTg0Ii8+Cjwvc3ZnPgo=";var ce=class extends core$1.ReadonlyWalletAccount{member;settingsIndexWithAddress;constructor(t,n,r){super(t),this.member=n,this.settingsIndexWithAddress=r;}};var de=class e{#n={};#a="1.0.0";#s="Revibase";#c=vn;#t=null;#e;get version(){return this.#a}get name(){return this.#s}get icon(){return this.#c}get chains(){return ["solana:mainnet","solana:devnet"]}get features(){return {"standard:connect":{version:"1.0.0",connect:this.#A},"standard:disconnect":{version:"1.0.0",disconnect:this.#_},"standard:events":{version:"1.0.0",on:this.#d},"revibase:SignAndSendTransaction":{version:"1.0.0",signAndSendTransaction:this.#T},"revibase:BuildTransaction":{version:"1.0.0",buildTransaction:this.#l},"revibase:SignAndSendTokenTransfer":{version:"1.0.0",signAndSendTokenTransfer:this.#E},"revibase:BuildTokenTransferTransaction":{version:"1.0.0",buildTokenTransferTransaction:this.#g},"revibase:SignMessage":{version:"1.0.0",signMessage:this.#R},"revibase:":{revibase:this.#e}}}get accounts(){return this.#t?[this.#t]:[]}constructor(t){new.target===e&&Object.freeze(this),this.#e=t,t.on("connect",this.#r,this),t.on("disconnect",this.#o,this),t.on("accountChanged",this.#I,this),this.#r();}#d=(t,n)=>(this.#n[t]?.push(n)||(this.#n[t]=[n]),()=>this.#u(t,n));#i(t,...n){this.#n[t]?.forEach(r=>r.apply(null,n));}#u(t,n){this.#n[t]=this.#n[t]?.filter(r=>n!==r);}#r=()=>{let t=this.#e.publicKey,n=this.#e.member,r=this.#e.settingsIndexWithAddress;if(t&&n&&r){let i=new Uint8Array(m().encode(k(t))),s=this.#t;(!s||s.address!==t.toString()||!core$1.bytesEqual(s.publicKey,i))&&(this.#t=new ce({address:t,publicKey:i,chains:this.chains,features:Object.keys(this.features)},n,r),this.#i("change",{accounts:this.accounts}));}};#o=()=>{this.#t&&(this.#t=null,this.#i("change",{accounts:this.accounts}));};#I=()=>{this.#t?this.#r():this.#o();};#A=async t=>(this.#t||await this.#e.connect(t),this.#r(),{accounts:this.accounts});#_=async()=>{await this.#e.disconnect();};#T=t=>this.#e.signAndSendTransaction(t);#l=t=>this.#e.buildTransaction(t);#E=t=>this.#e.signAndSendTokenTransfer(t);#g=t=>this.#e.buildTokenTransfer(t);#R=t=>this.#e.signMessage(t)};function Ay(e){core.initialize({rpcEndpoint:e.rpcEndpoint,proverEndpoint:e.proverEndpoint,compressionApiEndpoint:e.compressionApiEndpoint,jitoTipsConfig:e.jitoTipsConfig}),typeof window<"u"&&core$1.registerWallet(new de(wn(e.onClientAuthorizationCallback,e.feePayer,e.authOrigin)));}async function Pn(e,t=C,n=Cn){let{payload:r}=e.data,i=r.message,s=core.createMessageChallenge(i,r.clientSignature.clientOrigin,r.deviceSignature.publicKey,r.nonce),{verified:o}=await server.verifyAuthenticationResponse({response:r.authResponse,expectedChallenge:core.bufferToBase64URLString(s),expectedRPID:n,expectedOrigin:t,requireUserVerification:false,credential:{counter:0,id:r.authResponse.id,publicKey:core.convertPubkeyCompressedToCose(r.signer)}});if(!o)throw new Error("Unable to verify message");let a=await pn(e),c=await core.getWalletAddressFromIndex(a.index),u=(await core.fetchSettingsAccountData(a.index,a.settingsAddressTreeIndex)).members.some(A=>A.role===core.UserRole.TransactionManager);return {publicKey:r.signer,walletAddress:c,settingsIndexWithAddress:a,hasTxManager:u,...r.additionalInfo}}async function My(e,t,n,r){if(e.phase==="start"){let{data:o}=e,a=core.createClientAuthorizationStartRequestChallenge(e),c=x().decode(new Uint8Array(await crypto.subtle.sign({name:"Ed25519"},t,new Uint8Array(a))));if(o.type==="message"){let d=o.payload??se({domain:"your_website_name",nonce:crypto.randomUUID()});return {signature:c,message:d}}return {signature:c}}if(e.data.type==="message")return {user:await Pn({data:e.data},n,r)};let i=core.createClientAuthorizationCompleteRequestChallenge(e);return {signature:x().decode(new Uint8Array(await crypto.subtle.sign({name:"Ed25519"},t,new Uint8Array(i))))}}exports.RevibaseBuildTokenTransferTransaction=Pc;exports.RevibaseBuildTransaction=wc;exports.RevibaseSignAndSendTokenTransfer=vc;exports.RevibaseSignAndSendTransaction=bc;exports.RevibaseSignMessage=Fc;exports.createPopUp=b;exports.getRandomPayer=oe;exports.initializeWallet=Ay;exports.processClientAuthCallback=My;//# sourceMappingURL=index.cjs.map
|
|
9
9
|
//# sourceMappingURL=index.cjs.map
|