@pollar/core 0.9.0-rc.1 → 0.9.0-rc.3
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.d.mts +170 -8
- package/dist/index.d.ts +170 -8
- package/dist/index.js +100 -47
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +100 -47
- package/dist/index.mjs.map +1 -1
- package/dist/index.rn.d.mts +1 -1
- package/dist/index.rn.d.ts +1 -1
- package/dist/index.rn.js +100 -47
- package/dist/index.rn.js.map +1 -1
- package/dist/index.rn.mjs +100 -47
- package/dist/index.rn.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -201,7 +201,7 @@ interface PollarPersistedSession {
|
|
|
201
201
|
ready: boolean;
|
|
202
202
|
};
|
|
203
203
|
wallet: {
|
|
204
|
-
type: '
|
|
204
|
+
type: 'internal' | 'smart' | 'external';
|
|
205
205
|
address: string | null;
|
|
206
206
|
existsOnStellar?: boolean;
|
|
207
207
|
createdAt?: number;
|
|
@@ -344,12 +344,17 @@ interface PollarClientConfig {
|
|
|
344
344
|
* Runs the device WebAuthn ceremony for a server-issued challenge and returns
|
|
345
345
|
* the result to forward to the backend: a registration response for a new user
|
|
346
346
|
* (`create()`) or an authentication assertion for a returning one (`get()`).
|
|
347
|
-
*
|
|
348
|
-
* `create()`)
|
|
349
|
-
*
|
|
347
|
+
* `mode` tells the ceremony which to run: `'login'` runs `get()` only (returning
|
|
348
|
+
* user) and `'register'` runs `create()` only (new wallet) — the caller picks via
|
|
349
|
+
* the "Log in" / "Create wallet" buttons, so there's no ambiguous autodetect that
|
|
350
|
+
* could create a wallet when the user merely cancelled a login prompt. `response`
|
|
351
|
+
* is the browser's PublicKeyCredential serialized to JSON — forwarded verbatim to
|
|
352
|
+
* `/auth/passkey/{register,login}`.
|
|
350
353
|
*/
|
|
354
|
+
type PasskeyMode = 'login' | 'register';
|
|
351
355
|
type PasskeyCeremony = (ctx: {
|
|
352
356
|
challenge: string;
|
|
357
|
+
mode: PasskeyMode;
|
|
353
358
|
}) => Promise<{
|
|
354
359
|
kind: 'login';
|
|
355
360
|
response: unknown;
|
|
@@ -558,6 +563,22 @@ type SubmitOutcome = {
|
|
|
558
563
|
resultCode?: string;
|
|
559
564
|
buildData?: TxBuildContent;
|
|
560
565
|
};
|
|
566
|
+
/**
|
|
567
|
+
* Result of {@link PollarClient.setTrustline}. Like {@link SubmitOutcome} but the
|
|
568
|
+
* `hash` is optional: the sponsored, server-orchestrated path completes without
|
|
569
|
+
* surfacing a transaction hash to the client, whereas the self-paid path returns
|
|
570
|
+
* the underlying submit outcome (hash included).
|
|
571
|
+
*/
|
|
572
|
+
type TrustlineOutcome = {
|
|
573
|
+
status: 'success';
|
|
574
|
+
hash?: string;
|
|
575
|
+
} | {
|
|
576
|
+
status: 'pending';
|
|
577
|
+
hash?: string;
|
|
578
|
+
} | {
|
|
579
|
+
status: 'error';
|
|
580
|
+
details?: string;
|
|
581
|
+
};
|
|
561
582
|
declare const AUTH_ERROR_CODES: {
|
|
562
583
|
readonly SESSION_CREATE_FAILED: "SESSION_CREATE_FAILED";
|
|
563
584
|
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
@@ -871,11 +892,19 @@ declare class PollarClient {
|
|
|
871
892
|
verifyEmailCode(code: string): void;
|
|
872
893
|
loginWallet(type: WalletId): void;
|
|
873
894
|
/**
|
|
874
|
-
* "Smart Wallet" login: runs the passkey (WebAuthn) ceremony
|
|
875
|
-
* user
|
|
876
|
-
* ceremony to be configured (e.g. via
|
|
895
|
+
* "Smart Wallet" login: runs the passkey (WebAuthn) `get()` ceremony for a
|
|
896
|
+
* returning user and signs them in. Use {@link createSmartWallet} for a new
|
|
897
|
+
* user. Requires the `passkey` ceremony to be configured (e.g. via
|
|
898
|
+
* `@pollar/react`).
|
|
877
899
|
*/
|
|
878
900
|
loginSmartWallet(): void;
|
|
901
|
+
/**
|
|
902
|
+
* "Smart Wallet" registration: runs the passkey (WebAuthn) `create()` ceremony
|
|
903
|
+
* for a new user and deploys a sponsored smart-account C-address. Use
|
|
904
|
+
* {@link loginSmartWallet} for a returning user. Requires the `passkey`
|
|
905
|
+
* ceremony to be configured (e.g. via `@pollar/react`).
|
|
906
|
+
*/
|
|
907
|
+
createSmartWallet(): void;
|
|
879
908
|
cancelLogin(): void;
|
|
880
909
|
/**
|
|
881
910
|
* Revoke the current session server-side, then clear local storage.
|
|
@@ -952,6 +981,27 @@ declare class PollarClient {
|
|
|
952
981
|
* session. Drives `enabledAssetsState`; mirrors {@link refreshBalance}.
|
|
953
982
|
*/
|
|
954
983
|
refreshAssets(): Promise<void>;
|
|
984
|
+
/**
|
|
985
|
+
* Establishes (omit `limit`) or removes (`limit: '0'`) a trustline for an asset.
|
|
986
|
+
*
|
|
987
|
+
* Routing mirrors how the platform pays for the reserve:
|
|
988
|
+
* - **Sponsored custodial** (`opts.sponsored` true, internal wallet) → the
|
|
989
|
+
* server orchestrates a sponsored `changeTrust`: the app's wallets cover the
|
|
990
|
+
* 0.5 XLM reserve and the fee, so the user pays nothing. Pass the asset's
|
|
991
|
+
* `sponsored` flag (from {@link refreshAssets}) straight through.
|
|
992
|
+
* - **Self-paid** (external/adapter wallet, sponsorship disabled, or a custom
|
|
993
|
+
* asset not configured in the app) → a plain `change_trust` transaction the
|
|
994
|
+
* user's own wallet signs and pays for, via {@link runTx}.
|
|
995
|
+
*
|
|
996
|
+
* Does not refresh on its own — callers should `refreshAssets()` afterwards.
|
|
997
|
+
*/
|
|
998
|
+
setTrustline(asset: {
|
|
999
|
+
code: string;
|
|
1000
|
+
issuer: string;
|
|
1001
|
+
}, opts?: {
|
|
1002
|
+
limit?: string;
|
|
1003
|
+
sponsored?: boolean;
|
|
1004
|
+
}): Promise<TrustlineOutcome>;
|
|
955
1005
|
/**
|
|
956
1006
|
* Builds an unsigned XDR. Drives `_setTransactionState` for modal-style UIs
|
|
957
1007
|
* AND returns a {@link BuildOutcome} so headless callers can `await` and
|
|
@@ -1957,6 +2007,26 @@ interface paths {
|
|
|
1957
2007
|
patch?: never;
|
|
1958
2008
|
trace?: never;
|
|
1959
2009
|
};
|
|
2010
|
+
"/wallet/assets/trustline": {
|
|
2011
|
+
parameters: {
|
|
2012
|
+
query?: never;
|
|
2013
|
+
header?: never;
|
|
2014
|
+
path?: never;
|
|
2015
|
+
cookie?: never;
|
|
2016
|
+
};
|
|
2017
|
+
get?: never;
|
|
2018
|
+
put?: never;
|
|
2019
|
+
/**
|
|
2020
|
+
* Enable or remove a trustline for an enabled asset
|
|
2021
|
+
* @description Establishes (no limit) or removes (limit '0') a trustline on the authenticated user's custodial wallet for an asset configured in the application, sponsored by the app. Returns the refreshed enabled-asset list. Only valid for the sponsored custodial path; custom assets, adapter-managed wallets, and apps with trustline sponsoring disabled must sign a change_trust transaction client-side instead.
|
|
2022
|
+
*/
|
|
2023
|
+
post: operations["postWalletAssetsTrustline"];
|
|
2024
|
+
delete?: never;
|
|
2025
|
+
options?: never;
|
|
2026
|
+
head?: never;
|
|
2027
|
+
patch?: never;
|
|
2028
|
+
trace?: never;
|
|
2029
|
+
};
|
|
1960
2030
|
"/wallet/{publicKey}/balance": {
|
|
1961
2031
|
parameters: {
|
|
1962
2032
|
query?: never;
|
|
@@ -3653,6 +3723,7 @@ interface operations {
|
|
|
3653
3723
|
logoUrl?: string;
|
|
3654
3724
|
emailEnabled?: boolean;
|
|
3655
3725
|
embeddedWallets?: boolean;
|
|
3726
|
+
smartWallet?: boolean;
|
|
3656
3727
|
providers?: {
|
|
3657
3728
|
google?: boolean;
|
|
3658
3729
|
discord?: boolean;
|
|
@@ -5014,6 +5085,8 @@ interface operations {
|
|
|
5014
5085
|
name?: string;
|
|
5015
5086
|
trustlineEstablished: boolean;
|
|
5016
5087
|
limit?: string;
|
|
5088
|
+
enabledInApp: boolean;
|
|
5089
|
+
sponsored?: boolean;
|
|
5017
5090
|
}[];
|
|
5018
5091
|
};
|
|
5019
5092
|
};
|
|
@@ -5047,6 +5120,95 @@ interface operations {
|
|
|
5047
5120
|
};
|
|
5048
5121
|
};
|
|
5049
5122
|
};
|
|
5123
|
+
postWalletAssetsTrustline: {
|
|
5124
|
+
parameters: {
|
|
5125
|
+
query?: never;
|
|
5126
|
+
header?: never;
|
|
5127
|
+
path?: never;
|
|
5128
|
+
cookie?: never;
|
|
5129
|
+
};
|
|
5130
|
+
requestBody: {
|
|
5131
|
+
content: {
|
|
5132
|
+
"application/json": {
|
|
5133
|
+
code: string;
|
|
5134
|
+
issuer: string;
|
|
5135
|
+
limit?: string;
|
|
5136
|
+
};
|
|
5137
|
+
};
|
|
5138
|
+
};
|
|
5139
|
+
responses: {
|
|
5140
|
+
/** @description Trustline updated; refreshed enabled assets */
|
|
5141
|
+
200: {
|
|
5142
|
+
headers: {
|
|
5143
|
+
[name: string]: unknown;
|
|
5144
|
+
};
|
|
5145
|
+
content: {
|
|
5146
|
+
"application/json": {
|
|
5147
|
+
/** @constant */
|
|
5148
|
+
code: "SDK_WALLET_TRUSTLINE";
|
|
5149
|
+
/** @constant */
|
|
5150
|
+
success: true;
|
|
5151
|
+
content: {
|
|
5152
|
+
publicKey: string;
|
|
5153
|
+
/** @enum {string} */
|
|
5154
|
+
network: "testnet" | "mainnet";
|
|
5155
|
+
exists: boolean;
|
|
5156
|
+
assets: {
|
|
5157
|
+
/** @enum {string} */
|
|
5158
|
+
type: "native" | "credit_alphanum4" | "credit_alphanum12";
|
|
5159
|
+
code: string;
|
|
5160
|
+
issuer?: string;
|
|
5161
|
+
name?: string;
|
|
5162
|
+
trustlineEstablished: boolean;
|
|
5163
|
+
limit?: string;
|
|
5164
|
+
enabledInApp: boolean;
|
|
5165
|
+
sponsored?: boolean;
|
|
5166
|
+
}[];
|
|
5167
|
+
};
|
|
5168
|
+
};
|
|
5169
|
+
};
|
|
5170
|
+
};
|
|
5171
|
+
/** @description Validation error */
|
|
5172
|
+
400: {
|
|
5173
|
+
headers: {
|
|
5174
|
+
[name: string]: unknown;
|
|
5175
|
+
};
|
|
5176
|
+
content: {
|
|
5177
|
+
"application/json": {
|
|
5178
|
+
/** @constant */
|
|
5179
|
+
success: false;
|
|
5180
|
+
code: string;
|
|
5181
|
+
};
|
|
5182
|
+
};
|
|
5183
|
+
};
|
|
5184
|
+
/** @description Unauthorized */
|
|
5185
|
+
401: {
|
|
5186
|
+
headers: {
|
|
5187
|
+
[name: string]: unknown;
|
|
5188
|
+
};
|
|
5189
|
+
content: {
|
|
5190
|
+
"application/json": {
|
|
5191
|
+
/** @constant */
|
|
5192
|
+
success: false;
|
|
5193
|
+
code: string;
|
|
5194
|
+
};
|
|
5195
|
+
};
|
|
5196
|
+
};
|
|
5197
|
+
/** @description Not found */
|
|
5198
|
+
404: {
|
|
5199
|
+
headers: {
|
|
5200
|
+
[name: string]: unknown;
|
|
5201
|
+
};
|
|
5202
|
+
content: {
|
|
5203
|
+
"application/json": {
|
|
5204
|
+
/** @constant */
|
|
5205
|
+
success: false;
|
|
5206
|
+
code: string;
|
|
5207
|
+
};
|
|
5208
|
+
};
|
|
5209
|
+
};
|
|
5210
|
+
};
|
|
5211
|
+
};
|
|
5050
5212
|
getWalletByPublicKeyBalance: {
|
|
5051
5213
|
parameters: {
|
|
5052
5214
|
query: {
|
|
@@ -5897,4 +6059,4 @@ declare function listDistributionRules(api: PollarApiClient): Promise<Distributi
|
|
|
5897
6059
|
*/
|
|
5898
6060
|
declare function claimDistributionRule(api: PollarApiClient, body: DistributionClaimBody): Promise<DistributionClaimContent>;
|
|
5899
6061
|
|
|
5900
|
-
export { AUTH_ERROR_CODES, type AdapterFn, AlbedoAdapter, type AuthErrorCode, type AuthOpenContext, type AuthState, type AuthUrlOpener, type BuildOutcome, type BuildProofArgs, type ConnectWalletResponse, type DistributionClaimBody, type DistributionClaimContent, type DistributionRule, type DistributionRulesState, type EnabledAssetRecord, type EnabledAssetsState, FreighterAdapter, type KeyManager, type KycFlow, type KycLevel, type KycProvider, type KycStartBody, type KycStartResponse, type KycStatus, type LocalStorageAdapterOptions, type LogLevel, type NetworkState, OnStorageDegrade, POLLAR_CORE_VERSION, type PasskeyCeremony, type PasskeySigner, type PaymentInstructions, type PollarAdapter, type PollarAdapters, type PollarApiClient, type PollarApplicationConfigContent, type PollarApplicationConfigResponse, PollarClient, type PollarClientConfig, PollarFlowError, type PollarLogger, type PollarLoginOptions, type PollarPersistedSession, type PollarUserProfile, type PublicEcJwk, type RampDirection, type RampQuote, type RampTxStatus, type RampsOfframpBody, type RampsOfframpResponse, type RampsOnrampBody, type RampsOnrampResponse, type RampsQuoteQuery, type RampsQuoteResponse, type RampsTransactionResponse, type RulePeriod, type SessionInfo, type SessionsState, type SignAuthEntryOptions, type SignAuthEntryResponse, type SignOutcome, type SignTransactionOptions, type SignTransactionResponse, type StellarBalance, StellarClient, type StellarClientConfig, type StellarNetwork, Storage, type SubmitOutcome, type TransactionState, type TxBuildBody, type TxBuildContent, type TxBuildResponse, type TxBuildSignSubmitBody, type TxBuildSignSubmitContent, type TxBuildSignSubmitResponse, type TxErrorPhase, type TxHistoryContent, type TxHistoryParams, type TxHistoryRecord, type TxHistoryState, type TxSignAndSendBody, type TxSignBody, type TxSignContent, type TxSignResponse, type TxSignSendResponse, type TxSubmitSignedBody, type WalletAdapter, type WalletAdapterResolver, type WalletAssetsContent, type WalletBalanceContent, type WalletBalanceRecord, type WalletBalanceState, type WalletId, WalletType, WebCryptoKeyManager, buildProof, canonicalEcJwk, claimDistributionRule, computeJwkThumbprint, createLocalStorageAdapter, createLogger, createMemoryAdapter, createOffRamp, createOnRamp, defaultKeyManager, defaultStorage, getKycProviders, getKycStatus, getRampTransaction, getRampsQuote, isValidSession, listDistributionRules, normalizeHtu, pollKycStatus, pollRampTransaction, type paths as pollarPaths, resolveKyc, startKyc };
|
|
6062
|
+
export { AUTH_ERROR_CODES, type AdapterFn, AlbedoAdapter, type AuthErrorCode, type AuthOpenContext, type AuthState, type AuthUrlOpener, type BuildOutcome, type BuildProofArgs, type ConnectWalletResponse, type DistributionClaimBody, type DistributionClaimContent, type DistributionRule, type DistributionRulesState, type EnabledAssetRecord, type EnabledAssetsState, FreighterAdapter, type KeyManager, type KycFlow, type KycLevel, type KycProvider, type KycStartBody, type KycStartResponse, type KycStatus, type LocalStorageAdapterOptions, type LogLevel, type NetworkState, OnStorageDegrade, POLLAR_CORE_VERSION, type PasskeyCeremony, type PasskeyMode, type PasskeySigner, type PaymentInstructions, type PollarAdapter, type PollarAdapters, type PollarApiClient, type PollarApplicationConfigContent, type PollarApplicationConfigResponse, PollarClient, type PollarClientConfig, PollarFlowError, type PollarLogger, type PollarLoginOptions, type PollarPersistedSession, type PollarUserProfile, type PublicEcJwk, type RampDirection, type RampQuote, type RampTxStatus, type RampsOfframpBody, type RampsOfframpResponse, type RampsOnrampBody, type RampsOnrampResponse, type RampsQuoteQuery, type RampsQuoteResponse, type RampsTransactionResponse, type RulePeriod, type SessionInfo, type SessionsState, type SignAuthEntryOptions, type SignAuthEntryResponse, type SignOutcome, type SignTransactionOptions, type SignTransactionResponse, type StellarBalance, StellarClient, type StellarClientConfig, type StellarNetwork, Storage, type SubmitOutcome, type TransactionState, type TrustlineOutcome, type TxBuildBody, type TxBuildContent, type TxBuildResponse, type TxBuildSignSubmitBody, type TxBuildSignSubmitContent, type TxBuildSignSubmitResponse, type TxErrorPhase, type TxHistoryContent, type TxHistoryParams, type TxHistoryRecord, type TxHistoryState, type TxSignAndSendBody, type TxSignBody, type TxSignContent, type TxSignResponse, type TxSignSendResponse, type TxSubmitSignedBody, type WalletAdapter, type WalletAdapterResolver, type WalletAssetsContent, type WalletBalanceContent, type WalletBalanceRecord, type WalletBalanceState, type WalletId, WalletType, WebCryptoKeyManager, buildProof, canonicalEcJwk, claimDistributionRule, computeJwkThumbprint, createLocalStorageAdapter, createLogger, createMemoryAdapter, createOffRamp, createOnRamp, defaultKeyManager, defaultStorage, getKycProviders, getKycStatus, getRampTransaction, getRampsQuote, isValidSession, listDistributionRules, normalizeHtu, pollKycStatus, pollRampTransaction, type paths as pollarPaths, resolveKyc, startKyc };
|
package/dist/index.d.ts
CHANGED
|
@@ -201,7 +201,7 @@ interface PollarPersistedSession {
|
|
|
201
201
|
ready: boolean;
|
|
202
202
|
};
|
|
203
203
|
wallet: {
|
|
204
|
-
type: '
|
|
204
|
+
type: 'internal' | 'smart' | 'external';
|
|
205
205
|
address: string | null;
|
|
206
206
|
existsOnStellar?: boolean;
|
|
207
207
|
createdAt?: number;
|
|
@@ -344,12 +344,17 @@ interface PollarClientConfig {
|
|
|
344
344
|
* Runs the device WebAuthn ceremony for a server-issued challenge and returns
|
|
345
345
|
* the result to forward to the backend: a registration response for a new user
|
|
346
346
|
* (`create()`) or an authentication assertion for a returning one (`get()`).
|
|
347
|
-
*
|
|
348
|
-
* `create()`)
|
|
349
|
-
*
|
|
347
|
+
* `mode` tells the ceremony which to run: `'login'` runs `get()` only (returning
|
|
348
|
+
* user) and `'register'` runs `create()` only (new wallet) — the caller picks via
|
|
349
|
+
* the "Log in" / "Create wallet" buttons, so there's no ambiguous autodetect that
|
|
350
|
+
* could create a wallet when the user merely cancelled a login prompt. `response`
|
|
351
|
+
* is the browser's PublicKeyCredential serialized to JSON — forwarded verbatim to
|
|
352
|
+
* `/auth/passkey/{register,login}`.
|
|
350
353
|
*/
|
|
354
|
+
type PasskeyMode = 'login' | 'register';
|
|
351
355
|
type PasskeyCeremony = (ctx: {
|
|
352
356
|
challenge: string;
|
|
357
|
+
mode: PasskeyMode;
|
|
353
358
|
}) => Promise<{
|
|
354
359
|
kind: 'login';
|
|
355
360
|
response: unknown;
|
|
@@ -558,6 +563,22 @@ type SubmitOutcome = {
|
|
|
558
563
|
resultCode?: string;
|
|
559
564
|
buildData?: TxBuildContent;
|
|
560
565
|
};
|
|
566
|
+
/**
|
|
567
|
+
* Result of {@link PollarClient.setTrustline}. Like {@link SubmitOutcome} but the
|
|
568
|
+
* `hash` is optional: the sponsored, server-orchestrated path completes without
|
|
569
|
+
* surfacing a transaction hash to the client, whereas the self-paid path returns
|
|
570
|
+
* the underlying submit outcome (hash included).
|
|
571
|
+
*/
|
|
572
|
+
type TrustlineOutcome = {
|
|
573
|
+
status: 'success';
|
|
574
|
+
hash?: string;
|
|
575
|
+
} | {
|
|
576
|
+
status: 'pending';
|
|
577
|
+
hash?: string;
|
|
578
|
+
} | {
|
|
579
|
+
status: 'error';
|
|
580
|
+
details?: string;
|
|
581
|
+
};
|
|
561
582
|
declare const AUTH_ERROR_CODES: {
|
|
562
583
|
readonly SESSION_CREATE_FAILED: "SESSION_CREATE_FAILED";
|
|
563
584
|
readonly SESSION_EXPIRED: "SESSION_EXPIRED";
|
|
@@ -871,11 +892,19 @@ declare class PollarClient {
|
|
|
871
892
|
verifyEmailCode(code: string): void;
|
|
872
893
|
loginWallet(type: WalletId): void;
|
|
873
894
|
/**
|
|
874
|
-
* "Smart Wallet" login: runs the passkey (WebAuthn) ceremony
|
|
875
|
-
* user
|
|
876
|
-
* ceremony to be configured (e.g. via
|
|
895
|
+
* "Smart Wallet" login: runs the passkey (WebAuthn) `get()` ceremony for a
|
|
896
|
+
* returning user and signs them in. Use {@link createSmartWallet} for a new
|
|
897
|
+
* user. Requires the `passkey` ceremony to be configured (e.g. via
|
|
898
|
+
* `@pollar/react`).
|
|
877
899
|
*/
|
|
878
900
|
loginSmartWallet(): void;
|
|
901
|
+
/**
|
|
902
|
+
* "Smart Wallet" registration: runs the passkey (WebAuthn) `create()` ceremony
|
|
903
|
+
* for a new user and deploys a sponsored smart-account C-address. Use
|
|
904
|
+
* {@link loginSmartWallet} for a returning user. Requires the `passkey`
|
|
905
|
+
* ceremony to be configured (e.g. via `@pollar/react`).
|
|
906
|
+
*/
|
|
907
|
+
createSmartWallet(): void;
|
|
879
908
|
cancelLogin(): void;
|
|
880
909
|
/**
|
|
881
910
|
* Revoke the current session server-side, then clear local storage.
|
|
@@ -952,6 +981,27 @@ declare class PollarClient {
|
|
|
952
981
|
* session. Drives `enabledAssetsState`; mirrors {@link refreshBalance}.
|
|
953
982
|
*/
|
|
954
983
|
refreshAssets(): Promise<void>;
|
|
984
|
+
/**
|
|
985
|
+
* Establishes (omit `limit`) or removes (`limit: '0'`) a trustline for an asset.
|
|
986
|
+
*
|
|
987
|
+
* Routing mirrors how the platform pays for the reserve:
|
|
988
|
+
* - **Sponsored custodial** (`opts.sponsored` true, internal wallet) → the
|
|
989
|
+
* server orchestrates a sponsored `changeTrust`: the app's wallets cover the
|
|
990
|
+
* 0.5 XLM reserve and the fee, so the user pays nothing. Pass the asset's
|
|
991
|
+
* `sponsored` flag (from {@link refreshAssets}) straight through.
|
|
992
|
+
* - **Self-paid** (external/adapter wallet, sponsorship disabled, or a custom
|
|
993
|
+
* asset not configured in the app) → a plain `change_trust` transaction the
|
|
994
|
+
* user's own wallet signs and pays for, via {@link runTx}.
|
|
995
|
+
*
|
|
996
|
+
* Does not refresh on its own — callers should `refreshAssets()` afterwards.
|
|
997
|
+
*/
|
|
998
|
+
setTrustline(asset: {
|
|
999
|
+
code: string;
|
|
1000
|
+
issuer: string;
|
|
1001
|
+
}, opts?: {
|
|
1002
|
+
limit?: string;
|
|
1003
|
+
sponsored?: boolean;
|
|
1004
|
+
}): Promise<TrustlineOutcome>;
|
|
955
1005
|
/**
|
|
956
1006
|
* Builds an unsigned XDR. Drives `_setTransactionState` for modal-style UIs
|
|
957
1007
|
* AND returns a {@link BuildOutcome} so headless callers can `await` and
|
|
@@ -1957,6 +2007,26 @@ interface paths {
|
|
|
1957
2007
|
patch?: never;
|
|
1958
2008
|
trace?: never;
|
|
1959
2009
|
};
|
|
2010
|
+
"/wallet/assets/trustline": {
|
|
2011
|
+
parameters: {
|
|
2012
|
+
query?: never;
|
|
2013
|
+
header?: never;
|
|
2014
|
+
path?: never;
|
|
2015
|
+
cookie?: never;
|
|
2016
|
+
};
|
|
2017
|
+
get?: never;
|
|
2018
|
+
put?: never;
|
|
2019
|
+
/**
|
|
2020
|
+
* Enable or remove a trustline for an enabled asset
|
|
2021
|
+
* @description Establishes (no limit) or removes (limit '0') a trustline on the authenticated user's custodial wallet for an asset configured in the application, sponsored by the app. Returns the refreshed enabled-asset list. Only valid for the sponsored custodial path; custom assets, adapter-managed wallets, and apps with trustline sponsoring disabled must sign a change_trust transaction client-side instead.
|
|
2022
|
+
*/
|
|
2023
|
+
post: operations["postWalletAssetsTrustline"];
|
|
2024
|
+
delete?: never;
|
|
2025
|
+
options?: never;
|
|
2026
|
+
head?: never;
|
|
2027
|
+
patch?: never;
|
|
2028
|
+
trace?: never;
|
|
2029
|
+
};
|
|
1960
2030
|
"/wallet/{publicKey}/balance": {
|
|
1961
2031
|
parameters: {
|
|
1962
2032
|
query?: never;
|
|
@@ -3653,6 +3723,7 @@ interface operations {
|
|
|
3653
3723
|
logoUrl?: string;
|
|
3654
3724
|
emailEnabled?: boolean;
|
|
3655
3725
|
embeddedWallets?: boolean;
|
|
3726
|
+
smartWallet?: boolean;
|
|
3656
3727
|
providers?: {
|
|
3657
3728
|
google?: boolean;
|
|
3658
3729
|
discord?: boolean;
|
|
@@ -5014,6 +5085,8 @@ interface operations {
|
|
|
5014
5085
|
name?: string;
|
|
5015
5086
|
trustlineEstablished: boolean;
|
|
5016
5087
|
limit?: string;
|
|
5088
|
+
enabledInApp: boolean;
|
|
5089
|
+
sponsored?: boolean;
|
|
5017
5090
|
}[];
|
|
5018
5091
|
};
|
|
5019
5092
|
};
|
|
@@ -5047,6 +5120,95 @@ interface operations {
|
|
|
5047
5120
|
};
|
|
5048
5121
|
};
|
|
5049
5122
|
};
|
|
5123
|
+
postWalletAssetsTrustline: {
|
|
5124
|
+
parameters: {
|
|
5125
|
+
query?: never;
|
|
5126
|
+
header?: never;
|
|
5127
|
+
path?: never;
|
|
5128
|
+
cookie?: never;
|
|
5129
|
+
};
|
|
5130
|
+
requestBody: {
|
|
5131
|
+
content: {
|
|
5132
|
+
"application/json": {
|
|
5133
|
+
code: string;
|
|
5134
|
+
issuer: string;
|
|
5135
|
+
limit?: string;
|
|
5136
|
+
};
|
|
5137
|
+
};
|
|
5138
|
+
};
|
|
5139
|
+
responses: {
|
|
5140
|
+
/** @description Trustline updated; refreshed enabled assets */
|
|
5141
|
+
200: {
|
|
5142
|
+
headers: {
|
|
5143
|
+
[name: string]: unknown;
|
|
5144
|
+
};
|
|
5145
|
+
content: {
|
|
5146
|
+
"application/json": {
|
|
5147
|
+
/** @constant */
|
|
5148
|
+
code: "SDK_WALLET_TRUSTLINE";
|
|
5149
|
+
/** @constant */
|
|
5150
|
+
success: true;
|
|
5151
|
+
content: {
|
|
5152
|
+
publicKey: string;
|
|
5153
|
+
/** @enum {string} */
|
|
5154
|
+
network: "testnet" | "mainnet";
|
|
5155
|
+
exists: boolean;
|
|
5156
|
+
assets: {
|
|
5157
|
+
/** @enum {string} */
|
|
5158
|
+
type: "native" | "credit_alphanum4" | "credit_alphanum12";
|
|
5159
|
+
code: string;
|
|
5160
|
+
issuer?: string;
|
|
5161
|
+
name?: string;
|
|
5162
|
+
trustlineEstablished: boolean;
|
|
5163
|
+
limit?: string;
|
|
5164
|
+
enabledInApp: boolean;
|
|
5165
|
+
sponsored?: boolean;
|
|
5166
|
+
}[];
|
|
5167
|
+
};
|
|
5168
|
+
};
|
|
5169
|
+
};
|
|
5170
|
+
};
|
|
5171
|
+
/** @description Validation error */
|
|
5172
|
+
400: {
|
|
5173
|
+
headers: {
|
|
5174
|
+
[name: string]: unknown;
|
|
5175
|
+
};
|
|
5176
|
+
content: {
|
|
5177
|
+
"application/json": {
|
|
5178
|
+
/** @constant */
|
|
5179
|
+
success: false;
|
|
5180
|
+
code: string;
|
|
5181
|
+
};
|
|
5182
|
+
};
|
|
5183
|
+
};
|
|
5184
|
+
/** @description Unauthorized */
|
|
5185
|
+
401: {
|
|
5186
|
+
headers: {
|
|
5187
|
+
[name: string]: unknown;
|
|
5188
|
+
};
|
|
5189
|
+
content: {
|
|
5190
|
+
"application/json": {
|
|
5191
|
+
/** @constant */
|
|
5192
|
+
success: false;
|
|
5193
|
+
code: string;
|
|
5194
|
+
};
|
|
5195
|
+
};
|
|
5196
|
+
};
|
|
5197
|
+
/** @description Not found */
|
|
5198
|
+
404: {
|
|
5199
|
+
headers: {
|
|
5200
|
+
[name: string]: unknown;
|
|
5201
|
+
};
|
|
5202
|
+
content: {
|
|
5203
|
+
"application/json": {
|
|
5204
|
+
/** @constant */
|
|
5205
|
+
success: false;
|
|
5206
|
+
code: string;
|
|
5207
|
+
};
|
|
5208
|
+
};
|
|
5209
|
+
};
|
|
5210
|
+
};
|
|
5211
|
+
};
|
|
5050
5212
|
getWalletByPublicKeyBalance: {
|
|
5051
5213
|
parameters: {
|
|
5052
5214
|
query: {
|
|
@@ -5897,4 +6059,4 @@ declare function listDistributionRules(api: PollarApiClient): Promise<Distributi
|
|
|
5897
6059
|
*/
|
|
5898
6060
|
declare function claimDistributionRule(api: PollarApiClient, body: DistributionClaimBody): Promise<DistributionClaimContent>;
|
|
5899
6061
|
|
|
5900
|
-
export { AUTH_ERROR_CODES, type AdapterFn, AlbedoAdapter, type AuthErrorCode, type AuthOpenContext, type AuthState, type AuthUrlOpener, type BuildOutcome, type BuildProofArgs, type ConnectWalletResponse, type DistributionClaimBody, type DistributionClaimContent, type DistributionRule, type DistributionRulesState, type EnabledAssetRecord, type EnabledAssetsState, FreighterAdapter, type KeyManager, type KycFlow, type KycLevel, type KycProvider, type KycStartBody, type KycStartResponse, type KycStatus, type LocalStorageAdapterOptions, type LogLevel, type NetworkState, OnStorageDegrade, POLLAR_CORE_VERSION, type PasskeyCeremony, type PasskeySigner, type PaymentInstructions, type PollarAdapter, type PollarAdapters, type PollarApiClient, type PollarApplicationConfigContent, type PollarApplicationConfigResponse, PollarClient, type PollarClientConfig, PollarFlowError, type PollarLogger, type PollarLoginOptions, type PollarPersistedSession, type PollarUserProfile, type PublicEcJwk, type RampDirection, type RampQuote, type RampTxStatus, type RampsOfframpBody, type RampsOfframpResponse, type RampsOnrampBody, type RampsOnrampResponse, type RampsQuoteQuery, type RampsQuoteResponse, type RampsTransactionResponse, type RulePeriod, type SessionInfo, type SessionsState, type SignAuthEntryOptions, type SignAuthEntryResponse, type SignOutcome, type SignTransactionOptions, type SignTransactionResponse, type StellarBalance, StellarClient, type StellarClientConfig, type StellarNetwork, Storage, type SubmitOutcome, type TransactionState, type TxBuildBody, type TxBuildContent, type TxBuildResponse, type TxBuildSignSubmitBody, type TxBuildSignSubmitContent, type TxBuildSignSubmitResponse, type TxErrorPhase, type TxHistoryContent, type TxHistoryParams, type TxHistoryRecord, type TxHistoryState, type TxSignAndSendBody, type TxSignBody, type TxSignContent, type TxSignResponse, type TxSignSendResponse, type TxSubmitSignedBody, type WalletAdapter, type WalletAdapterResolver, type WalletAssetsContent, type WalletBalanceContent, type WalletBalanceRecord, type WalletBalanceState, type WalletId, WalletType, WebCryptoKeyManager, buildProof, canonicalEcJwk, claimDistributionRule, computeJwkThumbprint, createLocalStorageAdapter, createLogger, createMemoryAdapter, createOffRamp, createOnRamp, defaultKeyManager, defaultStorage, getKycProviders, getKycStatus, getRampTransaction, getRampsQuote, isValidSession, listDistributionRules, normalizeHtu, pollKycStatus, pollRampTransaction, type paths as pollarPaths, resolveKyc, startKyc };
|
|
6062
|
+
export { AUTH_ERROR_CODES, type AdapterFn, AlbedoAdapter, type AuthErrorCode, type AuthOpenContext, type AuthState, type AuthUrlOpener, type BuildOutcome, type BuildProofArgs, type ConnectWalletResponse, type DistributionClaimBody, type DistributionClaimContent, type DistributionRule, type DistributionRulesState, type EnabledAssetRecord, type EnabledAssetsState, FreighterAdapter, type KeyManager, type KycFlow, type KycLevel, type KycProvider, type KycStartBody, type KycStartResponse, type KycStatus, type LocalStorageAdapterOptions, type LogLevel, type NetworkState, OnStorageDegrade, POLLAR_CORE_VERSION, type PasskeyCeremony, type PasskeyMode, type PasskeySigner, type PaymentInstructions, type PollarAdapter, type PollarAdapters, type PollarApiClient, type PollarApplicationConfigContent, type PollarApplicationConfigResponse, PollarClient, type PollarClientConfig, PollarFlowError, type PollarLogger, type PollarLoginOptions, type PollarPersistedSession, type PollarUserProfile, type PublicEcJwk, type RampDirection, type RampQuote, type RampTxStatus, type RampsOfframpBody, type RampsOfframpResponse, type RampsOnrampBody, type RampsOnrampResponse, type RampsQuoteQuery, type RampsQuoteResponse, type RampsTransactionResponse, type RulePeriod, type SessionInfo, type SessionsState, type SignAuthEntryOptions, type SignAuthEntryResponse, type SignOutcome, type SignTransactionOptions, type SignTransactionResponse, type StellarBalance, StellarClient, type StellarClientConfig, type StellarNetwork, Storage, type SubmitOutcome, type TransactionState, type TrustlineOutcome, type TxBuildBody, type TxBuildContent, type TxBuildResponse, type TxBuildSignSubmitBody, type TxBuildSignSubmitContent, type TxBuildSignSubmitResponse, type TxErrorPhase, type TxHistoryContent, type TxHistoryParams, type TxHistoryRecord, type TxHistoryState, type TxSignAndSendBody, type TxSignBody, type TxSignContent, type TxSignResponse, type TxSignSendResponse, type TxSubmitSignedBody, type WalletAdapter, type WalletAdapterResolver, type WalletAssetsContent, type WalletBalanceContent, type WalletBalanceRecord, type WalletBalanceState, type WalletId, WalletType, WebCryptoKeyManager, buildProof, canonicalEcJwk, claimDistributionRule, computeJwkThumbprint, createLocalStorageAdapter, createLogger, createMemoryAdapter, createOffRamp, createOnRamp, defaultKeyManager, defaultStorage, getKycProviders, getKycStatus, getRampTransaction, getRampsQuote, isValidSession, listDistributionRules, normalizeHtu, pollKycStatus, pollRampTransaction, type paths as pollarPaths, resolveKyc, startKyc };
|