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