@orbi-wallet/sdk 0.0.1
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/client.d.ts +99 -0
- package/dist/client.js +213 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +7 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.js +2 -0
- package/dist/wallet.d.ts +16 -0
- package/dist/wallet.js +33 -0
- package/package.json +32 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @orbi/sdk — Orbi Smart Wallet SDK
|
|
3
|
+
*
|
|
4
|
+
* Lets any Stellar dApp integrate Orbi passkey wallets using a redirect flow.
|
|
5
|
+
* Works on all devices and browsers — no popups, no extensions needed.
|
|
6
|
+
*
|
|
7
|
+
* Quick start (user pays gas):
|
|
8
|
+
* const orbi = new OrbiClient({ apiUrl: 'https://api.orbiwallet.xyz' });
|
|
9
|
+
*
|
|
10
|
+
* Quick start (dApp sponsors gas):
|
|
11
|
+
* const orbi = new OrbiClient({
|
|
12
|
+
* apiUrl: 'https://api.orbiwallet.xyz',
|
|
13
|
+
* apiKey: 'YOUR_API_KEY', // <-- enables gasless
|
|
14
|
+
* });
|
|
15
|
+
*
|
|
16
|
+
* Flow:
|
|
17
|
+
* 1. orbi.connect({ redirectUrl }) — redirect user to connect wallet
|
|
18
|
+
* 2. orbi.handleCallback() — on return, exchange token for wallet data
|
|
19
|
+
* 3. orbi.sign({ ..., redirectUrl }) — redirect user to approve transaction
|
|
20
|
+
* 4. orbi.handleSignCallback() → bundle() — on return, submit signed tx
|
|
21
|
+
* 5. orbi.waitForConfirmation(opId) — wait for on-chain confirmation
|
|
22
|
+
*/
|
|
23
|
+
import type { OrbiClientConfig, OpStatus, DeployerBalance } from './types';
|
|
24
|
+
export declare class OrbiClient {
|
|
25
|
+
private apiUrl;
|
|
26
|
+
private apiKey?;
|
|
27
|
+
constructor(config: OrbiClientConfig);
|
|
28
|
+
private authHeaders;
|
|
29
|
+
/** Redirect the user to Orbi to connect their wallet. */
|
|
30
|
+
connect(params: {
|
|
31
|
+
redirectUrl: string;
|
|
32
|
+
}): void;
|
|
33
|
+
/** Call this on your callback page after orbi.connect() redirects back. */
|
|
34
|
+
handleCallback(): Promise<{
|
|
35
|
+
walletAddress: string;
|
|
36
|
+
passkeyId: string;
|
|
37
|
+
email: string;
|
|
38
|
+
} | null>;
|
|
39
|
+
/**
|
|
40
|
+
* Redirect the user to Orbi to approve a transaction with their passkey.
|
|
41
|
+
* If apiKey is set, the user will see the fee as sponsored — they pay nothing.
|
|
42
|
+
*/
|
|
43
|
+
sign(params: {
|
|
44
|
+
walletAddress: string;
|
|
45
|
+
contractId: string;
|
|
46
|
+
functionName: string;
|
|
47
|
+
argsXdr: string[];
|
|
48
|
+
redirectUrl: string;
|
|
49
|
+
}): void;
|
|
50
|
+
/** Call this on your sign-callback page after orbi.sign() redirects back. */
|
|
51
|
+
handleSignCallback(): {
|
|
52
|
+
signedAuthEntryXdr: string;
|
|
53
|
+
quoteId: string;
|
|
54
|
+
argsXdr: string[];
|
|
55
|
+
nativeSacId: string;
|
|
56
|
+
walletAddress: string;
|
|
57
|
+
} | null;
|
|
58
|
+
/** Redirect the user to add a token to their Orbi wallet. */
|
|
59
|
+
watchAsset(params: {
|
|
60
|
+
contractId: string;
|
|
61
|
+
redirectUrl: string;
|
|
62
|
+
}): void;
|
|
63
|
+
/** Call this on your callback page after orbi.watchAsset() redirects back. */
|
|
64
|
+
handleWatchAssetCallback(): {
|
|
65
|
+
contractId: string;
|
|
66
|
+
added: boolean;
|
|
67
|
+
} | null;
|
|
68
|
+
/**
|
|
69
|
+
* Submit a signed operation to the Orbi relay.
|
|
70
|
+
* If apiKey is set and a deployer is configured, gas is sponsored automatically.
|
|
71
|
+
*/
|
|
72
|
+
bundle(params: {
|
|
73
|
+
walletAddress: string;
|
|
74
|
+
quoteId: string;
|
|
75
|
+
signedAuthEntryXdr: string;
|
|
76
|
+
contractId: string;
|
|
77
|
+
functionName: string;
|
|
78
|
+
argsXdr: string[];
|
|
79
|
+
}): Promise<{
|
|
80
|
+
opId: string;
|
|
81
|
+
}>;
|
|
82
|
+
/** One-shot status check for an operation. */
|
|
83
|
+
getStatus(opId: string): Promise<OpStatus>;
|
|
84
|
+
/** Wait for confirmed or failed via SSE (~5s on Stellar). */
|
|
85
|
+
waitForConfirmation(opId: string): Promise<OpStatus>;
|
|
86
|
+
/** Register a new developer account. Returns a one-time API key — save it. */
|
|
87
|
+
register(params: {
|
|
88
|
+
developerName: string;
|
|
89
|
+
email: string;
|
|
90
|
+
deployerPublicKey?: string;
|
|
91
|
+
}): Promise<{
|
|
92
|
+
apiKey: string;
|
|
93
|
+
message: string;
|
|
94
|
+
}>;
|
|
95
|
+
/** Set or update the deployer (gas tank) address for this API key. */
|
|
96
|
+
setDeployer(deployerPublicKey: string): Promise<void>;
|
|
97
|
+
/** Check the XLM balance of your gas tank. */
|
|
98
|
+
getDeployerBalance(): Promise<DeployerBalance>;
|
|
99
|
+
}
|
package/dist/client.js
ADDED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @orbi/sdk — Orbi Smart Wallet SDK
|
|
4
|
+
*
|
|
5
|
+
* Lets any Stellar dApp integrate Orbi passkey wallets using a redirect flow.
|
|
6
|
+
* Works on all devices and browsers — no popups, no extensions needed.
|
|
7
|
+
*
|
|
8
|
+
* Quick start (user pays gas):
|
|
9
|
+
* const orbi = new OrbiClient({ apiUrl: 'https://api.orbiwallet.xyz' });
|
|
10
|
+
*
|
|
11
|
+
* Quick start (dApp sponsors gas):
|
|
12
|
+
* const orbi = new OrbiClient({
|
|
13
|
+
* apiUrl: 'https://api.orbiwallet.xyz',
|
|
14
|
+
* apiKey: 'YOUR_API_KEY', // <-- enables gasless
|
|
15
|
+
* });
|
|
16
|
+
*
|
|
17
|
+
* Flow:
|
|
18
|
+
* 1. orbi.connect({ redirectUrl }) — redirect user to connect wallet
|
|
19
|
+
* 2. orbi.handleCallback() — on return, exchange token for wallet data
|
|
20
|
+
* 3. orbi.sign({ ..., redirectUrl }) — redirect user to approve transaction
|
|
21
|
+
* 4. orbi.handleSignCallback() → bundle() — on return, submit signed tx
|
|
22
|
+
* 5. orbi.waitForConfirmation(opId) — wait for on-chain confirmation
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.OrbiClient = void 0;
|
|
26
|
+
const KEYS_URL = 'https://keys.orbiwallet.xyz';
|
|
27
|
+
class OrbiClient {
|
|
28
|
+
constructor(config) {
|
|
29
|
+
this.apiUrl = config.apiUrl.replace(/\/$/, '');
|
|
30
|
+
this.apiKey = config.apiKey;
|
|
31
|
+
}
|
|
32
|
+
authHeaders() {
|
|
33
|
+
return this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {};
|
|
34
|
+
}
|
|
35
|
+
// ── Wallet connection ───────────────────────────────────────────────────────
|
|
36
|
+
/** Redirect the user to Orbi to connect their wallet. */
|
|
37
|
+
connect(params) {
|
|
38
|
+
const url = new URL(`${KEYS_URL}/connect`);
|
|
39
|
+
url.searchParams.set('redirect', params.redirectUrl);
|
|
40
|
+
url.searchParams.set('origin', window.location.origin);
|
|
41
|
+
window.location.href = url.toString();
|
|
42
|
+
}
|
|
43
|
+
/** Call this on your callback page after orbi.connect() redirects back. */
|
|
44
|
+
async handleCallback() {
|
|
45
|
+
const params = new URLSearchParams(window.location.search);
|
|
46
|
+
const token = params.get('token');
|
|
47
|
+
if (!token)
|
|
48
|
+
return null;
|
|
49
|
+
const res = await fetch(`${this.apiUrl}/v1/auth/tokens/${token}`);
|
|
50
|
+
if (!res.ok)
|
|
51
|
+
throw new Error('Invalid or expired Orbi token');
|
|
52
|
+
return res.json();
|
|
53
|
+
}
|
|
54
|
+
// ── Transaction signing ─────────────────────────────────────────────────────
|
|
55
|
+
/**
|
|
56
|
+
* Redirect the user to Orbi to approve a transaction with their passkey.
|
|
57
|
+
* If apiKey is set, the user will see the fee as sponsored — they pay nothing.
|
|
58
|
+
*/
|
|
59
|
+
sign(params) {
|
|
60
|
+
const url = new URL(`${KEYS_URL}/sign`);
|
|
61
|
+
url.searchParams.set('redirect', params.redirectUrl);
|
|
62
|
+
url.searchParams.set('origin', window.location.origin);
|
|
63
|
+
url.searchParams.set('walletAddress', params.walletAddress);
|
|
64
|
+
url.searchParams.set('contractId', params.contractId);
|
|
65
|
+
url.searchParams.set('functionName', params.functionName);
|
|
66
|
+
url.searchParams.set('argsXdr', JSON.stringify(params.argsXdr));
|
|
67
|
+
if (this.apiKey)
|
|
68
|
+
url.searchParams.set('apiKey', this.apiKey);
|
|
69
|
+
window.location.href = url.toString();
|
|
70
|
+
}
|
|
71
|
+
/** Call this on your sign-callback page after orbi.sign() redirects back. */
|
|
72
|
+
handleSignCallback() {
|
|
73
|
+
const params = new URLSearchParams(window.location.search);
|
|
74
|
+
const signedXdr = params.get('signedXdr');
|
|
75
|
+
const quoteId = params.get('quoteId');
|
|
76
|
+
const argsXdrRaw = params.get('argsXdr');
|
|
77
|
+
const nativeSacId = params.get('nativeSacId');
|
|
78
|
+
const walletAddress = params.get('walletAddress');
|
|
79
|
+
if (!signedXdr || !quoteId || !argsXdrRaw || !nativeSacId || !walletAddress)
|
|
80
|
+
return null;
|
|
81
|
+
return {
|
|
82
|
+
signedAuthEntryXdr: signedXdr,
|
|
83
|
+
quoteId,
|
|
84
|
+
argsXdr: JSON.parse(argsXdrRaw),
|
|
85
|
+
nativeSacId,
|
|
86
|
+
walletAddress,
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
// ── Token management ────────────────────────────────────────────────────────
|
|
90
|
+
/** Redirect the user to add a token to their Orbi wallet. */
|
|
91
|
+
watchAsset(params) {
|
|
92
|
+
const url = new URL(`${KEYS_URL}/watch-asset`);
|
|
93
|
+
url.searchParams.set('contractId', params.contractId);
|
|
94
|
+
url.searchParams.set('redirect', params.redirectUrl);
|
|
95
|
+
url.searchParams.set('origin', window.location.origin);
|
|
96
|
+
window.location.href = url.toString();
|
|
97
|
+
}
|
|
98
|
+
/** Call this on your callback page after orbi.watchAsset() redirects back. */
|
|
99
|
+
handleWatchAssetCallback() {
|
|
100
|
+
const params = new URLSearchParams(window.location.search);
|
|
101
|
+
const contractId = params.get('watchedContractId');
|
|
102
|
+
if (!contractId)
|
|
103
|
+
return null;
|
|
104
|
+
return { contractId, added: params.get('watched') === 'true' };
|
|
105
|
+
}
|
|
106
|
+
// ── Relay API ───────────────────────────────────────────────────────────────
|
|
107
|
+
/**
|
|
108
|
+
* Submit a signed operation to the Orbi relay.
|
|
109
|
+
* If apiKey is set and a deployer is configured, gas is sponsored automatically.
|
|
110
|
+
*/
|
|
111
|
+
async bundle(params) {
|
|
112
|
+
const res = await fetch(`${this.apiUrl}/v1/bundle`, {
|
|
113
|
+
method: 'POST',
|
|
114
|
+
headers: {
|
|
115
|
+
'Content-Type': 'application/json',
|
|
116
|
+
...this.authHeaders(),
|
|
117
|
+
},
|
|
118
|
+
body: JSON.stringify({
|
|
119
|
+
walletAddress: params.walletAddress,
|
|
120
|
+
quoteId: params.quoteId,
|
|
121
|
+
authEntryXdr: params.signedAuthEntryXdr,
|
|
122
|
+
call: {
|
|
123
|
+
contractId: params.contractId,
|
|
124
|
+
function: params.functionName,
|
|
125
|
+
argsXdr: params.argsXdr,
|
|
126
|
+
},
|
|
127
|
+
}),
|
|
128
|
+
});
|
|
129
|
+
if (!res.ok) {
|
|
130
|
+
const err = await res.json().catch(() => ({}));
|
|
131
|
+
throw new Error(err.error ?? `Bundle failed: ${res.status}`);
|
|
132
|
+
}
|
|
133
|
+
return res.json();
|
|
134
|
+
}
|
|
135
|
+
/** One-shot status check for an operation. */
|
|
136
|
+
async getStatus(opId) {
|
|
137
|
+
const res = await fetch(`${this.apiUrl}/v1/status/${opId}`);
|
|
138
|
+
if (!res.ok)
|
|
139
|
+
throw new Error(`Status check failed: ${res.status}`);
|
|
140
|
+
return res.json();
|
|
141
|
+
}
|
|
142
|
+
/** Wait for confirmed or failed via SSE (~5s on Stellar). */
|
|
143
|
+
waitForConfirmation(opId) {
|
|
144
|
+
return new Promise((resolve, reject) => {
|
|
145
|
+
const es = new EventSource(`${this.apiUrl}/v1/wallet/events/${opId}`);
|
|
146
|
+
es.onmessage = (e) => {
|
|
147
|
+
try {
|
|
148
|
+
const data = JSON.parse(e.data);
|
|
149
|
+
es.close();
|
|
150
|
+
if (data.status === 'confirmed') {
|
|
151
|
+
resolve({ opId, status: 'confirmed', txHash: data.txHash ?? null, error: null });
|
|
152
|
+
}
|
|
153
|
+
else if (data.status === 'failed') {
|
|
154
|
+
resolve({ opId, status: 'failed', txHash: null, error: data.error ?? 'Transaction failed' });
|
|
155
|
+
}
|
|
156
|
+
else if (data.status === 'timeout') {
|
|
157
|
+
reject(new Error(`Op ${opId} timed out`));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
catch {
|
|
161
|
+
es.close();
|
|
162
|
+
reject(new Error('Invalid SSE response'));
|
|
163
|
+
}
|
|
164
|
+
};
|
|
165
|
+
es.onerror = () => {
|
|
166
|
+
es.close();
|
|
167
|
+
reject(new Error(`Lost connection waiting for op ${opId}`));
|
|
168
|
+
};
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
// ── Gas sponsorship onboarding ──────────────────────────────────────────────
|
|
172
|
+
/** Register a new developer account. Returns a one-time API key — save it. */
|
|
173
|
+
async register(params) {
|
|
174
|
+
const res = await fetch(`${this.apiUrl}/v1/account/register`, {
|
|
175
|
+
method: 'POST',
|
|
176
|
+
headers: { 'Content-Type': 'application/json' },
|
|
177
|
+
body: JSON.stringify(params),
|
|
178
|
+
});
|
|
179
|
+
if (!res.ok) {
|
|
180
|
+
const err = await res.json().catch(() => ({}));
|
|
181
|
+
throw new Error(err.error ?? `Registration failed: ${res.status}`);
|
|
182
|
+
}
|
|
183
|
+
return res.json();
|
|
184
|
+
}
|
|
185
|
+
/** Set or update the deployer (gas tank) address for this API key. */
|
|
186
|
+
async setDeployer(deployerPublicKey) {
|
|
187
|
+
if (!this.apiKey)
|
|
188
|
+
throw new Error('apiKey required — pass it in the OrbiClient constructor');
|
|
189
|
+
const res = await fetch(`${this.apiUrl}/v1/account/deployer`, {
|
|
190
|
+
method: 'PATCH',
|
|
191
|
+
headers: { 'Content-Type': 'application/json', ...this.authHeaders() },
|
|
192
|
+
body: JSON.stringify({ deployerPublicKey }),
|
|
193
|
+
});
|
|
194
|
+
if (!res.ok) {
|
|
195
|
+
const err = await res.json().catch(() => ({}));
|
|
196
|
+
throw new Error(err.error ?? `Set deployer failed: ${res.status}`);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
/** Check the XLM balance of your gas tank. */
|
|
200
|
+
async getDeployerBalance() {
|
|
201
|
+
if (!this.apiKey)
|
|
202
|
+
throw new Error('apiKey required — pass it in the OrbiClient constructor');
|
|
203
|
+
const res = await fetch(`${this.apiUrl}/v1/account/balance`, {
|
|
204
|
+
headers: this.authHeaders(),
|
|
205
|
+
});
|
|
206
|
+
if (!res.ok) {
|
|
207
|
+
const err = await res.json().catch(() => ({}));
|
|
208
|
+
throw new Error(err.error ?? `Balance fetch failed: ${res.status}`);
|
|
209
|
+
}
|
|
210
|
+
return res.json();
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
exports.OrbiClient = OrbiClient;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deriveWalletAddress = exports.OrbiClient = void 0;
|
|
4
|
+
var client_1 = require("./client");
|
|
5
|
+
Object.defineProperty(exports, "OrbiClient", { enumerable: true, get: function () { return client_1.OrbiClient; } });
|
|
6
|
+
var wallet_1 = require("./wallet");
|
|
7
|
+
Object.defineProperty(exports, "deriveWalletAddress", { enumerable: true, get: function () { return wallet_1.deriveWalletAddress; } });
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type OrbiNetwork = 'testnet' | 'mainnet';
|
|
2
|
+
export interface OrbiClientConfig {
|
|
3
|
+
/** Orbi relay API URL — https://api.orbiwallet.xyz */
|
|
4
|
+
apiUrl: string;
|
|
5
|
+
/** Optional: your API key if required by the relay */
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
network?: OrbiNetwork;
|
|
8
|
+
}
|
|
9
|
+
export interface QuoteResult {
|
|
10
|
+
quoteId: string;
|
|
11
|
+
feeStroops: number;
|
|
12
|
+
feeXlm: string;
|
|
13
|
+
expiresAtLedger: number;
|
|
14
|
+
currentLedger: number;
|
|
15
|
+
nativeSacId: string;
|
|
16
|
+
feeCollectorAddress: string;
|
|
17
|
+
authEntryXdr: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BundleResult {
|
|
20
|
+
opId: string;
|
|
21
|
+
}
|
|
22
|
+
export interface OpStatus {
|
|
23
|
+
opId: string;
|
|
24
|
+
status: 'pending' | 'batched' | 'confirmed' | 'failed';
|
|
25
|
+
txHash: string | null;
|
|
26
|
+
error: string | null;
|
|
27
|
+
}
|
|
28
|
+
export interface DeployerBalance {
|
|
29
|
+
address: string;
|
|
30
|
+
balanceXlm: string;
|
|
31
|
+
balanceStroops: string;
|
|
32
|
+
}
|
package/dist/types.js
ADDED
package/dist/wallet.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type OrbiNetwork = 'testnet' | 'mainnet';
|
|
2
|
+
/**
|
|
3
|
+
* Derive the deterministic wallet C-address for a passkey ID.
|
|
4
|
+
*
|
|
5
|
+
* Matches the relay's deriveWalletAddress — same formula:
|
|
6
|
+
* salt = sha256(passkey_id)
|
|
7
|
+
* address = sha256(networkId + deployer_G_address + salt)
|
|
8
|
+
*
|
|
9
|
+
* Call this immediately after passkey creation to show the user their
|
|
10
|
+
* address — no transaction or network call needed.
|
|
11
|
+
*/
|
|
12
|
+
export declare function deriveWalletAddress(params: {
|
|
13
|
+
passkeyId: Uint8Array;
|
|
14
|
+
deployerPublicKey: string;
|
|
15
|
+
network?: OrbiNetwork;
|
|
16
|
+
}): string;
|
package/dist/wallet.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deriveWalletAddress = deriveWalletAddress;
|
|
4
|
+
const stellar_sdk_1 = require("@stellar/stellar-sdk");
|
|
5
|
+
const PASSPHRASES = {
|
|
6
|
+
testnet: stellar_sdk_1.Networks.TESTNET,
|
|
7
|
+
mainnet: stellar_sdk_1.Networks.PUBLIC,
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Derive the deterministic wallet C-address for a passkey ID.
|
|
11
|
+
*
|
|
12
|
+
* Matches the relay's deriveWalletAddress — same formula:
|
|
13
|
+
* salt = sha256(passkey_id)
|
|
14
|
+
* address = sha256(networkId + deployer_G_address + salt)
|
|
15
|
+
*
|
|
16
|
+
* Call this immediately after passkey creation to show the user their
|
|
17
|
+
* address — no transaction or network call needed.
|
|
18
|
+
*/
|
|
19
|
+
function deriveWalletAddress(params) {
|
|
20
|
+
const { passkeyId, deployerPublicKey, network = 'testnet' } = params;
|
|
21
|
+
const networkPassphrase = PASSPHRASES[network];
|
|
22
|
+
const salt = (0, stellar_sdk_1.hash)(Buffer.from(passkeyId));
|
|
23
|
+
const networkId = (0, stellar_sdk_1.hash)(Buffer.from(networkPassphrase));
|
|
24
|
+
const preimage = stellar_sdk_1.xdr.HashIdPreimage.envelopeTypeContractId(new stellar_sdk_1.xdr.HashIdPreimageContractId({
|
|
25
|
+
networkId: Buffer.from(networkId),
|
|
26
|
+
contractIdPreimage: stellar_sdk_1.xdr.ContractIdPreimage.contractIdPreimageFromAddress(new stellar_sdk_1.xdr.ContractIdPreimageFromAddress({
|
|
27
|
+
address: new stellar_sdk_1.Address(deployerPublicKey).toScAddress(),
|
|
28
|
+
salt: Buffer.from(salt),
|
|
29
|
+
})),
|
|
30
|
+
}));
|
|
31
|
+
const contractId = (0, stellar_sdk_1.hash)(preimage.toXDR());
|
|
32
|
+
return stellar_sdk_1.StrKey.encodeContract(contractId);
|
|
33
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@orbi-wallet/sdk",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Orbi Smart Wallet SDK — connect any dApp to Orbi passkey wallets with optional gasless transactions",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"keywords": ["stellar", "smart-wallet", "passkey", "gasless", "soroban", "sdk"],
|
|
10
|
+
"homepage": "https://orbiwallet.xyz",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "https://github.com/Novablitz404/orbi-smart-wallet"
|
|
14
|
+
},
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/Novablitz404/orbi-smart-wallet/issues"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "tsc",
|
|
20
|
+
"dev": "tsc --watch"
|
|
21
|
+
},
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@stellar/stellar-sdk": "^15.1.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/node": "^20.14.2",
|
|
27
|
+
"typescript": "^5.5.2"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@stellar/stellar-sdk": "^15.1.0"
|
|
31
|
+
}
|
|
32
|
+
}
|