@privy-io/public-api
Advanced tools
Comparing version 2.18.5 to 2.18.6
@@ -1,1 +0,1 @@ | ||
"use strict";var e=require("zod"),t=require("@privy-io/api-base"),a=require("./api.js"),i=require("./core.js");require("bs58"),require("ethers"),require("libphonenumber-js/max");const o=e.z.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'");let n=e.z.object({address:i.SolanaWalletAddress.optional(),chain_type:e.z.literal("solana").optional()}),r=e.z.object({address:i.WalletAddress.optional(),chain_type:e.z.literal("ethereum").optional()});const s=e.z.enum(["root","manager"]).nullable(),l=e.z.object({method:e.z.literal("signTransaction"),params:e.z.object({transaction:e.z.string(),encoding:e.z.literal("base64")})}).merge(n),p=e.z.object({method:e.z.literal("signAndSendTransaction"),caip2:o,params:e.z.object({transaction:e.z.string(),encoding:e.z.literal("base64")})}).merge(n),z=e.z.object({method:e.z.literal("signMessage"),params:e.z.object({message:e.z.string(),encoding:e.z.literal("base64")})}).merge(n);let d=e.z.string().startsWith("0x"),c=e.z.union([d,e.z.number()]);const h=e.z.object({from:i.WalletAddress.optional(),to:i.WalletAddress.optional(),chain_id:c.optional(),nonce:c.optional(),data:d.optional(),value:c.optional(),type:e.z.union([e.z.literal(0),e.z.literal(1),e.z.literal(2)]).optional(),gas_limit:c.optional(),gas_price:c.optional(),max_fee_per_gas:c.optional(),max_priority_fee_per_gas:c.optional()}),g=e.z.object({method:e.z.literal("eth_signTransaction"),params:e.z.object({transaction:h})}).merge(r),u=e.z.object({method:e.z.literal("eth_sendTransaction"),caip2:o,params:e.z.object({transaction:h})}).merge(r),m=e.z.object({message:e.z.string(),encoding:e.z.union([e.z.literal("utf-8"),e.z.literal("hex")])}),_=e.z.object({method:e.z.literal("personal_sign"),params:m}).merge(r),b=e.z.object({method:e.z.literal("eth_signTypedData_v4"),params:e.z.object({typed_data:e.z.object({domain:e.z.record(e.z.string(),e.z.any()),types:e.z.record(e.z.string(),e.z.any()),message:e.z.record(e.z.string(),e.z.any()),primary_type:e.z.string()})})}).merge(r),y=e.z.discriminatedUnion("method",[g,u,_,b]),j=e.z.discriminatedUnion("method",[l,p,z]),A=e.z.union([y,j]),x=e.z.object({method:e.z.literal("signTransaction"),data:e.z.object({signed_transaction:e.z.string(),encoding:e.z.literal("base64")})}),I=e.z.object({method:e.z.literal("signAndSendTransaction"),data:e.z.object({hash:e.z.string(),caip2:o}).optional(),error:e.z.object({code:e.z.string(),message:e.z.string()}).optional()}),R=e.z.object({method:e.z.literal("signMessage"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("base64")})}),W=e.z.object({method:e.z.literal("eth_signTransaction"),data:e.z.object({signed_transaction:e.z.string(),encoding:e.z.literal("rlp")})}),S=e.z.object({method:e.z.literal("eth_sendTransaction"),data:e.z.object({hash:e.z.string(),caip2:o}).optional(),error:e.z.object({code:e.z.string(),message:e.z.string()}).optional()}),v=e.z.object({method:e.z.literal("personal_sign"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("hex")})}),T=e.z.object({method:e.z.literal("eth_signTypedData_v4"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("hex")})}),f=e.z.discriminatedUnion("method",[x,I,R,W,S,v,T]),E=e.z.object({display_name:e.z.string().optional(),public_key:e.z.string(),role:s.optional()});let k=e.z.union([e.z.literal("solana"),e.z.literal("ethereum")]);const D=e.z.object({id:e.z.string(),address:e.z.string(),created_at:e.z.number(),chain_type:k,policy_ids:e.z.array(e.z.string()),authorization_threshold:e.z.number().optional()}),P=e.z.object({chain_type:k,policy_ids:e.z.array(e.z.string()).max(1).optional(),authorization_key_ids:e.z.array(e.z.string()).optional(),authorization_threshold:e.z.number().optional()}).refine((e=>void 0===e.authorization_threshold||e.authorization_threshold>=1&&e.authorization_key_ids&&e.authorization_threshold<=e.authorization_key_ids.length),{message:"If specified, authorization_threshold must be an integer between 1 and the length of authorization_key_ids."}).catch((({error:e})=>{throw new t.InvalidInputError(e.message,t.PrivyErrorCode.INVALID_DATA)})),q=e.z.object({id:e.z.string(),chain_type:k,address:e.z.string(),authorization_threshold:e.z.number().optional()}),C=e.z.object({wallet_id:e.z.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new t.InvalidInputError(e.message,t.PrivyErrorCode.INVALID_DATA)})),w=e.z.object({id:e.z.string()}),K=e.z.object({id:e.z.string(),display_name:e.z.string().nullable(),public_key:e.z.string(),role:s,created_at:e.z.number()}),U=e.z.object({id:e.z.string(),display_name:e.z.string().nullable(),public_key:e.z.string(),created_at:e.z.number()}),M=a.Pagination.extend({chain_type:k.optional()}),L=e.z.object({policy_ids:e.z.array(e.z.string()).max(1,"Only one policy ID can be set").optional(),authorization_key_ids:e.z.array(e.z.string()).optional(),authorization_threshold:e.z.number().optional()}).strict().superRefine(((e,t)=>{Object.values(e).every((e=>null==e))&&t.addIssue({code:"custom",message:"At least one field must be provided"}),void 0!==e.authorization_threshold&&0!==e.authorization_threshold&&(e.authorization_threshold<0&&t.addIssue({code:"custom",path:["authorization_threshold"],message:"`authorization_threshold` must be non-negative if specified."}),void 0===e.authorization_key_ids&&t.addIssue({code:"custom",path:["authorization_key_ids"],message:"An array of `authorization_key_ids` must be provided for a non-zero `authorization_threshold`."}),e.authorization_key_ids&&e.authorization_threshold>e.authorization_key_ids.length&&t.addIssue({code:"custom",path:["authorization_threshold"],message:"`authorization_threshold` must be non-negative if specified."}))}));exports.AuthorizationKeyDashboardResponse=K,exports.AuthorizationKeyResponse=U,exports.AuthorizationKeyRole=s,exports.CAIP2=o,exports.UnsignedEthereumTransaction=h,exports.WalletApiCreateInput=P,exports.WalletApiCreateResponse=q,exports.WalletApiEthereumPersonalSignRpcInput=_,exports.WalletApiEthereumPersonalSignRpcInputParams=m,exports.WalletApiEthereumPersonalSignRpcResponse=v,exports.WalletApiEthereumRpcInput=y,exports.WalletApiEthereumSendTransactionRpcInput=u,exports.WalletApiEthereumSendTransactionRpcResponse=S,exports.WalletApiEthereumSignTransactionRpcInput=g,exports.WalletApiEthereumSignTransactionRpcResponse=W,exports.WalletApiEthereumSignTypedDataRpcInput=b,exports.WalletApiEthereumSignTypedDataRpcResponse=T,exports.WalletApiRegisterAuthorizationKeyInput=E,exports.WalletApiRevokeAuthorizationKeyInput=w,exports.WalletApiRpcInput=A,exports.WalletApiRpcResponse=f,exports.WalletApiSolanaRpcInput=j,exports.WalletApiSolanaSignAndSendTransactionRpcInput=p,exports.WalletApiSolanaSignAndSendTransactionRpcResponse=I,exports.WalletApiSolanaSignMessageRpcInput=z,exports.WalletApiSolanaSignMessageRpcResponse=R,exports.WalletApiSolanaSignTransactionRpcInput=l,exports.WalletApiSolanaSignTransactionRpcResponse=x,exports.WalletIdFromPath=C,exports.WalletResponse=D,exports.WalletUpdateInput=L,exports.WalletsSearchInput=M; | ||
"use strict";var e=require("zod"),t=require("@privy-io/api-base"),a=require("./api.js"),i=require("./core.js");require("bs58"),require("ethers"),require("libphonenumber-js/max");const o=e.z.string().regex(/^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}$/,"Chain ID must be a valid CAIP-2 chain ID, e.g. 'eip155:1'");let n=e.z.object({address:i.SolanaWalletAddress.optional(),chain_type:e.z.literal("solana").optional()}),r=e.z.object({address:i.WalletAddress.optional(),chain_type:e.z.literal("ethereum").optional()});const s=e.z.enum(["root","manager","delegated-actions"]).nullable(),l=e.z.object({method:e.z.literal("signTransaction"),params:e.z.object({transaction:e.z.string(),encoding:e.z.literal("base64")})}).merge(n),p=e.z.object({method:e.z.literal("signAndSendTransaction"),caip2:o,params:e.z.object({transaction:e.z.string(),encoding:e.z.literal("base64")})}).merge(n),z=e.z.object({method:e.z.literal("signMessage"),params:e.z.object({message:e.z.string(),encoding:e.z.literal("base64")})}).merge(n);let d=e.z.string().startsWith("0x"),c=e.z.union([d,e.z.number()]);const h=e.z.object({from:i.WalletAddress.optional(),to:i.WalletAddress.optional(),chain_id:c.optional(),nonce:c.optional(),data:d.optional(),value:c.optional(),type:e.z.union([e.z.literal(0),e.z.literal(1),e.z.literal(2)]).optional(),gas_limit:c.optional(),gas_price:c.optional(),max_fee_per_gas:c.optional(),max_priority_fee_per_gas:c.optional()}),g=e.z.object({method:e.z.literal("eth_signTransaction"),params:e.z.object({transaction:h})}).merge(r),u=e.z.object({method:e.z.literal("eth_sendTransaction"),caip2:o,params:e.z.object({transaction:h})}).merge(r),m=e.z.object({message:e.z.string(),encoding:e.z.union([e.z.literal("utf-8"),e.z.literal("hex")])}),_=e.z.object({method:e.z.literal("personal_sign"),params:m}).merge(r),b=e.z.object({method:e.z.literal("eth_signTypedData_v4"),params:e.z.object({typed_data:e.z.object({domain:e.z.record(e.z.string(),e.z.any()),types:e.z.record(e.z.string(),e.z.any()),message:e.z.record(e.z.string(),e.z.any()),primary_type:e.z.string()})})}).merge(r),y=e.z.discriminatedUnion("method",[g,u,_,b]),j=e.z.discriminatedUnion("method",[l,p,z]),A=e.z.union([y,j]),x=e.z.object({method:e.z.literal("signTransaction"),data:e.z.object({signed_transaction:e.z.string(),encoding:e.z.literal("base64")})}),I=e.z.object({method:e.z.literal("signAndSendTransaction"),data:e.z.object({hash:e.z.string(),caip2:o}).optional(),error:e.z.object({code:e.z.string(),message:e.z.string()}).optional()}),R=e.z.object({method:e.z.literal("signMessage"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("base64")})}),W=e.z.object({method:e.z.literal("eth_signTransaction"),data:e.z.object({signed_transaction:e.z.string(),encoding:e.z.literal("rlp")})}),S=e.z.object({method:e.z.literal("eth_sendTransaction"),data:e.z.object({hash:e.z.string(),caip2:o}).optional(),error:e.z.object({code:e.z.string(),message:e.z.string()}).optional()}),v=e.z.object({method:e.z.literal("personal_sign"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("hex")})}),T=e.z.object({method:e.z.literal("eth_signTypedData_v4"),data:e.z.object({signature:e.z.string(),encoding:e.z.literal("hex")})}),f=e.z.discriminatedUnion("method",[x,I,R,W,S,v,T]),E=e.z.object({display_name:e.z.string().optional(),public_key:e.z.string(),role:s.optional()});let k=e.z.union([e.z.literal("solana"),e.z.literal("ethereum")]);const D=e.z.object({id:e.z.string(),address:e.z.string(),created_at:e.z.number(),chain_type:k,policy_ids:e.z.array(e.z.string()),authorization_threshold:e.z.number().optional()}),P=e.z.object({chain_type:k,policy_ids:e.z.array(e.z.string()).max(1).optional(),authorization_key_ids:e.z.array(e.z.string()).optional(),authorization_threshold:e.z.number().optional()}).refine((e=>void 0===e.authorization_threshold||e.authorization_threshold>=1&&e.authorization_key_ids&&e.authorization_threshold<=e.authorization_key_ids.length),{message:"If specified, authorization_threshold must be an integer between 1 and the length of authorization_key_ids."}).catch((({error:e})=>{throw new t.InvalidInputError(e.message,t.PrivyErrorCode.INVALID_DATA)})),q=e.z.object({id:e.z.string(),chain_type:k,address:e.z.string(),authorization_threshold:e.z.number().optional()}),C=e.z.object({wallet_id:e.z.string({required_error:"Wallet ID must be provided",invalid_type_error:"Wallet ID is not a valid string"}).min(1)}).catch((({error:e})=>{throw new t.InvalidInputError(e.message,t.PrivyErrorCode.INVALID_DATA)})),w=e.z.object({id:e.z.string()}),K=e.z.object({id:e.z.string(),display_name:e.z.string().nullable(),public_key:e.z.string(),role:s,created_at:e.z.number()}),U=e.z.object({id:e.z.string(),display_name:e.z.string().nullable(),public_key:e.z.string(),created_at:e.z.number()}),M=a.Pagination.extend({chain_type:k.optional()}),L=e.z.object({policy_ids:e.z.array(e.z.string()).max(1,"Only one policy ID can be set").optional(),authorization_key_ids:e.z.array(e.z.string()).optional(),authorization_threshold:e.z.number().optional()}).strict().superRefine(((e,t)=>{Object.values(e).every((e=>null==e))&&t.addIssue({code:"custom",message:"At least one field must be provided"}),void 0!==e.authorization_threshold&&0!==e.authorization_threshold&&(e.authorization_threshold<0&&t.addIssue({code:"custom",path:["authorization_threshold"],message:"`authorization_threshold` must be non-negative if specified."}),void 0===e.authorization_key_ids&&t.addIssue({code:"custom",path:["authorization_key_ids"],message:"An array of `authorization_key_ids` must be provided for a non-zero `authorization_threshold`."}),e.authorization_key_ids&&e.authorization_threshold>e.authorization_key_ids.length&&t.addIssue({code:"custom",path:["authorization_threshold"],message:"`authorization_threshold` must be non-negative if specified."}))}));exports.AuthorizationKeyDashboardResponse=K,exports.AuthorizationKeyResponse=U,exports.AuthorizationKeyRole=s,exports.CAIP2=o,exports.UnsignedEthereumTransaction=h,exports.WalletApiCreateInput=P,exports.WalletApiCreateResponse=q,exports.WalletApiEthereumPersonalSignRpcInput=_,exports.WalletApiEthereumPersonalSignRpcInputParams=m,exports.WalletApiEthereumPersonalSignRpcResponse=v,exports.WalletApiEthereumRpcInput=y,exports.WalletApiEthereumSendTransactionRpcInput=u,exports.WalletApiEthereumSendTransactionRpcResponse=S,exports.WalletApiEthereumSignTransactionRpcInput=g,exports.WalletApiEthereumSignTransactionRpcResponse=W,exports.WalletApiEthereumSignTypedDataRpcInput=b,exports.WalletApiEthereumSignTypedDataRpcResponse=T,exports.WalletApiRegisterAuthorizationKeyInput=E,exports.WalletApiRevokeAuthorizationKeyInput=w,exports.WalletApiRpcInput=A,exports.WalletApiRpcResponse=f,exports.WalletApiSolanaRpcInput=j,exports.WalletApiSolanaSignAndSendTransactionRpcInput=p,exports.WalletApiSolanaSignAndSendTransactionRpcResponse=I,exports.WalletApiSolanaSignMessageRpcInput=z,exports.WalletApiSolanaSignMessageRpcResponse=R,exports.WalletApiSolanaSignTransactionRpcInput=l,exports.WalletApiSolanaSignTransactionRpcResponse=x,exports.WalletIdFromPath=C,exports.WalletResponse=D,exports.WalletUpdateInput=L,exports.WalletsSearchInput=M; |
{ | ||
"name": "@privy-io/public-api", | ||
"version": "2.18.5", | ||
"version": "2.18.6", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "exports": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
1610033