@unicitylabs/sphere-sdk 0.14.0-dev.6 → 0.14.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/dist/connect/index.cjs +1 -1
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.js +1 -1
- package/dist/connect/index.js.map +1 -1
- package/dist/core/index.cjs +416 -223
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +111 -108
- package/dist/core/index.d.ts +111 -108
- package/dist/core/index.js +416 -223
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/connect/index.cjs +1 -1
- package/dist/impl/browser/connect/index.cjs.map +1 -1
- package/dist/impl/browser/connect/index.js +1 -1
- package/dist/impl/browser/connect/index.js.map +1 -1
- package/dist/impl/wallet-api-v2/index.cjs +38 -5
- package/dist/impl/wallet-api-v2/index.cjs.map +1 -1
- package/dist/impl/wallet-api-v2/index.d.cts +23 -2
- package/dist/impl/wallet-api-v2/index.d.ts +23 -2
- package/dist/impl/wallet-api-v2/index.js +38 -5
- package/dist/impl/wallet-api-v2/index.js.map +1 -1
- package/dist/index.cjs +416 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +112 -109
- package/dist/index.d.ts +112 -109
- package/dist/index.js +416 -223
- package/dist/index.js.map +1 -1
- package/dist/modules/payments-v2/index.cjs +340 -199
- package/dist/modules/payments-v2/index.cjs.map +1 -1
- package/dist/modules/payments-v2/index.d.cts +68 -19
- package/dist/modules/payments-v2/index.d.ts +68 -19
- package/dist/modules/payments-v2/index.js +339 -199
- package/dist/modules/payments-v2/index.js.map +1 -1
- package/package.json +1 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -2631,7 +2631,7 @@ declare class PaymentsModule {
|
|
|
2631
2631
|
onPaymentRequest(handler: PaymentRequestHandler): () => void;
|
|
2632
2632
|
/** Get all payment requests. @see PaymentRequests.getPaymentRequests */
|
|
2633
2633
|
getPaymentRequests(filter?: {
|
|
2634
|
-
status?: PaymentRequestStatus
|
|
2634
|
+
status?: PaymentRequestStatus;
|
|
2635
2635
|
}): IncomingPaymentRequest[];
|
|
2636
2636
|
/** Count of incoming payment requests with status `'pending'`. @see PaymentRequests.getPendingPaymentRequestsCount */
|
|
2637
2637
|
getPendingPaymentRequestsCount(): number;
|
|
@@ -2645,7 +2645,7 @@ declare class PaymentsModule {
|
|
|
2645
2645
|
payPaymentRequest(requestId: string, memo?: string): Promise<TransferResult>;
|
|
2646
2646
|
/** Get outgoing payment requests. @see PaymentRequests.getOutgoingPaymentRequests */
|
|
2647
2647
|
getOutgoingPaymentRequests(filter?: {
|
|
2648
|
-
status?: PaymentRequestStatus
|
|
2648
|
+
status?: PaymentRequestStatus;
|
|
2649
2649
|
}): OutgoingPaymentRequest[];
|
|
2650
2650
|
/** Subscribe to payment request responses. @see PaymentRequests.onPaymentRequestResponse */
|
|
2651
2651
|
onPaymentRequestResponse(handler: PaymentRequestResponseHandler): () => void;
|
|
@@ -4060,6 +4060,107 @@ interface FailedNoticeInfo {
|
|
|
4060
4060
|
readonly error?: string;
|
|
4061
4061
|
}
|
|
4062
4062
|
|
|
4063
|
+
interface SendRequest {
|
|
4064
|
+
recipient: string;
|
|
4065
|
+
amount: string;
|
|
4066
|
+
coinId: string;
|
|
4067
|
+
memo?: string;
|
|
4068
|
+
}
|
|
4069
|
+
interface MintResult {
|
|
4070
|
+
success: boolean;
|
|
4071
|
+
tokenId?: string;
|
|
4072
|
+
error?: string;
|
|
4073
|
+
}
|
|
4074
|
+
interface HistoryEntry {
|
|
4075
|
+
id: string;
|
|
4076
|
+
type: 'SENT' | 'RECEIVED' | 'MINT';
|
|
4077
|
+
coinId: string;
|
|
4078
|
+
amount: string;
|
|
4079
|
+
symbol?: string;
|
|
4080
|
+
timestamp: number;
|
|
4081
|
+
memo?: string;
|
|
4082
|
+
transferId?: string;
|
|
4083
|
+
tokenId?: string;
|
|
4084
|
+
senderPubkey?: string;
|
|
4085
|
+
senderNametag?: string;
|
|
4086
|
+
recipientPubkey?: string;
|
|
4087
|
+
recipientNametag?: string;
|
|
4088
|
+
tokenIds?: {
|
|
4089
|
+
id: string;
|
|
4090
|
+
amount: string;
|
|
4091
|
+
}[];
|
|
4092
|
+
}
|
|
4093
|
+
interface HistoryPage {
|
|
4094
|
+
entries: HistoryEntry[];
|
|
4095
|
+
more: boolean;
|
|
4096
|
+
cursor: string | null;
|
|
4097
|
+
}
|
|
4098
|
+
type PaymentRequestStatus$1 = 'pending' | 'settling' | 'paid' | 'rejected' | 'expired';
|
|
4099
|
+
interface PaymentRequestView {
|
|
4100
|
+
id: string;
|
|
4101
|
+
requestId: string;
|
|
4102
|
+
senderPubkey: string;
|
|
4103
|
+
senderNametag?: string;
|
|
4104
|
+
amount: string;
|
|
4105
|
+
coinId: string;
|
|
4106
|
+
symbol?: string;
|
|
4107
|
+
message?: string;
|
|
4108
|
+
timestamp: number;
|
|
4109
|
+
status: PaymentRequestStatus$1;
|
|
4110
|
+
}
|
|
4111
|
+
interface PaymentsRequestsApi {
|
|
4112
|
+
create(to: string, terms: {
|
|
4113
|
+
coinId: string;
|
|
4114
|
+
amount: string;
|
|
4115
|
+
memo?: string;
|
|
4116
|
+
}): Promise<{
|
|
4117
|
+
success: boolean;
|
|
4118
|
+
requestId?: string;
|
|
4119
|
+
error?: string;
|
|
4120
|
+
}>;
|
|
4121
|
+
list(): PaymentRequestView[];
|
|
4122
|
+
pay(id: string): Promise<TransferResult>;
|
|
4123
|
+
decline(id: string): Promise<void>;
|
|
4124
|
+
dismissProcessed(): void;
|
|
4125
|
+
}
|
|
4126
|
+
/**
|
|
4127
|
+
* A pending-transfers row, derived ON READ from the §6 stores (intent backstop
|
|
4128
|
+
* + delivery journal + shortfalls) — never a cached mirror. kind 'shortfall' =
|
|
4129
|
+
* a completed partial (#690) whose `amount` is the remainder still owed;
|
|
4130
|
+
* legs.certified counts journaled legs (certified, delivery still owed).
|
|
4131
|
+
*/
|
|
4132
|
+
interface PendingTransfer {
|
|
4133
|
+
transferId: string;
|
|
4134
|
+
kind: 'open' | 'shortfall';
|
|
4135
|
+
recipient: string;
|
|
4136
|
+
coinId: string;
|
|
4137
|
+
amount: string;
|
|
4138
|
+
legs: {
|
|
4139
|
+
certified: number;
|
|
4140
|
+
total: number;
|
|
4141
|
+
};
|
|
4142
|
+
deliveryPending: boolean;
|
|
4143
|
+
createdAt: number;
|
|
4144
|
+
}
|
|
4145
|
+
interface PaymentsV2 {
|
|
4146
|
+
assets(coinId?: string): Promise<Asset[]>;
|
|
4147
|
+
tokens(filter?: {
|
|
4148
|
+
coinId?: string;
|
|
4149
|
+
}): Token[];
|
|
4150
|
+
history(page?: {
|
|
4151
|
+
before?: string;
|
|
4152
|
+
limit?: number;
|
|
4153
|
+
}): Promise<HistoryPage>;
|
|
4154
|
+
send(req: SendRequest): Promise<TransferResult>;
|
|
4155
|
+
mint(coinId: string, amount: bigint): Promise<MintResult>;
|
|
4156
|
+
receive(): Promise<{
|
|
4157
|
+
transfers: IncomingTransfer[];
|
|
4158
|
+
}>;
|
|
4159
|
+
pendingTransfers(): Promise<PendingTransfer[]>;
|
|
4160
|
+
resumeNow(): Promise<void>;
|
|
4161
|
+
readonly requests: PaymentsRequestsApi;
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4063
4164
|
/**
|
|
4064
4165
|
* Group Chat Types (NIP-29)
|
|
4065
4166
|
* Plain interfaces for SDK consumers — no classes, no UI helpers.
|
|
@@ -4473,7 +4574,7 @@ interface IncomingTransfer {
|
|
|
4473
4574
|
readonly memo?: string;
|
|
4474
4575
|
readonly receivedAt: number;
|
|
4475
4576
|
}
|
|
4476
|
-
type PaymentRequestStatus
|
|
4577
|
+
type PaymentRequestStatus = 'pending' | 'rejected' | 'paid' | 'expired' | 'settling';
|
|
4477
4578
|
/**
|
|
4478
4579
|
* Outgoing payment request (requesting payment from someone)
|
|
4479
4580
|
*/
|
|
@@ -4514,7 +4615,7 @@ interface IncomingPaymentRequest {
|
|
|
4514
4615
|
/** Timestamp */
|
|
4515
4616
|
readonly timestamp: number;
|
|
4516
4617
|
/** Current status */
|
|
4517
|
-
status: PaymentRequestStatus
|
|
4618
|
+
status: PaymentRequestStatus;
|
|
4518
4619
|
}
|
|
4519
4620
|
/**
|
|
4520
4621
|
* Result of sending a payment request
|
|
@@ -4554,7 +4655,7 @@ interface OutgoingPaymentRequest {
|
|
|
4554
4655
|
/** Created timestamp */
|
|
4555
4656
|
readonly createdAt: number;
|
|
4556
4657
|
/** Current status */
|
|
4557
|
-
status: PaymentRequestStatus
|
|
4658
|
+
status: PaymentRequestStatus;
|
|
4558
4659
|
/** Response data (if received) */
|
|
4559
4660
|
response?: PaymentRequestResponse;
|
|
4560
4661
|
}
|
|
@@ -4851,7 +4952,7 @@ interface SphereEventMap {
|
|
|
4851
4952
|
'communications:ready': {
|
|
4852
4953
|
conversationCount: number;
|
|
4853
4954
|
};
|
|
4854
|
-
'history:updated': TransactionHistoryEntry;
|
|
4955
|
+
'history:updated': TransactionHistoryEntry | HistoryEntry;
|
|
4855
4956
|
/** Replaces transfer:confirmed / :delivery_pending / :failed on the v2 vertical. */
|
|
4856
4957
|
'transfer:updated': TransferResult;
|
|
4857
4958
|
/** Replaces split:checkpoint-stuck / delivery:undeliverable / delivery:deferred (by code). */
|
|
@@ -7080,107 +7181,6 @@ interface DerivedAddressInfo {
|
|
|
7080
7181
|
*/
|
|
7081
7182
|
declare function discoverAddressesImpl(deriveTransportPubkey: (index: number) => DerivedAddressInfo, batchResolve: (transportPubkeys: string[]) => Promise<PeerInfo[]>, options?: DiscoverAddressesOptions): Promise<DiscoverAddressesResult>;
|
|
7082
7183
|
|
|
7083
|
-
interface SendRequest {
|
|
7084
|
-
recipient: string;
|
|
7085
|
-
amount: string;
|
|
7086
|
-
coinId: string;
|
|
7087
|
-
memo?: string;
|
|
7088
|
-
}
|
|
7089
|
-
interface MintResult {
|
|
7090
|
-
success: boolean;
|
|
7091
|
-
tokenId?: string;
|
|
7092
|
-
error?: string;
|
|
7093
|
-
}
|
|
7094
|
-
interface HistoryEntry {
|
|
7095
|
-
id: string;
|
|
7096
|
-
type: 'SENT' | 'RECEIVED' | 'MINT';
|
|
7097
|
-
coinId: string;
|
|
7098
|
-
amount: string;
|
|
7099
|
-
symbol?: string;
|
|
7100
|
-
timestamp: number;
|
|
7101
|
-
memo?: string;
|
|
7102
|
-
transferId?: string;
|
|
7103
|
-
tokenId?: string;
|
|
7104
|
-
senderPubkey?: string;
|
|
7105
|
-
senderNametag?: string;
|
|
7106
|
-
recipientPubkey?: string;
|
|
7107
|
-
recipientNametag?: string;
|
|
7108
|
-
tokenIds?: {
|
|
7109
|
-
id: string;
|
|
7110
|
-
amount: string;
|
|
7111
|
-
}[];
|
|
7112
|
-
}
|
|
7113
|
-
interface HistoryPage {
|
|
7114
|
-
entries: HistoryEntry[];
|
|
7115
|
-
more: boolean;
|
|
7116
|
-
cursor: string | null;
|
|
7117
|
-
}
|
|
7118
|
-
type PaymentRequestStatus = 'pending' | 'settling' | 'paid' | 'rejected' | 'expired';
|
|
7119
|
-
interface PaymentRequestView {
|
|
7120
|
-
id: string;
|
|
7121
|
-
requestId: string;
|
|
7122
|
-
senderPubkey: string;
|
|
7123
|
-
senderNametag?: string;
|
|
7124
|
-
amount: string;
|
|
7125
|
-
coinId: string;
|
|
7126
|
-
symbol?: string;
|
|
7127
|
-
message?: string;
|
|
7128
|
-
timestamp: number;
|
|
7129
|
-
status: PaymentRequestStatus;
|
|
7130
|
-
}
|
|
7131
|
-
interface PaymentsRequestsApi {
|
|
7132
|
-
create(to: string, terms: {
|
|
7133
|
-
coinId: string;
|
|
7134
|
-
amount: string;
|
|
7135
|
-
memo?: string;
|
|
7136
|
-
}): Promise<{
|
|
7137
|
-
success: boolean;
|
|
7138
|
-
requestId?: string;
|
|
7139
|
-
error?: string;
|
|
7140
|
-
}>;
|
|
7141
|
-
list(): PaymentRequestView[];
|
|
7142
|
-
pay(id: string): Promise<TransferResult>;
|
|
7143
|
-
decline(id: string): Promise<void>;
|
|
7144
|
-
dismissProcessed(): void;
|
|
7145
|
-
}
|
|
7146
|
-
/**
|
|
7147
|
-
* A pending-transfers row, derived ON READ from the §6 stores (intent backstop
|
|
7148
|
-
* + delivery journal + shortfalls) — never a cached mirror. kind 'shortfall' =
|
|
7149
|
-
* a completed partial (#690) whose `amount` is the remainder still owed;
|
|
7150
|
-
* legs.certified counts journaled legs (certified, delivery still owed).
|
|
7151
|
-
*/
|
|
7152
|
-
interface PendingTransfer {
|
|
7153
|
-
transferId: string;
|
|
7154
|
-
kind: 'open' | 'shortfall';
|
|
7155
|
-
recipient: string;
|
|
7156
|
-
coinId: string;
|
|
7157
|
-
amount: string;
|
|
7158
|
-
legs: {
|
|
7159
|
-
certified: number;
|
|
7160
|
-
total: number;
|
|
7161
|
-
};
|
|
7162
|
-
deliveryPending: boolean;
|
|
7163
|
-
createdAt: number;
|
|
7164
|
-
}
|
|
7165
|
-
interface PaymentsV2 {
|
|
7166
|
-
assets(coinId?: string): Promise<Asset[]>;
|
|
7167
|
-
tokens(filter?: {
|
|
7168
|
-
coinId?: string;
|
|
7169
|
-
}): Token[];
|
|
7170
|
-
history(page?: {
|
|
7171
|
-
before?: string;
|
|
7172
|
-
limit?: number;
|
|
7173
|
-
}): Promise<HistoryPage>;
|
|
7174
|
-
send(req: SendRequest): Promise<TransferResult>;
|
|
7175
|
-
mint(coinId: string, amount: bigint): Promise<MintResult>;
|
|
7176
|
-
receive(): Promise<{
|
|
7177
|
-
transfers: IncomingTransfer[];
|
|
7178
|
-
}>;
|
|
7179
|
-
pendingTransfers(): Promise<PendingTransfer[]>;
|
|
7180
|
-
resumeNow(): Promise<void>;
|
|
7181
|
-
readonly requests: PaymentsRequestsApi;
|
|
7182
|
-
}
|
|
7183
|
-
|
|
7184
7184
|
/**
|
|
7185
7185
|
* Text Wallet Backup Serialization Types
|
|
7186
7186
|
*/
|
|
@@ -7757,7 +7757,10 @@ declare class Sphere {
|
|
|
7757
7757
|
private static resolveSwapConfig;
|
|
7758
7758
|
/**
|
|
7759
7759
|
* P9: validate + resolve the paymentsV2 opt-in BEFORE any storage writes —
|
|
7760
|
-
* fail-closed at init, never a silently-degraded composition.
|
|
7760
|
+
* fail-closed at init, never a silently-degraded composition. Returns the
|
|
7761
|
+
* resolved composition (null = flag off); #728: resolving here also asserts
|
|
7762
|
+
* the single-network invariant (walletApi.network known + equal to the
|
|
7763
|
+
* Sphere network) before any session/KV/provider exists.
|
|
7761
7764
|
*/
|
|
7762
7765
|
private static resolvePaymentsV2Flag;
|
|
7763
7766
|
/**
|
package/dist/core/index.d.ts
CHANGED
|
@@ -2631,7 +2631,7 @@ declare class PaymentsModule {
|
|
|
2631
2631
|
onPaymentRequest(handler: PaymentRequestHandler): () => void;
|
|
2632
2632
|
/** Get all payment requests. @see PaymentRequests.getPaymentRequests */
|
|
2633
2633
|
getPaymentRequests(filter?: {
|
|
2634
|
-
status?: PaymentRequestStatus
|
|
2634
|
+
status?: PaymentRequestStatus;
|
|
2635
2635
|
}): IncomingPaymentRequest[];
|
|
2636
2636
|
/** Count of incoming payment requests with status `'pending'`. @see PaymentRequests.getPendingPaymentRequestsCount */
|
|
2637
2637
|
getPendingPaymentRequestsCount(): number;
|
|
@@ -2645,7 +2645,7 @@ declare class PaymentsModule {
|
|
|
2645
2645
|
payPaymentRequest(requestId: string, memo?: string): Promise<TransferResult>;
|
|
2646
2646
|
/** Get outgoing payment requests. @see PaymentRequests.getOutgoingPaymentRequests */
|
|
2647
2647
|
getOutgoingPaymentRequests(filter?: {
|
|
2648
|
-
status?: PaymentRequestStatus
|
|
2648
|
+
status?: PaymentRequestStatus;
|
|
2649
2649
|
}): OutgoingPaymentRequest[];
|
|
2650
2650
|
/** Subscribe to payment request responses. @see PaymentRequests.onPaymentRequestResponse */
|
|
2651
2651
|
onPaymentRequestResponse(handler: PaymentRequestResponseHandler): () => void;
|
|
@@ -4060,6 +4060,107 @@ interface FailedNoticeInfo {
|
|
|
4060
4060
|
readonly error?: string;
|
|
4061
4061
|
}
|
|
4062
4062
|
|
|
4063
|
+
interface SendRequest {
|
|
4064
|
+
recipient: string;
|
|
4065
|
+
amount: string;
|
|
4066
|
+
coinId: string;
|
|
4067
|
+
memo?: string;
|
|
4068
|
+
}
|
|
4069
|
+
interface MintResult {
|
|
4070
|
+
success: boolean;
|
|
4071
|
+
tokenId?: string;
|
|
4072
|
+
error?: string;
|
|
4073
|
+
}
|
|
4074
|
+
interface HistoryEntry {
|
|
4075
|
+
id: string;
|
|
4076
|
+
type: 'SENT' | 'RECEIVED' | 'MINT';
|
|
4077
|
+
coinId: string;
|
|
4078
|
+
amount: string;
|
|
4079
|
+
symbol?: string;
|
|
4080
|
+
timestamp: number;
|
|
4081
|
+
memo?: string;
|
|
4082
|
+
transferId?: string;
|
|
4083
|
+
tokenId?: string;
|
|
4084
|
+
senderPubkey?: string;
|
|
4085
|
+
senderNametag?: string;
|
|
4086
|
+
recipientPubkey?: string;
|
|
4087
|
+
recipientNametag?: string;
|
|
4088
|
+
tokenIds?: {
|
|
4089
|
+
id: string;
|
|
4090
|
+
amount: string;
|
|
4091
|
+
}[];
|
|
4092
|
+
}
|
|
4093
|
+
interface HistoryPage {
|
|
4094
|
+
entries: HistoryEntry[];
|
|
4095
|
+
more: boolean;
|
|
4096
|
+
cursor: string | null;
|
|
4097
|
+
}
|
|
4098
|
+
type PaymentRequestStatus$1 = 'pending' | 'settling' | 'paid' | 'rejected' | 'expired';
|
|
4099
|
+
interface PaymentRequestView {
|
|
4100
|
+
id: string;
|
|
4101
|
+
requestId: string;
|
|
4102
|
+
senderPubkey: string;
|
|
4103
|
+
senderNametag?: string;
|
|
4104
|
+
amount: string;
|
|
4105
|
+
coinId: string;
|
|
4106
|
+
symbol?: string;
|
|
4107
|
+
message?: string;
|
|
4108
|
+
timestamp: number;
|
|
4109
|
+
status: PaymentRequestStatus$1;
|
|
4110
|
+
}
|
|
4111
|
+
interface PaymentsRequestsApi {
|
|
4112
|
+
create(to: string, terms: {
|
|
4113
|
+
coinId: string;
|
|
4114
|
+
amount: string;
|
|
4115
|
+
memo?: string;
|
|
4116
|
+
}): Promise<{
|
|
4117
|
+
success: boolean;
|
|
4118
|
+
requestId?: string;
|
|
4119
|
+
error?: string;
|
|
4120
|
+
}>;
|
|
4121
|
+
list(): PaymentRequestView[];
|
|
4122
|
+
pay(id: string): Promise<TransferResult>;
|
|
4123
|
+
decline(id: string): Promise<void>;
|
|
4124
|
+
dismissProcessed(): void;
|
|
4125
|
+
}
|
|
4126
|
+
/**
|
|
4127
|
+
* A pending-transfers row, derived ON READ from the §6 stores (intent backstop
|
|
4128
|
+
* + delivery journal + shortfalls) — never a cached mirror. kind 'shortfall' =
|
|
4129
|
+
* a completed partial (#690) whose `amount` is the remainder still owed;
|
|
4130
|
+
* legs.certified counts journaled legs (certified, delivery still owed).
|
|
4131
|
+
*/
|
|
4132
|
+
interface PendingTransfer {
|
|
4133
|
+
transferId: string;
|
|
4134
|
+
kind: 'open' | 'shortfall';
|
|
4135
|
+
recipient: string;
|
|
4136
|
+
coinId: string;
|
|
4137
|
+
amount: string;
|
|
4138
|
+
legs: {
|
|
4139
|
+
certified: number;
|
|
4140
|
+
total: number;
|
|
4141
|
+
};
|
|
4142
|
+
deliveryPending: boolean;
|
|
4143
|
+
createdAt: number;
|
|
4144
|
+
}
|
|
4145
|
+
interface PaymentsV2 {
|
|
4146
|
+
assets(coinId?: string): Promise<Asset[]>;
|
|
4147
|
+
tokens(filter?: {
|
|
4148
|
+
coinId?: string;
|
|
4149
|
+
}): Token[];
|
|
4150
|
+
history(page?: {
|
|
4151
|
+
before?: string;
|
|
4152
|
+
limit?: number;
|
|
4153
|
+
}): Promise<HistoryPage>;
|
|
4154
|
+
send(req: SendRequest): Promise<TransferResult>;
|
|
4155
|
+
mint(coinId: string, amount: bigint): Promise<MintResult>;
|
|
4156
|
+
receive(): Promise<{
|
|
4157
|
+
transfers: IncomingTransfer[];
|
|
4158
|
+
}>;
|
|
4159
|
+
pendingTransfers(): Promise<PendingTransfer[]>;
|
|
4160
|
+
resumeNow(): Promise<void>;
|
|
4161
|
+
readonly requests: PaymentsRequestsApi;
|
|
4162
|
+
}
|
|
4163
|
+
|
|
4063
4164
|
/**
|
|
4064
4165
|
* Group Chat Types (NIP-29)
|
|
4065
4166
|
* Plain interfaces for SDK consumers — no classes, no UI helpers.
|
|
@@ -4473,7 +4574,7 @@ interface IncomingTransfer {
|
|
|
4473
4574
|
readonly memo?: string;
|
|
4474
4575
|
readonly receivedAt: number;
|
|
4475
4576
|
}
|
|
4476
|
-
type PaymentRequestStatus
|
|
4577
|
+
type PaymentRequestStatus = 'pending' | 'rejected' | 'paid' | 'expired' | 'settling';
|
|
4477
4578
|
/**
|
|
4478
4579
|
* Outgoing payment request (requesting payment from someone)
|
|
4479
4580
|
*/
|
|
@@ -4514,7 +4615,7 @@ interface IncomingPaymentRequest {
|
|
|
4514
4615
|
/** Timestamp */
|
|
4515
4616
|
readonly timestamp: number;
|
|
4516
4617
|
/** Current status */
|
|
4517
|
-
status: PaymentRequestStatus
|
|
4618
|
+
status: PaymentRequestStatus;
|
|
4518
4619
|
}
|
|
4519
4620
|
/**
|
|
4520
4621
|
* Result of sending a payment request
|
|
@@ -4554,7 +4655,7 @@ interface OutgoingPaymentRequest {
|
|
|
4554
4655
|
/** Created timestamp */
|
|
4555
4656
|
readonly createdAt: number;
|
|
4556
4657
|
/** Current status */
|
|
4557
|
-
status: PaymentRequestStatus
|
|
4658
|
+
status: PaymentRequestStatus;
|
|
4558
4659
|
/** Response data (if received) */
|
|
4559
4660
|
response?: PaymentRequestResponse;
|
|
4560
4661
|
}
|
|
@@ -4851,7 +4952,7 @@ interface SphereEventMap {
|
|
|
4851
4952
|
'communications:ready': {
|
|
4852
4953
|
conversationCount: number;
|
|
4853
4954
|
};
|
|
4854
|
-
'history:updated': TransactionHistoryEntry;
|
|
4955
|
+
'history:updated': TransactionHistoryEntry | HistoryEntry;
|
|
4855
4956
|
/** Replaces transfer:confirmed / :delivery_pending / :failed on the v2 vertical. */
|
|
4856
4957
|
'transfer:updated': TransferResult;
|
|
4857
4958
|
/** Replaces split:checkpoint-stuck / delivery:undeliverable / delivery:deferred (by code). */
|
|
@@ -7080,107 +7181,6 @@ interface DerivedAddressInfo {
|
|
|
7080
7181
|
*/
|
|
7081
7182
|
declare function discoverAddressesImpl(deriveTransportPubkey: (index: number) => DerivedAddressInfo, batchResolve: (transportPubkeys: string[]) => Promise<PeerInfo[]>, options?: DiscoverAddressesOptions): Promise<DiscoverAddressesResult>;
|
|
7082
7183
|
|
|
7083
|
-
interface SendRequest {
|
|
7084
|
-
recipient: string;
|
|
7085
|
-
amount: string;
|
|
7086
|
-
coinId: string;
|
|
7087
|
-
memo?: string;
|
|
7088
|
-
}
|
|
7089
|
-
interface MintResult {
|
|
7090
|
-
success: boolean;
|
|
7091
|
-
tokenId?: string;
|
|
7092
|
-
error?: string;
|
|
7093
|
-
}
|
|
7094
|
-
interface HistoryEntry {
|
|
7095
|
-
id: string;
|
|
7096
|
-
type: 'SENT' | 'RECEIVED' | 'MINT';
|
|
7097
|
-
coinId: string;
|
|
7098
|
-
amount: string;
|
|
7099
|
-
symbol?: string;
|
|
7100
|
-
timestamp: number;
|
|
7101
|
-
memo?: string;
|
|
7102
|
-
transferId?: string;
|
|
7103
|
-
tokenId?: string;
|
|
7104
|
-
senderPubkey?: string;
|
|
7105
|
-
senderNametag?: string;
|
|
7106
|
-
recipientPubkey?: string;
|
|
7107
|
-
recipientNametag?: string;
|
|
7108
|
-
tokenIds?: {
|
|
7109
|
-
id: string;
|
|
7110
|
-
amount: string;
|
|
7111
|
-
}[];
|
|
7112
|
-
}
|
|
7113
|
-
interface HistoryPage {
|
|
7114
|
-
entries: HistoryEntry[];
|
|
7115
|
-
more: boolean;
|
|
7116
|
-
cursor: string | null;
|
|
7117
|
-
}
|
|
7118
|
-
type PaymentRequestStatus = 'pending' | 'settling' | 'paid' | 'rejected' | 'expired';
|
|
7119
|
-
interface PaymentRequestView {
|
|
7120
|
-
id: string;
|
|
7121
|
-
requestId: string;
|
|
7122
|
-
senderPubkey: string;
|
|
7123
|
-
senderNametag?: string;
|
|
7124
|
-
amount: string;
|
|
7125
|
-
coinId: string;
|
|
7126
|
-
symbol?: string;
|
|
7127
|
-
message?: string;
|
|
7128
|
-
timestamp: number;
|
|
7129
|
-
status: PaymentRequestStatus;
|
|
7130
|
-
}
|
|
7131
|
-
interface PaymentsRequestsApi {
|
|
7132
|
-
create(to: string, terms: {
|
|
7133
|
-
coinId: string;
|
|
7134
|
-
amount: string;
|
|
7135
|
-
memo?: string;
|
|
7136
|
-
}): Promise<{
|
|
7137
|
-
success: boolean;
|
|
7138
|
-
requestId?: string;
|
|
7139
|
-
error?: string;
|
|
7140
|
-
}>;
|
|
7141
|
-
list(): PaymentRequestView[];
|
|
7142
|
-
pay(id: string): Promise<TransferResult>;
|
|
7143
|
-
decline(id: string): Promise<void>;
|
|
7144
|
-
dismissProcessed(): void;
|
|
7145
|
-
}
|
|
7146
|
-
/**
|
|
7147
|
-
* A pending-transfers row, derived ON READ from the §6 stores (intent backstop
|
|
7148
|
-
* + delivery journal + shortfalls) — never a cached mirror. kind 'shortfall' =
|
|
7149
|
-
* a completed partial (#690) whose `amount` is the remainder still owed;
|
|
7150
|
-
* legs.certified counts journaled legs (certified, delivery still owed).
|
|
7151
|
-
*/
|
|
7152
|
-
interface PendingTransfer {
|
|
7153
|
-
transferId: string;
|
|
7154
|
-
kind: 'open' | 'shortfall';
|
|
7155
|
-
recipient: string;
|
|
7156
|
-
coinId: string;
|
|
7157
|
-
amount: string;
|
|
7158
|
-
legs: {
|
|
7159
|
-
certified: number;
|
|
7160
|
-
total: number;
|
|
7161
|
-
};
|
|
7162
|
-
deliveryPending: boolean;
|
|
7163
|
-
createdAt: number;
|
|
7164
|
-
}
|
|
7165
|
-
interface PaymentsV2 {
|
|
7166
|
-
assets(coinId?: string): Promise<Asset[]>;
|
|
7167
|
-
tokens(filter?: {
|
|
7168
|
-
coinId?: string;
|
|
7169
|
-
}): Token[];
|
|
7170
|
-
history(page?: {
|
|
7171
|
-
before?: string;
|
|
7172
|
-
limit?: number;
|
|
7173
|
-
}): Promise<HistoryPage>;
|
|
7174
|
-
send(req: SendRequest): Promise<TransferResult>;
|
|
7175
|
-
mint(coinId: string, amount: bigint): Promise<MintResult>;
|
|
7176
|
-
receive(): Promise<{
|
|
7177
|
-
transfers: IncomingTransfer[];
|
|
7178
|
-
}>;
|
|
7179
|
-
pendingTransfers(): Promise<PendingTransfer[]>;
|
|
7180
|
-
resumeNow(): Promise<void>;
|
|
7181
|
-
readonly requests: PaymentsRequestsApi;
|
|
7182
|
-
}
|
|
7183
|
-
|
|
7184
7184
|
/**
|
|
7185
7185
|
* Text Wallet Backup Serialization Types
|
|
7186
7186
|
*/
|
|
@@ -7757,7 +7757,10 @@ declare class Sphere {
|
|
|
7757
7757
|
private static resolveSwapConfig;
|
|
7758
7758
|
/**
|
|
7759
7759
|
* P9: validate + resolve the paymentsV2 opt-in BEFORE any storage writes —
|
|
7760
|
-
* fail-closed at init, never a silently-degraded composition.
|
|
7760
|
+
* fail-closed at init, never a silently-degraded composition. Returns the
|
|
7761
|
+
* resolved composition (null = flag off); #728: resolving here also asserts
|
|
7762
|
+
* the single-network invariant (walletApi.network known + equal to the
|
|
7763
|
+
* Sphere network) before any session/KV/provider exists.
|
|
7761
7764
|
*/
|
|
7762
7765
|
private static resolvePaymentsV2Flag;
|
|
7763
7766
|
/**
|