@sly_ai/sdk 0.1.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.
Files changed (60) hide show
  1. package/README.md +346 -0
  2. package/dist/a2a.d.mts +108 -0
  3. package/dist/a2a.d.ts +108 -0
  4. package/dist/a2a.js +173 -0
  5. package/dist/a2a.js.map +1 -0
  6. package/dist/a2a.mjs +171 -0
  7. package/dist/a2a.mjs.map +1 -0
  8. package/dist/acp.d.mts +201 -0
  9. package/dist/acp.d.ts +201 -0
  10. package/dist/acp.js +143 -0
  11. package/dist/acp.js.map +1 -0
  12. package/dist/acp.mjs +141 -0
  13. package/dist/acp.mjs.map +1 -0
  14. package/dist/ap2.d.mts +188 -0
  15. package/dist/ap2.d.ts +188 -0
  16. package/dist/ap2.js +135 -0
  17. package/dist/ap2.js.map +1 -0
  18. package/dist/ap2.mjs +133 -0
  19. package/dist/ap2.mjs.map +1 -0
  20. package/dist/cards.d.mts +750 -0
  21. package/dist/cards.d.ts +750 -0
  22. package/dist/cards.js +373 -0
  23. package/dist/cards.js.map +1 -0
  24. package/dist/cards.mjs +369 -0
  25. package/dist/cards.mjs.map +1 -0
  26. package/dist/client-Cwe2CLU7.d.mts +41 -0
  27. package/dist/client-CyJe3uWO.d.ts +41 -0
  28. package/dist/index.d.mts +662 -0
  29. package/dist/index.d.ts +662 -0
  30. package/dist/index.js +2709 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/index.mjs +2700 -0
  33. package/dist/index.mjs.map +1 -0
  34. package/dist/langchain.d.mts +11 -0
  35. package/dist/langchain.d.ts +11 -0
  36. package/dist/langchain.js +25 -0
  37. package/dist/langchain.js.map +1 -0
  38. package/dist/langchain.mjs +23 -0
  39. package/dist/langchain.mjs.map +1 -0
  40. package/dist/types-df1EICn_.d.mts +165 -0
  41. package/dist/types-df1EICn_.d.ts +165 -0
  42. package/dist/ucp.d.mts +844 -0
  43. package/dist/ucp.d.ts +844 -0
  44. package/dist/ucp.js +616 -0
  45. package/dist/ucp.js.map +1 -0
  46. package/dist/ucp.mjs +614 -0
  47. package/dist/ucp.mjs.map +1 -0
  48. package/dist/vercel.d.mts +178 -0
  49. package/dist/vercel.d.ts +178 -0
  50. package/dist/vercel.js +143 -0
  51. package/dist/vercel.js.map +1 -0
  52. package/dist/vercel.mjs +138 -0
  53. package/dist/vercel.mjs.map +1 -0
  54. package/dist/x402.d.mts +209 -0
  55. package/dist/x402.d.ts +209 -0
  56. package/dist/x402.js +476 -0
  57. package/dist/x402.js.map +1 -0
  58. package/dist/x402.mjs +471 -0
  59. package/dist/x402.mjs.map +1 -0
  60. package/package.json +118 -0
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Core type definitions for the Sly SDK
3
+ */
4
+ /**
5
+ * SDK environment configuration
6
+ */
7
+ type SlyEnvironment = 'sandbox' | 'testnet' | 'production';
8
+ type PayOSEnvironment = SlyEnvironment;
9
+ /**
10
+ * Environment-specific configuration
11
+ */
12
+ interface EnvironmentConfig {
13
+ apiUrl: string;
14
+ facilitatorUrl?: string;
15
+ }
16
+ /**
17
+ * Sly SDK configuration options
18
+ */
19
+ interface SlyConfig {
20
+ /**
21
+ * Sly API key
22
+ */
23
+ apiKey: string;
24
+ /**
25
+ * Environment to connect to (optional — auto-inferred from API key prefix)
26
+ * - sandbox: Base Sepolia testnet (pk_test_* / pk_sandbox_*)
27
+ * - testnet: Alias for sandbox
28
+ * - production: Base mainnet (pk_live_*)
29
+ *
30
+ * If omitted, inferred from apiKey prefix. Explicit value overrides inference.
31
+ */
32
+ environment?: SlyEnvironment;
33
+ /**
34
+ * EVM private key (required for testnet/production x402)
35
+ * Not needed for sandbox mode
36
+ */
37
+ evmPrivateKey?: string;
38
+ /**
39
+ * Custom API URL (overrides environment default)
40
+ */
41
+ apiUrl?: string;
42
+ /**
43
+ * Custom facilitator URL for x402 (overrides environment default)
44
+ */
45
+ facilitatorUrl?: string;
46
+ }
47
+ type PayOSConfig = SlyConfig;
48
+ /**
49
+ * Payment protocol types supported by PayOS
50
+ */
51
+ type PaymentProtocol = 'x402' | 'ap2' | 'acp' | 'direct';
52
+ /**
53
+ * Settlement rail types
54
+ */
55
+ type SettlementRail = 'pix' | 'spei' | 'wire' | 'usdc';
56
+ /**
57
+ * Supported currencies
58
+ */
59
+ type Currency = 'USD' | 'BRL' | 'MXN' | 'USDC';
60
+ /**
61
+ * Settlement quote request
62
+ */
63
+ interface SettlementQuoteRequest {
64
+ fromCurrency: Currency;
65
+ toCurrency: Currency;
66
+ amount: string;
67
+ rail?: SettlementRail;
68
+ }
69
+ /**
70
+ * Settlement quote response
71
+ */
72
+ interface SettlementQuote {
73
+ id: string;
74
+ fromCurrency: Currency;
75
+ toCurrency: Currency;
76
+ fromAmount: string;
77
+ toAmount: string;
78
+ fxRate: string;
79
+ fees: {
80
+ platformFee: string;
81
+ fxFee: string;
82
+ railFee: string;
83
+ total: string;
84
+ };
85
+ rail: SettlementRail;
86
+ expiresAt: string;
87
+ estimatedSettlementSeconds: number;
88
+ }
89
+ /**
90
+ * Settlement creation request
91
+ */
92
+ interface CreateSettlementRequest {
93
+ quoteId: string;
94
+ destinationAccountId: string;
95
+ metadata?: Record<string, unknown>;
96
+ }
97
+ /**
98
+ * Settlement status
99
+ */
100
+ type SettlementStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled';
101
+ /**
102
+ * Settlement response
103
+ */
104
+ interface Settlement {
105
+ id: string;
106
+ quoteId: string;
107
+ status: SettlementStatus;
108
+ fromAmount: string;
109
+ fromCurrency: Currency;
110
+ toAmount: string;
111
+ toCurrency: Currency;
112
+ rail: SettlementRail;
113
+ destinationAccountId: string;
114
+ createdAt: string;
115
+ completedAt?: string;
116
+ failureReason?: string;
117
+ metadata?: Record<string, unknown>;
118
+ }
119
+ /**
120
+ * Compliance check request
121
+ */
122
+ interface ComplianceCheckRequest {
123
+ recipientAccountId: string;
124
+ amount: string;
125
+ currency: Currency;
126
+ }
127
+ /**
128
+ * Compliance check response
129
+ */
130
+ interface ComplianceCheckResponse {
131
+ approved: boolean;
132
+ flags: string[];
133
+ requiredActions: string[];
134
+ message?: string;
135
+ }
136
+ /**
137
+ * API capability definition
138
+ */
139
+ interface Capability {
140
+ name: string;
141
+ description: string;
142
+ category: string;
143
+ endpoint: string;
144
+ parameters: Record<string, unknown>;
145
+ returns: Record<string, unknown>;
146
+ errors: string[];
147
+ supportsSimulation: boolean;
148
+ supportsIdempotency: boolean;
149
+ }
150
+ /**
151
+ * Capabilities response
152
+ */
153
+ interface CapabilitiesResponse {
154
+ apiVersion: string;
155
+ capabilities: Capability[];
156
+ limits: {
157
+ rateLimit: string;
158
+ maxTransfer: string;
159
+ };
160
+ supportedCurrencies: Currency[];
161
+ supportedRails: SettlementRail[];
162
+ webhookEvents: string[];
163
+ }
164
+
165
+ export type { ComplianceCheckResponse as C, EnvironmentConfig as E, PayOSEnvironment as P, SettlementQuote as S, Settlement as a, SlyConfig as b, SettlementQuoteRequest as c, CreateSettlementRequest as d, ComplianceCheckRequest as e, CapabilitiesResponse as f, SlyEnvironment as g, Capability as h, PayOSConfig as i, PaymentProtocol as j, SettlementRail as k, Currency as l, SettlementStatus as m };
@@ -0,0 +1,165 @@
1
+ /**
2
+ * Core type definitions for the Sly SDK
3
+ */
4
+ /**
5
+ * SDK environment configuration
6
+ */
7
+ type SlyEnvironment = 'sandbox' | 'testnet' | 'production';
8
+ type PayOSEnvironment = SlyEnvironment;
9
+ /**
10
+ * Environment-specific configuration
11
+ */
12
+ interface EnvironmentConfig {
13
+ apiUrl: string;
14
+ facilitatorUrl?: string;
15
+ }
16
+ /**
17
+ * Sly SDK configuration options
18
+ */
19
+ interface SlyConfig {
20
+ /**
21
+ * Sly API key
22
+ */
23
+ apiKey: string;
24
+ /**
25
+ * Environment to connect to (optional — auto-inferred from API key prefix)
26
+ * - sandbox: Base Sepolia testnet (pk_test_* / pk_sandbox_*)
27
+ * - testnet: Alias for sandbox
28
+ * - production: Base mainnet (pk_live_*)
29
+ *
30
+ * If omitted, inferred from apiKey prefix. Explicit value overrides inference.
31
+ */
32
+ environment?: SlyEnvironment;
33
+ /**
34
+ * EVM private key (required for testnet/production x402)
35
+ * Not needed for sandbox mode
36
+ */
37
+ evmPrivateKey?: string;
38
+ /**
39
+ * Custom API URL (overrides environment default)
40
+ */
41
+ apiUrl?: string;
42
+ /**
43
+ * Custom facilitator URL for x402 (overrides environment default)
44
+ */
45
+ facilitatorUrl?: string;
46
+ }
47
+ type PayOSConfig = SlyConfig;
48
+ /**
49
+ * Payment protocol types supported by PayOS
50
+ */
51
+ type PaymentProtocol = 'x402' | 'ap2' | 'acp' | 'direct';
52
+ /**
53
+ * Settlement rail types
54
+ */
55
+ type SettlementRail = 'pix' | 'spei' | 'wire' | 'usdc';
56
+ /**
57
+ * Supported currencies
58
+ */
59
+ type Currency = 'USD' | 'BRL' | 'MXN' | 'USDC';
60
+ /**
61
+ * Settlement quote request
62
+ */
63
+ interface SettlementQuoteRequest {
64
+ fromCurrency: Currency;
65
+ toCurrency: Currency;
66
+ amount: string;
67
+ rail?: SettlementRail;
68
+ }
69
+ /**
70
+ * Settlement quote response
71
+ */
72
+ interface SettlementQuote {
73
+ id: string;
74
+ fromCurrency: Currency;
75
+ toCurrency: Currency;
76
+ fromAmount: string;
77
+ toAmount: string;
78
+ fxRate: string;
79
+ fees: {
80
+ platformFee: string;
81
+ fxFee: string;
82
+ railFee: string;
83
+ total: string;
84
+ };
85
+ rail: SettlementRail;
86
+ expiresAt: string;
87
+ estimatedSettlementSeconds: number;
88
+ }
89
+ /**
90
+ * Settlement creation request
91
+ */
92
+ interface CreateSettlementRequest {
93
+ quoteId: string;
94
+ destinationAccountId: string;
95
+ metadata?: Record<string, unknown>;
96
+ }
97
+ /**
98
+ * Settlement status
99
+ */
100
+ type SettlementStatus = 'pending' | 'processing' | 'completed' | 'failed' | 'cancelled';
101
+ /**
102
+ * Settlement response
103
+ */
104
+ interface Settlement {
105
+ id: string;
106
+ quoteId: string;
107
+ status: SettlementStatus;
108
+ fromAmount: string;
109
+ fromCurrency: Currency;
110
+ toAmount: string;
111
+ toCurrency: Currency;
112
+ rail: SettlementRail;
113
+ destinationAccountId: string;
114
+ createdAt: string;
115
+ completedAt?: string;
116
+ failureReason?: string;
117
+ metadata?: Record<string, unknown>;
118
+ }
119
+ /**
120
+ * Compliance check request
121
+ */
122
+ interface ComplianceCheckRequest {
123
+ recipientAccountId: string;
124
+ amount: string;
125
+ currency: Currency;
126
+ }
127
+ /**
128
+ * Compliance check response
129
+ */
130
+ interface ComplianceCheckResponse {
131
+ approved: boolean;
132
+ flags: string[];
133
+ requiredActions: string[];
134
+ message?: string;
135
+ }
136
+ /**
137
+ * API capability definition
138
+ */
139
+ interface Capability {
140
+ name: string;
141
+ description: string;
142
+ category: string;
143
+ endpoint: string;
144
+ parameters: Record<string, unknown>;
145
+ returns: Record<string, unknown>;
146
+ errors: string[];
147
+ supportsSimulation: boolean;
148
+ supportsIdempotency: boolean;
149
+ }
150
+ /**
151
+ * Capabilities response
152
+ */
153
+ interface CapabilitiesResponse {
154
+ apiVersion: string;
155
+ capabilities: Capability[];
156
+ limits: {
157
+ rateLimit: string;
158
+ maxTransfer: string;
159
+ };
160
+ supportedCurrencies: Currency[];
161
+ supportedRails: SettlementRail[];
162
+ webhookEvents: string[];
163
+ }
164
+
165
+ export type { ComplianceCheckResponse as C, EnvironmentConfig as E, PayOSEnvironment as P, SettlementQuote as S, Settlement as a, SlyConfig as b, SettlementQuoteRequest as c, CreateSettlementRequest as d, ComplianceCheckRequest as e, CapabilitiesResponse as f, SlyEnvironment as g, Capability as h, PayOSConfig as i, PaymentProtocol as j, SettlementRail as k, Currency as l, SettlementStatus as m };