@domino-sdk/relay 1.67.0 → 1.68.0
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/CHANGELOG.md +43 -0
- package/dist/{accounts-C2O8mpB8.d.ts → accounts-DnpKoJCo.d.ts} +210 -3
- package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-DMNFMYFb.d.ts} +9 -1
- package/dist/authoring.d.ts +349 -38
- package/dist/authoring.js +125 -18
- package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-CQ3vpiQl.d.ts} +2 -2
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +10 -9
- package/dist/browser.js +12 -13
- package/dist/{catalog-CbiftcxQ.d.ts → catalog-BLGie8Lh.d.ts} +60 -2
- package/dist/chunk-4JSPMFO2.js +427 -0
- package/dist/{chunk-5DZNMLDM.js → chunk-55WJVFWC.js} +2 -2
- package/dist/{chunk-Q5QVAF7R.js → chunk-5AKD4ZF3.js} +37 -25
- package/dist/{chunk-DSJ46QLB.js → chunk-6UBFSMCM.js} +1 -1
- package/dist/{chunk-P33ZAJMS.js → chunk-6YTSRWRB.js} +1199 -677
- package/dist/{chunk-RDUSFUXX.js → chunk-75KF633N.js} +9 -1
- package/dist/{chunk-Q6KTTVOI.js → chunk-7YSVZA7A.js} +1 -1
- package/dist/{chunk-BMJHFWVT.js → chunk-CZ7NQ7W7.js} +10 -43
- package/dist/{chunk-X3FMVRMM.js → chunk-DDJN2T5A.js} +1 -1
- package/dist/{chunk-KUNPCDN6.js → chunk-DNPDR4Z7.js} +16 -9
- package/dist/{chunk-RWR2LOPA.js → chunk-EXZVWQOQ.js} +2 -2
- package/dist/{chunk-MVQQDPQX.js → chunk-HXTKI34N.js} +14 -2
- package/dist/{chunk-FGXLXENM.js → chunk-IW46TW3A.js} +21 -1
- package/dist/{chunk-5SBA6X5X.js → chunk-KKHENO57.js} +2 -2
- package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
- package/dist/{chunk-QYC3CZVD.js → chunk-MEUAJIVO.js} +2 -2
- package/dist/{chunk-BQXRCJ3N.js → chunk-P4TPW4SY.js} +1 -1
- package/dist/{chunk-NRMQVK2W.js → chunk-R3MNZKNJ.js} +1 -1
- package/dist/{chunk-Z2Z5DBNW.js → chunk-SD74HD75.js} +45 -9
- package/dist/{chunk-JK3XV2CR.js → chunk-TYZFVL73.js} +50 -8
- package/dist/chunk-VAGGGB6B.js +87 -0
- package/dist/{chunk-2HHZV7U3.js → chunk-VRZZB7CQ.js} +1 -1
- package/dist/{client-CZPewB9h.d.ts → client-BMif22WQ.d.ts} +133 -7
- package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DMk-vL1q.d.ts} +4 -4
- package/dist/{deployments-BVFd7ddA.d.ts → deployments-BCr418BX.d.ts} +582 -173
- package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-r76xaAax.d.ts} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +137 -14
- package/dist/internal.js +240 -19
- package/dist/{limits-C4RzrOV4.d.ts → limits-ByVRQePO.d.ts} +6 -1
- package/dist/{offers-BpYenB9i.d.ts → offers-xcPbYaEv.d.ts} +2 -2
- package/dist/portal-proxy.d.ts +2 -2
- package/dist/portal-proxy.js +11 -11
- package/dist/react/index.d.ts +37 -15
- package/dist/react/index.js +12 -13
- package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-0VvT6LMj.d.ts} +1 -1
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/2UDZ6TPL.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +398 -104
- package/dist/schema.js +62 -8
- package/dist/server/index.d.ts +12 -12
- package/dist/server/index.js +2046 -886
- package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C5_753DZ.d.ts} +2 -2
- package/dist/solana.d.ts +171 -0
- package/dist/solana.js +364 -0
- package/dist/{submission-input-C152xIdn.d.ts → submission-input-CaL8drIh.d.ts} +2 -2
- package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-DLtHPRBI.d.ts} +6 -108
- package/dist/telegram.d.ts +8 -8
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +85 -13
- package/dist/testing.js +101 -11
- package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-CAK942sx.d.ts} +298 -1
- package/dist/{transport-CthYgZXK.d.ts → transport-CkidqTOk.d.ts} +5250 -1226
- package/dist/{wallet-Btng186v.d.ts → wallet-DQtJelQQ.d.ts} +367 -13
- package/dist/wallet-browser-dpmr22Xv.d.ts +106 -0
- package/package.json +16 -1
- package/dist/chunk-UWUS4OOV.js +0 -59
- package/dist/chunk-UYVJZR33.js +0 -34
- package/dist/runtime/chunks/C2MGLQXC.js +0 -1
|
@@ -32,6 +32,59 @@ declare const profileDefaultsSchema: z.ZodArray<z.ZodEnum<{
|
|
|
32
32
|
x: "x";
|
|
33
33
|
}>>;
|
|
34
34
|
type ProfileDefaults = z.infer<typeof profileDefaultsSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* The sources a project can list as profile defaults: the `profileDefaultProviderSchema` accounts,
|
|
37
|
+
* and `sol`, the primary `.sol` name of a Solana wallet the member linked. A `.sol` name supplies a
|
|
38
|
+
* name only, never a picture. Settings answer the full list in `defaultSources`.
|
|
39
|
+
*
|
|
40
|
+
* @experimental A minor release can change `.sol` names.
|
|
41
|
+
*/
|
|
42
|
+
declare const knownProfileDefaultSources: readonly ["x", "discord", "sol"];
|
|
43
|
+
/**
|
|
44
|
+
* A default source this SDK knows.
|
|
45
|
+
*
|
|
46
|
+
* @compat open
|
|
47
|
+
* @experimental A minor release can change `.sol` names.
|
|
48
|
+
*/
|
|
49
|
+
type KnownProfileDefaultSource = (typeof knownProfileDefaultSources)[number];
|
|
50
|
+
/**
|
|
51
|
+
* A profile default source: one of `knownProfileDefaultSources`, or one a later Relay adds.
|
|
52
|
+
*
|
|
53
|
+
* @experimental A minor release can change `.sol` names.
|
|
54
|
+
*/
|
|
55
|
+
type ProfileDefaultSource = KnownProfileDefaultSource | (string & {});
|
|
56
|
+
/**
|
|
57
|
+
* The default sources a settings change can list, in order, each once.
|
|
58
|
+
*
|
|
59
|
+
* @experimental A minor release can change `.sol` names.
|
|
60
|
+
*/
|
|
61
|
+
declare const profileDefaultSourcesSchema: z.ZodArray<z.ZodEnum<{
|
|
62
|
+
discord: "discord";
|
|
63
|
+
x: "x";
|
|
64
|
+
sol: "sol";
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* Where a member's chosen name comes from instead of a name they typed: `sol` follows the primary
|
|
68
|
+
* `.sol` name of a Solana wallet they linked.
|
|
69
|
+
*
|
|
70
|
+
* @experimental A minor release can change `.sol` names.
|
|
71
|
+
*/
|
|
72
|
+
declare const profileNameSourceSchema: z.ZodEnum<{
|
|
73
|
+
sol: "sol";
|
|
74
|
+
}>;
|
|
75
|
+
/**
|
|
76
|
+
* A name source this SDK knows.
|
|
77
|
+
*
|
|
78
|
+
* @compat open
|
|
79
|
+
* @experimental A minor release can change `.sol` names.
|
|
80
|
+
*/
|
|
81
|
+
type KnownProfileNameSource = z.infer<typeof profileNameSourceSchema>;
|
|
82
|
+
/**
|
|
83
|
+
* A profile name source, or one a later Relay adds.
|
|
84
|
+
*
|
|
85
|
+
* @experimental A minor release can change `.sol` names.
|
|
86
|
+
*/
|
|
87
|
+
type ProfileNameSource = KnownProfileNameSource | (string & {});
|
|
35
88
|
/**
|
|
36
89
|
* The seed of a generated avatar (`defaultAvatar`), the same one `relay.me.get()` returns: an HMAC
|
|
37
90
|
* of the member under the project's secret, so it reveals nothing about the member.
|
|
@@ -91,10 +144,15 @@ declare const displayNameSchema: z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform
|
|
|
91
144
|
/**
|
|
92
145
|
* A change to the member's own profile; omitted fields stay. `displayName: null` and
|
|
93
146
|
* `avatar: null` return to the project's defaults (null also removes an uploaded picture).
|
|
94
|
-
*
|
|
147
|
+
* `nameSource: "sol"` shows the member's `.sol` name (one of `nameOptions`) and keeps following
|
|
148
|
+
* it; a `displayName`, or `nameSource: null`, stops following it. Upload a picture with
|
|
149
|
+
* `relay.profiles.uploadAvatar`.
|
|
95
150
|
*/
|
|
96
151
|
declare const profileUpdateSchema: z.ZodObject<{
|
|
97
152
|
displayName: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, z.ZodString>>>;
|
|
153
|
+
nameSource: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
154
|
+
sol: "sol";
|
|
155
|
+
}>>>;
|
|
98
156
|
avatar: z.ZodOptional<z.ZodNullable<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
99
157
|
source: z.ZodLiteral<"account">;
|
|
100
158
|
provider: z.ZodEnum<{
|
|
@@ -158,6 +216,11 @@ declare const ownProfileSchema: z.ZodObject<{
|
|
|
158
216
|
givenName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
|
|
159
217
|
imageUrl: z.ZodNullable<z.ZodString>;
|
|
160
218
|
}, z.core.$strip>>;
|
|
219
|
+
nameSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
220
|
+
nameOptions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
221
|
+
source: z.ZodString;
|
|
222
|
+
name: z.ZodString;
|
|
223
|
+
}, z.core.$strip>>>;
|
|
161
224
|
}, z.core.$strip>;
|
|
162
225
|
/** @compat output */
|
|
163
226
|
type OwnProfile = z.infer<typeof ownProfileSchema>;
|
|
@@ -216,6 +279,7 @@ declare const profileSettingsSchema: z.ZodObject<{
|
|
|
216
279
|
discord: "discord";
|
|
217
280
|
x: "x";
|
|
218
281
|
}>>;
|
|
282
|
+
defaultSources: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
219
283
|
revision: z.ZodNumber;
|
|
220
284
|
actor: z.ZodNullable<z.ZodString>;
|
|
221
285
|
updatedAt: z.ZodNullable<z.ZodNumber>;
|
|
@@ -231,6 +295,11 @@ declare const profileSettingsInputSchema: z.ZodObject<{
|
|
|
231
295
|
discord: "discord";
|
|
232
296
|
x: "x";
|
|
233
297
|
}>>;
|
|
298
|
+
defaultSources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
299
|
+
discord: "discord";
|
|
300
|
+
x: "x";
|
|
301
|
+
sol: "sol";
|
|
302
|
+
}>>>;
|
|
234
303
|
actionId: z.ZodString;
|
|
235
304
|
expectedRevision: z.ZodNumber;
|
|
236
305
|
reason: z.ZodString;
|
|
@@ -274,6 +343,7 @@ declare const managedProfileSchema: z.ZodObject<{
|
|
|
274
343
|
source: z.ZodLiteral<"generated">;
|
|
275
344
|
seed: z.ZodString;
|
|
276
345
|
}, z.core.$strip>], "source">;
|
|
346
|
+
nameSource: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
277
347
|
avatarChoice: z.ZodEnum<{
|
|
278
348
|
default: "default";
|
|
279
349
|
account: "account";
|
|
@@ -390,6 +460,51 @@ type EvmChainId = `eip155:${number}`;
|
|
|
390
460
|
declare function isEvmChainId(value: string): value is EvmChainId;
|
|
391
461
|
/** {@link isEvmChainId} as a schema. */
|
|
392
462
|
declare const evmChainIdSchema: z.ZodCustom<`eip155:${number}`, `eip155:${number}`>;
|
|
463
|
+
/** The SPL Memo program (v2), whose instruction fails unless every account it lists signed. */
|
|
464
|
+
declare const solanaMemoProgram = "MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr";
|
|
465
|
+
/** A Solana transaction signature: base58, 64 bytes. */
|
|
466
|
+
declare const solanaSignatureSchema: z.ZodString;
|
|
467
|
+
/**
|
|
468
|
+
* What a Solana account that cannot sign messages, such as a Squads vault, puts on chain to prove
|
|
469
|
+
* it is the member's: a transaction it executes with an SPL Memo instruction carrying `memo` and
|
|
470
|
+
* listing the account. Not strict: newer servers may add fields.
|
|
471
|
+
*
|
|
472
|
+
* @experimental A minor release can change linking by transaction.
|
|
473
|
+
*/
|
|
474
|
+
declare const walletTransactionChallengeSchema: z.ZodObject<{
|
|
475
|
+
id: z.ZodString;
|
|
476
|
+
chain: z.ZodEnum<{
|
|
477
|
+
solana: "solana";
|
|
478
|
+
eip155: "eip155";
|
|
479
|
+
cosmos: "cosmos";
|
|
480
|
+
}>;
|
|
481
|
+
address: z.ZodString;
|
|
482
|
+
memo: z.ZodString;
|
|
483
|
+
memoProgram: z.ZodString;
|
|
484
|
+
expiresAt: z.ZodNumber;
|
|
485
|
+
}, z.core.$strip>;
|
|
486
|
+
/** @experimental */
|
|
487
|
+
type WalletTransactionChallenge = z.infer<typeof walletTransactionChallengeSchema>;
|
|
488
|
+
/**
|
|
489
|
+
* The transaction that carries a challenge's memo, for the account it proves.
|
|
490
|
+
*
|
|
491
|
+
* @experimental A minor release can change linking by transaction.
|
|
492
|
+
*/
|
|
493
|
+
declare const walletTransactionProofSchema: z.ZodObject<{
|
|
494
|
+
chain: z.ZodLiteral<"solana">;
|
|
495
|
+
address: z.ZodString;
|
|
496
|
+
signature: z.ZodString;
|
|
497
|
+
}, z.core.$strict>;
|
|
498
|
+
/** @experimental */
|
|
499
|
+
type WalletTransactionProof = z.infer<typeof walletTransactionProofSchema>;
|
|
500
|
+
/**
|
|
501
|
+
* How a wallet proved it is the member's, when not by signing a message.
|
|
502
|
+
*
|
|
503
|
+
* @compat open
|
|
504
|
+
*/
|
|
505
|
+
type KnownWalletProofKind = "transaction";
|
|
506
|
+
/** A known proof kind, or one a newer Relay sends. */
|
|
507
|
+
type WalletProofKind = KnownWalletProofKind | (string & {});
|
|
393
508
|
declare const linkedWalletSchema: z.ZodObject<{
|
|
394
509
|
chain: z.ZodEnum<{
|
|
395
510
|
solana: "solana";
|
|
@@ -399,6 +514,8 @@ declare const linkedWalletSchema: z.ZodObject<{
|
|
|
399
514
|
network: z.ZodNullable<z.ZodCustom<`cosmos:${string}`, `cosmos:${string}`>>;
|
|
400
515
|
address: z.ZodString;
|
|
401
516
|
provedOn: z.ZodOptional<z.ZodCustom<`eip155:${number}`, `eip155:${number}`>>;
|
|
517
|
+
provedBy: z.ZodOptional<z.ZodType<WalletProofKind, unknown, z.core.$ZodTypeInternals<WalletProofKind, unknown>>>;
|
|
518
|
+
proofTransaction: z.ZodOptional<z.ZodString>;
|
|
402
519
|
verifiedAt: z.ZodNumber;
|
|
403
520
|
revision: z.ZodNumber;
|
|
404
521
|
signIn: z.ZodBoolean;
|
|
@@ -551,19 +668,67 @@ declare const walletBalanceSampleSchema: z.ZodObject<{
|
|
|
551
668
|
type WalletBalanceSample = z.infer<typeof walletBalanceSampleSchema>;
|
|
552
669
|
/** What `wallet.balances()` samples: a `ctx.wallet.balance()` query without an address. */
|
|
553
670
|
type WalletBalanceSourceQuery = WalletBalanceQuery extends infer Query ? Query extends unknown ? Omit<Query, "address"> : never : never;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* One finalized, successful Solana transaction of a member's linked wallet that called the
|
|
674
|
+
* tracker's program, as Relay recorded it for a `wallet.programActivity()` tracker: the record's
|
|
675
|
+
* `data`. The record's ID is the signature, its author the wallet's CAIP-10 account on the
|
|
676
|
+
* tracker's cluster, and its `occurredAt` the block time.
|
|
677
|
+
*
|
|
678
|
+
* @compat output
|
|
679
|
+
*/
|
|
680
|
+
declare const walletProgramActivitySchema: z.ZodObject<{
|
|
681
|
+
signature: z.ZodString;
|
|
682
|
+
slot: z.ZodString;
|
|
683
|
+
timestamp: z.ZodNumber;
|
|
684
|
+
signer: z.ZodBoolean;
|
|
685
|
+
instruction: z.ZodNullable<z.ZodString>;
|
|
686
|
+
amount: z.ZodNullable<z.ZodString>;
|
|
687
|
+
delta: z.ZodNullable<z.ZodString>;
|
|
688
|
+
}, z.core.$strip>;
|
|
689
|
+
/** One transaction a `wallet.programActivity()` tracker recorded: its records' `data`. */
|
|
690
|
+
type WalletProgramActivity = z.infer<typeof walletProgramActivitySchema>;
|
|
691
|
+
/** What `wallet.programActivity()` records. */
|
|
692
|
+
type WalletProgramActivitySourceQuery = {
|
|
693
|
+
/**
|
|
694
|
+
* The cluster: `"solana"` or {@link solanaMainnet} for mainnet (the default), {@link solanaDevnet}
|
|
695
|
+
* for devnet.
|
|
696
|
+
*/
|
|
697
|
+
chain?: "solana" | SolanaNetwork;
|
|
698
|
+
/** The program's address (base58). */
|
|
699
|
+
program: string;
|
|
700
|
+
/**
|
|
701
|
+
* Count only transactions that call this instruction of the program, by the name its IDL
|
|
702
|
+
* gives it. The program must publish an IDL Relay can read, as for `settings.solanaProgram()`.
|
|
703
|
+
*/
|
|
704
|
+
instruction?: string;
|
|
705
|
+
/** Count only transactions that change the wallet's balance of this SPL mint (base58). */
|
|
706
|
+
mint?: string;
|
|
707
|
+
/**
|
|
708
|
+
* With `mint`: count only transactions that move at least this many base units of it in or out of
|
|
709
|
+
* the wallet, as a decimal integer string.
|
|
710
|
+
*/
|
|
711
|
+
minAmount?: string;
|
|
712
|
+
/**
|
|
713
|
+
* `"wallet"` (the default) counts only transactions the wallet signed. `"any"` also counts ones
|
|
714
|
+
* someone else signed that name the wallet, such as a transfer into it.
|
|
715
|
+
*/
|
|
716
|
+
signer?: "wallet" | "any";
|
|
717
|
+
};
|
|
554
718
|
/**
|
|
555
719
|
* An NFT standard `ctx.wallet.nfts()` reads: an ERC-721 or ERC-1155 contract on an EVM chain, or a
|
|
556
|
-
* Metaplex
|
|
720
|
+
* Metaplex collection on Solana mainnet or devnet: a Core collection or a Token Metadata verified
|
|
721
|
+
* collection.
|
|
557
722
|
*/
|
|
558
723
|
type NftStandard = "erc721" | "erc1155" | "metaplex";
|
|
559
724
|
/**
|
|
560
725
|
* An NFT collection as a CAIP-19 asset type. On an EVM chain: the chain, the contract's standard
|
|
561
726
|
* and its address, such as `"eip155:1/erc721:0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D"`; an
|
|
562
727
|
* ERC-1155 collection names one token ID after the contract: `"eip155:8453/erc1155:0x…/1"`. On
|
|
563
|
-
* Solana: the cluster and the Metaplex collection
|
|
564
|
-
* `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<
|
|
565
|
-
* `"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<
|
|
566
|
-
* whose metadata names
|
|
728
|
+
* Solana: the cluster and the address of a Metaplex Core collection or of a Token Metadata
|
|
729
|
+
* collection NFT's mint, such as `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<address>"` on
|
|
730
|
+
* mainnet or `"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<address>"` on devnet, which stands for
|
|
731
|
+
* every Core asset in that collection and every NFT whose metadata names it as verified.
|
|
567
732
|
*/
|
|
568
733
|
type NftCollection = `${EvmChainId}/erc721:0x${string}` | `${EvmChainId}/erc1155:0x${string}/${string}` | `${SolanaNetwork}/nft:${string}`;
|
|
569
734
|
/** The parts of an NFT collection ({@link parseNftCollection}). */
|
|
@@ -575,7 +740,7 @@ type NftCollectionParts = {
|
|
|
575
740
|
} | {
|
|
576
741
|
chain: SolanaNetwork;
|
|
577
742
|
standard: "metaplex";
|
|
578
|
-
/** The
|
|
743
|
+
/** The Core collection's address or the collection NFT's mint (base58). */
|
|
579
744
|
mint: string;
|
|
580
745
|
};
|
|
581
746
|
/**
|
|
@@ -618,6 +783,22 @@ declare const walletNftsSchema: z.ZodObject<{
|
|
|
618
783
|
observedAt: z.ZodNumber;
|
|
619
784
|
}, z.core.$strict>;
|
|
620
785
|
type WalletNfts = z.infer<typeof walletNftsSchema>;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* One wallet's holding as Relay sampled it for a `wallet.nfts()` tracker, the record's `data`. The
|
|
789
|
+
* record's ID and author are the wallet's CAIP-10 account on the collection's chain, and its
|
|
790
|
+
* `occurredAt` is when Relay sampled it.
|
|
791
|
+
*
|
|
792
|
+
* @compat output
|
|
793
|
+
*/
|
|
794
|
+
declare const walletNftSampleSchema: z.ZodObject<{
|
|
795
|
+
count: z.ZodString;
|
|
796
|
+
block: z.ZodString;
|
|
797
|
+
}, z.core.$strip>;
|
|
798
|
+
/** One wallet's sampled NFT holding, the `data` of a `wallet.nfts()` tracker's record. */
|
|
799
|
+
type WalletNftSample = z.infer<typeof walletNftSampleSchema>;
|
|
800
|
+
/** What `wallet.nfts()` samples: a `ctx.wallet.nfts()` query without an address. */
|
|
801
|
+
type WalletNftSourceQuery = Omit<WalletNftsQuery, "address">;
|
|
621
802
|
/** The ABI types a contract call's single return value may have. */
|
|
622
803
|
type ContractCallReturnType = `uint${number}` | `int${number}` | "bool" | "address";
|
|
623
804
|
/** A view or pure function's signature, parsed ({@link parseContractFunction}). */
|
|
@@ -853,7 +1034,7 @@ type SolanaProgram = string;
|
|
|
853
1034
|
*/
|
|
854
1035
|
declare function isSolanaProgram(value: string): value is SolanaProgram;
|
|
855
1036
|
/**
|
|
856
|
-
* A Solana program's Anchor
|
|
1037
|
+
* A Solana program's IDL as JSON: Anchor (legacy or 0.30+), Codama or Shank. Relay checks its instructions when it is
|
|
857
1038
|
* pasted or fetched.
|
|
858
1039
|
*/
|
|
859
1040
|
declare const anchorIdlSchema: z.ZodRecord<z.ZodString, z.ZodJSONSchema>;
|
|
@@ -863,7 +1044,7 @@ type KnownSolanaIdlSource = "chain" | "pasted";
|
|
|
863
1044
|
/** A known IDL source, or one a newer Relay sends. */
|
|
864
1045
|
type SolanaIdlSource = KnownSolanaIdlSource | (string & {});
|
|
865
1046
|
/**
|
|
866
|
-
* The
|
|
1047
|
+
* The IDL a `settings.solanaProgram()` setting decodes instructions with: fetched from the
|
|
867
1048
|
* program's on-chain IDL when the setting was saved (`"chain"`), or pasted by an operator, which
|
|
868
1049
|
* takes precedence over the on-chain one (`"pasted"`).
|
|
869
1050
|
*/
|
|
@@ -950,8 +1131,155 @@ declare const walletTransactionsSchema: z.ZodObject<{
|
|
|
950
1131
|
type WalletTransactions = z.infer<typeof walletTransactionsSchema>;
|
|
951
1132
|
/** One transaction `ctx.wallet.transactions()` returns. */
|
|
952
1133
|
type WalletTransaction = WalletTransactions["transactions"][number];
|
|
953
|
-
/** One program instruction of a transaction, decoded with the program's
|
|
1134
|
+
/** One program instruction of a transaction, decoded with the program's IDL. */
|
|
954
1135
|
type WalletInstruction = NonNullable<WalletTransaction["instructions"]>[number];
|
|
1136
|
+
/**
|
|
1137
|
+
* Transactions to read as a testing-kit `facts.wallet.transactions` answer
|
|
1138
|
+
* (`management.solana.transactionFixture()`).
|
|
1139
|
+
*/
|
|
1140
|
+
declare const solanaTransactionFixtureInputSchema: z.ZodObject<{
|
|
1141
|
+
chain: z.ZodDefault<z.ZodEnum<{
|
|
1142
|
+
"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp": "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
1143
|
+
"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1": "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1";
|
|
1144
|
+
}>>;
|
|
1145
|
+
program: z.ZodString;
|
|
1146
|
+
signatures: z.ZodArray<z.ZodString>;
|
|
1147
|
+
wallet: z.ZodOptional<z.ZodString>;
|
|
1148
|
+
idl: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
1149
|
+
}, z.core.$strict>;
|
|
1150
|
+
/** What `management.solana.transactionFixture()` reads. */
|
|
1151
|
+
type SolanaTransactionFixtureInput = z.input<typeof solanaTransactionFixtureInputSchema>;
|
|
1152
|
+
/** The integer types a program-account seed can have, written little-endian as Rust's `to_le_bytes()`. */
|
|
1153
|
+
type SolanaSeedInteger = "u8" | "u16" | "u32" | "u64" | "u128" | "i8" | "i16" | "i32" | "i64" | "i128";
|
|
1154
|
+
/**
|
|
1155
|
+
* One seed of a program-derived address: `{ wallet: true }` for each linked wallet's address, a
|
|
1156
|
+
* string for its UTF-8 bytes, `{ pubkey }` for an address's 32 bytes, or an integer as
|
|
1157
|
+
* `{ u64: value }` (any {@link SolanaSeedInteger}), its value a safe integer number or a decimal
|
|
1158
|
+
* string. Seeds other than the wallet come from code or settings, never from member input.
|
|
1159
|
+
*/
|
|
1160
|
+
type SolanaSeed = {
|
|
1161
|
+
wallet: true;
|
|
1162
|
+
} | string | {
|
|
1163
|
+
pubkey: string;
|
|
1164
|
+
} | {
|
|
1165
|
+
[K in SolanaSeedInteger]: {
|
|
1166
|
+
[P in K]: number | string;
|
|
1167
|
+
};
|
|
1168
|
+
}[SolanaSeedInteger];
|
|
1169
|
+
/** A program-account seed as the sandbox sends it. Syntax only: Relay checks lengths and ranges. */
|
|
1170
|
+
declare const solanaSeedSchema: z.ZodType<SolanaSeed>;
|
|
1171
|
+
/** The most seeds a program-derived address takes besides its bump, as Solana allows. */
|
|
1172
|
+
declare const maxSolanaSeeds = 15;
|
|
1173
|
+
/** What `ctx.wallet.programAccount()` reads. */
|
|
1174
|
+
type WalletProgramAccountQuery = {
|
|
1175
|
+
/** The program, from a `settings.solanaProgram()` setting whose IDL Relay stored. */
|
|
1176
|
+
program: SolanaProgram;
|
|
1177
|
+
/** The account type, as the program's IDL names it in `accounts`, such as `"UserStake"`. */
|
|
1178
|
+
account: string;
|
|
1179
|
+
/**
|
|
1180
|
+
* The seeds the program derives each member's account from, in order, such as
|
|
1181
|
+
* `["stake", { wallet: true }]`. `{ wallet: true }` must appear at least once.
|
|
1182
|
+
*/
|
|
1183
|
+
seeds: SolanaSeed[];
|
|
1184
|
+
/**
|
|
1185
|
+
* The cluster to read: `"solana"` or {@link solanaMainnet} for mainnet (the default),
|
|
1186
|
+
* {@link solanaDevnet} for devnet.
|
|
1187
|
+
*/
|
|
1188
|
+
chain?: "solana" | SolanaNetwork;
|
|
1189
|
+
/** One of the member's linked Solana wallets; omit to read all of them. */
|
|
1190
|
+
address?: string;
|
|
1191
|
+
};
|
|
1192
|
+
/** @compat open */
|
|
1193
|
+
type KnownProgramAccountPointKind = "slot";
|
|
1194
|
+
/** What a program-account read's `at` counts: a known kind, or one a newer Relay sends. */
|
|
1195
|
+
type ProgramAccountPointKind = KnownProgramAccountPointKind | (string & {});
|
|
1196
|
+
/**
|
|
1197
|
+
* One account type of a Solana program, read at the address each of the member's pinned linked
|
|
1198
|
+
* Solana wallets derives, and decoded with the program's IDL.
|
|
1199
|
+
*/
|
|
1200
|
+
declare const walletProgramAccountSchema: z.ZodObject<{
|
|
1201
|
+
program: z.ZodString;
|
|
1202
|
+
chain: z.ZodString;
|
|
1203
|
+
account: z.ZodString;
|
|
1204
|
+
wallets: z.ZodArray<z.ZodObject<{
|
|
1205
|
+
address: z.ZodString;
|
|
1206
|
+
pda: z.ZodString;
|
|
1207
|
+
fields: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodJSONSchema>>;
|
|
1208
|
+
}, z.core.$strip>>;
|
|
1209
|
+
at: z.ZodObject<{
|
|
1210
|
+
kind: z.ZodType<ProgramAccountPointKind>;
|
|
1211
|
+
number: z.ZodString;
|
|
1212
|
+
}, z.core.$strip>;
|
|
1213
|
+
observedAt: z.ZodNumber;
|
|
1214
|
+
}, z.core.$strip>;
|
|
1215
|
+
/** What `ctx.wallet.programAccount()` returns: each linked wallet's account, decoded. */
|
|
1216
|
+
type WalletProgramAccount = z.infer<typeof walletProgramAccountSchema>;
|
|
1217
|
+
/** What `ctx.wallet.stake()` reads. */
|
|
1218
|
+
type WalletStakeQuery = {
|
|
1219
|
+
/**
|
|
1220
|
+
* The cluster to read: `"solana"` or {@link solanaMainnet} for mainnet (the default),
|
|
1221
|
+
* {@link solanaDevnet} for devnet.
|
|
1222
|
+
*/
|
|
1223
|
+
chain?: "solana" | SolanaNetwork;
|
|
1224
|
+
/** A validator's vote account (base58); omit to count every validator. */
|
|
1225
|
+
voteAccount?: string;
|
|
1226
|
+
/** One of the member's linked Solana wallets; omit to read all of them. */
|
|
1227
|
+
address?: string;
|
|
1228
|
+
};
|
|
1229
|
+
/** @compat open */
|
|
1230
|
+
type KnownStakePointKind = "slot";
|
|
1231
|
+
/** What a stake read's `at` counts: a known kind, or one a newer Relay sends. */
|
|
1232
|
+
type StakePointKind = KnownStakePointKind | (string & {});
|
|
1233
|
+
/**
|
|
1234
|
+
* The SOL the member's pinned linked Solana wallets delegate through stake accounts they control,
|
|
1235
|
+
* as staker or withdrawer, at one epoch. Amounts are lamports.
|
|
1236
|
+
*/
|
|
1237
|
+
declare const walletStakeSchema: z.ZodObject<{
|
|
1238
|
+
chain: z.ZodString;
|
|
1239
|
+
voteAccount: z.ZodNullable<z.ZodString>;
|
|
1240
|
+
epoch: z.ZodNumber;
|
|
1241
|
+
total: z.ZodString;
|
|
1242
|
+
activating: z.ZodString;
|
|
1243
|
+
deactivating: z.ZodString;
|
|
1244
|
+
wallets: z.ZodArray<z.ZodObject<{
|
|
1245
|
+
amount: z.ZodString;
|
|
1246
|
+
activating: z.ZodString;
|
|
1247
|
+
deactivating: z.ZodString;
|
|
1248
|
+
address: z.ZodString;
|
|
1249
|
+
}, z.core.$strip>>;
|
|
1250
|
+
voteAccounts: z.ZodArray<z.ZodObject<{
|
|
1251
|
+
amount: z.ZodString;
|
|
1252
|
+
activating: z.ZodString;
|
|
1253
|
+
deactivating: z.ZodString;
|
|
1254
|
+
voteAccount: z.ZodString;
|
|
1255
|
+
}, z.core.$strip>>;
|
|
1256
|
+
at: z.ZodObject<{
|
|
1257
|
+
kind: z.ZodType<StakePointKind>;
|
|
1258
|
+
number: z.ZodString;
|
|
1259
|
+
}, z.core.$strip>;
|
|
1260
|
+
observedAt: z.ZodNumber;
|
|
1261
|
+
}, z.core.$strip>;
|
|
1262
|
+
/** What `ctx.wallet.stake()` returns: the SOL the member's linked wallets delegate. */
|
|
1263
|
+
type WalletStake = z.infer<typeof walletStakeSchema>;
|
|
1264
|
+
|
|
1265
|
+
/**
|
|
1266
|
+
* One wallet's stake as Relay sampled it for a `wallet.stake()` tracker, the record's `data`, in
|
|
1267
|
+
* lamports, counted as `ctx.wallet.stake({ address })` counts that wallet's. The record's ID and
|
|
1268
|
+
* author are the wallet's CAIP-10 account on the tracker's cluster, and its `occurredAt` is when
|
|
1269
|
+
* Relay sampled it.
|
|
1270
|
+
*
|
|
1271
|
+
* @compat output
|
|
1272
|
+
*/
|
|
1273
|
+
declare const walletStakeSampleSchema: z.ZodObject<{
|
|
1274
|
+
amount: z.ZodString;
|
|
1275
|
+
activating: z.ZodString;
|
|
1276
|
+
deactivating: z.ZodString;
|
|
1277
|
+
block: z.ZodString;
|
|
1278
|
+
}, z.core.$strip>;
|
|
1279
|
+
/** One wallet's sampled stake, the `data` of a `wallet.stake()` tracker's record. */
|
|
1280
|
+
type WalletStakeSample = z.infer<typeof walletStakeSampleSchema>;
|
|
1281
|
+
/** What `wallet.stake()` samples: a `ctx.wallet.stake()` query without an address. */
|
|
1282
|
+
type WalletStakeSourceQuery = Omit<WalletStakeQuery, "address">;
|
|
955
1283
|
/**
|
|
956
1284
|
* Reads the wallets the member has linked to this project. They are pinned once per attempt, at
|
|
957
1285
|
* its first wallet read: later links and unlinks do not change the attempt. Every method resolves
|
|
@@ -972,8 +1300,9 @@ interface WalletReader {
|
|
|
972
1300
|
/**
|
|
973
1301
|
* How many NFTs of one collection the member's linked wallets of its family hold: an ERC-721
|
|
974
1302
|
* contract's `balanceOf(owner)`, one ERC-1155 token ID's `balanceOf(owner, id)`, or on Solana the
|
|
975
|
-
*
|
|
976
|
-
*
|
|
1303
|
+
* Metaplex Core assets in the collection or the NFTs whose Metaplex metadata names it as
|
|
1304
|
+
* verified, plus the compressed NFTs (Bubblegum) verified into it, summed and per wallet. Null when the
|
|
1305
|
+
* member has no linked wallet of that family. A malformed collection, a
|
|
977
1306
|
* chain Relay does not read and an `address` the member never linked throw `CapabilityError`
|
|
978
1307
|
* with code `"author-error"`. Relay supplies it to every evaluation; it is optional only so that
|
|
979
1308
|
* test doubles written before it keep compiling.
|
|
@@ -1028,6 +1357,31 @@ interface WalletReader {
|
|
|
1028
1357
|
* evaluation; it is optional only so that test doubles written before it keep compiling.
|
|
1029
1358
|
*/
|
|
1030
1359
|
transactions?(query: WalletTransactionsQuery): Promise<WalletTransactions | null>;
|
|
1360
|
+
/**
|
|
1361
|
+
* One account type of a program, per linked Solana wallet: derives the program-derived
|
|
1362
|
+
* address from `seeds` with `{ wallet: true }` as each wallet's address, reads every account at
|
|
1363
|
+
* one slot, and decodes its fields with the program's IDL. A wallet whose account does
|
|
1364
|
+
* not exist reads `fields: null`. Use it for state a program keeps per user, such as a stake
|
|
1365
|
+
* account. Null when the member has no linked Solana wallet. A malformed program, a program
|
|
1366
|
+
* whose setting has no IDL, an account type the IDL does not name, seeds that do not fit
|
|
1367
|
+
* (no `{ wallet: true }`, a seed over 32 bytes, an integer out of range), a program that is not
|
|
1368
|
+
* executable on the cluster, an account owned by another program or holding another account
|
|
1369
|
+
* type, and an `address` the member never linked throw `CapabilityError` with code
|
|
1370
|
+
* `"author-error"`. Relay supplies it to every evaluation; it is optional only so that test
|
|
1371
|
+
* doubles written before it keep compiling.
|
|
1372
|
+
*/
|
|
1373
|
+
programAccount?(query: WalletProgramAccountQuery): Promise<WalletProgramAccount | null>;
|
|
1374
|
+
/**
|
|
1375
|
+
* The SOL the member's linked Solana wallets delegate through native stake accounts, at one
|
|
1376
|
+
* epoch: every Stake program account where a wallet is the staker or the withdrawer, counted
|
|
1377
|
+
* once. `total` is active stake; stake activating or deactivating this epoch is reported apart,
|
|
1378
|
+
* so a quest can count it or not. Summed, per wallet and per vote account, or only to
|
|
1379
|
+
* `voteAccount`, in lamports. Null when the member has no linked Solana wallet. A malformed vote
|
|
1380
|
+
* account and an `address` the member never linked throw `CapabilityError` with code
|
|
1381
|
+
* `"author-error"`. Relay supplies it to every evaluation; it is optional only so that test
|
|
1382
|
+
* doubles written before it keep compiling.
|
|
1383
|
+
*/
|
|
1384
|
+
stake?(query: WalletStakeQuery): Promise<WalletStake | null>;
|
|
1031
1385
|
}
|
|
1032
1386
|
|
|
1033
|
-
export { type
|
|
1387
|
+
export { type WalletBalanceSample as $, type AvatarProvider as A, type WalletProgramActivitySourceQuery as B, type CosmosChain as C, type WalletNftSourceQuery as D, type WalletStakeSourceQuery as E, type WalletTransaction as F, type WalletInstruction as G, type WalletReader as H, type ContractCallParts as I, type ContractCallReturnType as J, type ContractEventInput as K, type LinkedWallet as L, type ContractEventParts as M, type NftCollection as N, type OwnProfile as O, type ProfileAvatar as P, type ContractFunction as Q, type CosmosDenom as R, type SolanaNetwork as S, type EvmChainId as T, type NftCollectionParts as U, type NftStandard as V, type WalletAddressInput as W, type SolanaSeed as X, type SolanaSeedInteger as Y, type WalletBalance as Z, type WalletBalanceChange as _, type CosmosNetwork as a, avatarUploadTypes as a$, type WalletCall as a0, type WalletCallArgument as a1, type WalletCallQuery as a2, type WalletDelegations as a3, type WalletDelegationsQuery as a4, type WalletEventCondition as a5, type WalletEventValue as a6, type WalletEvents as a7, type WalletEventsQuery as a8, type WalletNftSample as a9, walletAddressInputSchema as aA, walletSignatureSchema as aB, walletTransactionProofSchema as aC, evmWalletOn as aD, type ProgramAccountPointKind as aE, type StakePointKind as aF, AVATAR_UPLOAD_LIMIT as aG, type AnchorIdl as aH, type KnownProfileDefaultSource as aI, type KnownProfileNameSource as aJ, type KnownProgramAccountPointKind as aK, type KnownSolanaIdlSource as aL, type KnownStakePointKind as aM, type KnownWalletProofKind as aN, type ManagedProfile as aO, type ProfileDefaultProvider as aP, type ProfileDefaultSource as aQ, type ProfileDefaults as aR, type ProfileModeration as aS, type ProfileSettings as aT, type ProfileSettingsInput as aU, type SolanaProgramIdl as aV, type SolanaTransactionFixtureInput as aW, WALLETS_PER_CHAIN as aX, anchorIdlSchema as aY, avatarProviderSchema as aZ, avatarSeedSchema as a_, type WalletNfts as aa, type WalletNftsQuery as ab, type WalletProgramAccount as ac, type WalletProgramAccountQuery as ad, type WalletProgramActivity as ae, type WalletStake as af, type WalletStakeQuery as ag, type WalletStakeSample as ah, type WalletTransactions as ai, type WalletTransactionsQuery as aj, cosmosDenomSchema as ak, cosmosNetworkSchema as al, isContractCall as am, isContractEvent as an, isEvmChainId as ao, isNftCollection as ap, isSolanaProgram as aq, maxWalletEventLogs as ar, maxWalletEventLookback as as, maxWalletTransactionLookback as at, maxWalletTransactions as au, parseContractCall as av, parseContractEvent as aw, parseContractFunction as ax, parseNftCollection as ay, profileUpdateSchema as az, type ProfileCompletion as b, caip10 as b0, cosmosAddressSchema as b1, cosmosChain as b2, displayNameSchema as b3, evmAddressSchema as b4, evmChainIdSchema as b5, isSolanaNetwork as b6, knownProfileDefaultSources as b7, linkedWalletSchema as b8, managedProfileSchema as b9, walletChainSchema as bA, walletDelegationsSchema as bB, walletEventsSchema as bC, walletMessageChallengeSchema as bD, walletNftsSchema as bE, walletProgramAccountSchema as bF, walletProgramActivitySchema as bG, walletSignInFamilies as bH, walletSignInNetwork as bI, walletSignInNetworkSchema as bJ, walletSignInNetworksSchema as bK, walletStakeSchema as bL, walletTransactionChallengeSchema as bM, walletTransactionsSchema as bN, walletUnlinkInputSchema as bO, maxSolanaSeeds as ba, ownProfileSchema as bb, profileAvatarSchema as bc, profileCompletionPageSchema as bd, profileCompletionQuerySchema as be, profileCompletionSchema as bf, profileDefaultProviderSchema as bg, profileDefaultSourcesSchema as bh, profileDefaultsSchema as bi, profileModerationSchema as bj, profileNameSourceSchema as bk, profileReferralSchema as bl, profileSettingsInputSchema as bm, profileSettingsSchema as bn, profileSummarySchema as bo, profileVisibilitySchema as bp, solanaAddressSchema as bq, solanaMemoProgram as br, solanaProgramIdlSchema as bs, solanaSeedSchema as bt, solanaSignatureSchema as bu, solanaTransactionFixtureInputSchema as bv, walletAddressInput as bw, walletBalanceSampleSchema as bx, walletBalanceSchema as by, walletCallSchema as bz, type ProfileCompletionPage as c, type ProfileCompletionQuery as d, type ProfileNameSource as e, type ProfileReferral as f, type ProfileSummary as g, type ProfileUpdate as h, type ProfileVisibility as i, type WalletChain as j, type WalletMessageChallenge as k, type WalletProofKind as l, type WalletSignInNetwork as m, type WalletSignature as n, type WalletSigner as o, type WalletTransactionChallenge as p, type WalletTransactionProof as q, type WalletUnlinkInput as r, solanaDevnet as s, solanaMainnet as t, type SolanaIdlSource as u, type WalletBalanceQuery as v, type ContractCall as w, type ContractEvent as x, type SolanaProgram as y, type WalletBalanceSourceQuery as z };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { C as CosmosChain, a as CosmosNetwork, o as WalletSigner, m as WalletSignInNetwork } from './wallet-DQtJelQQ.js';
|
|
2
|
+
|
|
3
|
+
/** An EIP-1193 provider, such as `window.ethereum` or an EIP-6963 announcement's provider. */
|
|
4
|
+
type Eip1193Provider = {
|
|
5
|
+
request(args: {
|
|
6
|
+
method: string;
|
|
7
|
+
params?: unknown[] | object;
|
|
8
|
+
}): Promise<unknown>;
|
|
9
|
+
/** Subscribes to a provider event such as `accountsChanged`; wallets without events leave it out. */
|
|
10
|
+
on?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
11
|
+
removeListener?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
12
|
+
};
|
|
13
|
+
/** The legacy injected Solana shape Phantom, Solflare and Backpack expose. */
|
|
14
|
+
type SolanaInjectedProvider = {
|
|
15
|
+
connect(): Promise<unknown>;
|
|
16
|
+
publicKey?: {
|
|
17
|
+
toBase58(): string;
|
|
18
|
+
} | null;
|
|
19
|
+
signMessage(message: Uint8Array, display?: "utf8"): Promise<{
|
|
20
|
+
signature: Uint8Array;
|
|
21
|
+
} | Uint8Array>;
|
|
22
|
+
};
|
|
23
|
+
/** The part of a Wallet Standard account Relay uses. */
|
|
24
|
+
type StandardWalletAccount = {
|
|
25
|
+
readonly address: string;
|
|
26
|
+
readonly chains: readonly string[];
|
|
27
|
+
};
|
|
28
|
+
/** The part of a Wallet Standard wallet Relay uses; any conforming wallet object fits. */
|
|
29
|
+
type StandardWallet = {
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly icon?: string;
|
|
32
|
+
readonly chains: readonly string[];
|
|
33
|
+
readonly accounts: readonly StandardWalletAccount[];
|
|
34
|
+
readonly features: Readonly<Record<string, unknown>>;
|
|
35
|
+
};
|
|
36
|
+
/** Keplr's API, which Leap and Cosmostation also implement. */
|
|
37
|
+
type KeplrLike = {
|
|
38
|
+
enable(chainId: string | string[]): Promise<void>;
|
|
39
|
+
getKey(chainId: string): Promise<{
|
|
40
|
+
bech32Address: string;
|
|
41
|
+
}>;
|
|
42
|
+
signArbitrary(chainId: string, signer: string, data: string): Promise<{
|
|
43
|
+
signature: string;
|
|
44
|
+
pub_key: {
|
|
45
|
+
type: string;
|
|
46
|
+
value: string;
|
|
47
|
+
};
|
|
48
|
+
}>;
|
|
49
|
+
/** Adds a chain the wallet does not know, after the user approves it. */
|
|
50
|
+
experimentalSuggestChain?(chainInfo: CosmosChain["chainInfo"]): Promise<void>;
|
|
51
|
+
};
|
|
52
|
+
/** A wallet found in the page, ready to pass to `relay.wallets.link`. */
|
|
53
|
+
type DiscoveredWallet = {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
icon?: string;
|
|
57
|
+
signer: WalletSigner;
|
|
58
|
+
};
|
|
59
|
+
/** Signs with an EIP-1193 provider through `personal_sign`. */
|
|
60
|
+
declare function evmSigner(provider: Eip1193Provider, info?: {
|
|
61
|
+
name?: string;
|
|
62
|
+
}): WalletSigner;
|
|
63
|
+
/** Signs with a legacy injected Solana provider, such as `window.phantom.solana`. */
|
|
64
|
+
declare function solanaSigner(provider: SolanaInjectedProvider, info?: {
|
|
65
|
+
name?: string;
|
|
66
|
+
}): WalletSigner;
|
|
67
|
+
/** Signs with a Wallet Standard wallet's `solana:signMessage` feature. */
|
|
68
|
+
declare function walletStandardSolanaSigner(wallet: StandardWallet): WalletSigner;
|
|
69
|
+
/**
|
|
70
|
+
* Signs an ADR-36 message with Keplr or a wallet that implements its API, on the app's chain:
|
|
71
|
+
* `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. When the wallet does not know the chain and
|
|
72
|
+
* `chainInfo` is given, it suggests the chain to the wallet (`experimentalSuggestChain`) and tries
|
|
73
|
+
* again; without `chainInfo`, or with a wallet that cannot add chains, it throws an error that
|
|
74
|
+
* names the chain. Other failures, such as a rejected request, pass through.
|
|
75
|
+
*/
|
|
76
|
+
declare function cosmosSigner(provider: KeplrLike, chain: CosmosChain | CosmosNetwork, info?: {
|
|
77
|
+
name?: string;
|
|
78
|
+
}): WalletSigner;
|
|
79
|
+
/** EIP-6963 wallets, or `window.ethereum` when none announce themselves within `timeoutMs`. */
|
|
80
|
+
declare function discoverEvmWallets(timeoutMs?: number): Promise<DiscoveredWallet[]>;
|
|
81
|
+
/** Wallet Standard wallets that can sign Solana messages, then legacy injected providers. */
|
|
82
|
+
declare function discoverSolanaWallets(): DiscoveredWallet[];
|
|
83
|
+
/**
|
|
84
|
+
* Keplr, Leap and Cosmostation, each signing on the app's chain (see `cosmosSigner`). IDs end with
|
|
85
|
+
* the chain ID.
|
|
86
|
+
*/
|
|
87
|
+
declare function discoverCosmosWallets(chain: CosmosChain | CosmosNetwork): DiscoveredWallet[];
|
|
88
|
+
/**
|
|
89
|
+
* The Cosmos SDK chains an app offers wallets on: one chain or several, each as
|
|
90
|
+
* `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. Relay has no chain list of its own.
|
|
91
|
+
*/
|
|
92
|
+
type CosmosChains = CosmosChain | CosmosNetwork | readonly (CosmosChain | CosmosNetwork)[];
|
|
93
|
+
/** The chains in `CosmosChains`, as a list. */
|
|
94
|
+
declare function cosmosChainList(chains: CosmosChains | undefined): (CosmosChain | CosmosNetwork)[];
|
|
95
|
+
/** An installed wallet that can sign in on one of the project's enabled wallet families. */
|
|
96
|
+
type SignInWallet = DiscoveredWallet & {
|
|
97
|
+
network: WalletSignInNetwork;
|
|
98
|
+
};
|
|
99
|
+
/**
|
|
100
|
+
* The wallets installed in this browser that can sign in with `families`: EVM wallets first, then
|
|
101
|
+
* Solana wallets, then Cosmos wallets once per chain in `cosmos`. Without `cosmos` there are no
|
|
102
|
+
* Cosmos wallets. Empty during SSR.
|
|
103
|
+
*/
|
|
104
|
+
declare function discoverSignInWallets(families: readonly WalletSignInNetwork[], cosmos?: CosmosChains): Promise<SignInWallet[]>;
|
|
105
|
+
|
|
106
|
+
export { type CosmosChains as C, type DiscoveredWallet as D, type Eip1193Provider as E, type KeplrLike as K, type SignInWallet as S, type SolanaInjectedProvider as a, type StandardWallet as b, type StandardWalletAccount as c, cosmosChainList as d, cosmosSigner as e, discoverCosmosWallets as f, discoverEvmWallets as g, discoverSignInWallets as h, discoverSolanaWallets as i, evmSigner as j, solanaSigner as s, walletStandardSolanaSigner as w };
|