@fivenorth/loop-sdk 0.10.0 → 0.11.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/README.md +9 -0
- package/dist/connection.d.ts +40 -0
- package/dist/connection.d.ts.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/extensions/usdc/index.d.ts +11 -0
- package/dist/extensions/usdc/index.d.ts.map +1 -0
- package/dist/extensions/usdc/types.d.ts +25 -0
- package/dist/extensions/usdc/types.d.ts.map +1 -0
- package/dist/index.d.ts +53 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +316 -229
- package/dist/provider.d.ts +61 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/server/index.d.ts +23 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +35344 -0
- package/dist/server/signer.d.ts +15 -0
- package/dist/server/signer.d.ts.map +1 -0
- package/dist/server.d.ts +2 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/session.d.ts +39 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/types.d.ts +116 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/wallet.d.ts +10 -0
- package/dist/wallet.d.ts.map +1 -0
- package/package.json +17 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as forge from 'node-forge';
|
|
2
|
+
export declare const getSigner: (privateKeyHex: string, partyId: string) => Signer;
|
|
3
|
+
export declare class Signer {
|
|
4
|
+
private privateKey;
|
|
5
|
+
private publicKey;
|
|
6
|
+
private publicKeyHex;
|
|
7
|
+
private partyId;
|
|
8
|
+
constructor(privateKeyHex: string, partyId: string);
|
|
9
|
+
getPublicKey(): string;
|
|
10
|
+
signMessage(message: string): forge.Bytes;
|
|
11
|
+
signMessageAsHex(message: string): string;
|
|
12
|
+
getPartyId(): string;
|
|
13
|
+
signTransactionHash(transactionHash: string): string;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=signer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../../src/server/signer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,YAAY,CAAC;AAEpC,eAAO,MAAM,SAAS,GAAI,eAAe,MAAM,EAAE,SAAS,MAAM,KAAG,MAElE,CAAA;AAED,qBAAa,MAAM;IACf,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,SAAS,CAAc;IAC/B,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,OAAO,CAAS;gBAEZ,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAc3C,YAAY,IAAI,MAAM;IAItB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK;IAQzC,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM;IASzC,UAAU,IAAI,MAAM;IAKpB,mBAAmB,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM;CAa9D"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session LifeCycle:
|
|
3
|
+
* 1. Initialize a new session with a session id
|
|
4
|
+
* 2. Set the ticket id when we exchange session id/appname, and user approve it and now we have a ticket id
|
|
5
|
+
* 3. Set the session as authorized when we succesfully validate the session with the backend
|
|
6
|
+
* 4. Save the session to localStorage
|
|
7
|
+
* 5. Reset the session when we need to start a new session
|
|
8
|
+
* 6. Validate the session when we need to check if the session is valid
|
|
9
|
+
* 7. Is authorized means the session is valid and the user is authenticated
|
|
10
|
+
* 8. Save the session to localStorage
|
|
11
|
+
*/
|
|
12
|
+
export declare class SessionInfo {
|
|
13
|
+
sessionId: string;
|
|
14
|
+
ticketId?: string;
|
|
15
|
+
authToken?: string;
|
|
16
|
+
partyId?: string;
|
|
17
|
+
publicKey?: string;
|
|
18
|
+
email?: string;
|
|
19
|
+
userApiKey?: string;
|
|
20
|
+
private _isAuthorized;
|
|
21
|
+
constructor({ sessionId, ticketId, authToken, partyId, publicKey, email, userApiKey }: {
|
|
22
|
+
sessionId: string;
|
|
23
|
+
ticketId?: string;
|
|
24
|
+
authToken?: string;
|
|
25
|
+
partyId?: string;
|
|
26
|
+
publicKey?: string;
|
|
27
|
+
email?: string;
|
|
28
|
+
userApiKey?: string;
|
|
29
|
+
});
|
|
30
|
+
setTicketId(ticketId: string): void;
|
|
31
|
+
authorized(): void;
|
|
32
|
+
isPreAuthorized(): boolean;
|
|
33
|
+
isAuthorized(): boolean;
|
|
34
|
+
save(): void;
|
|
35
|
+
reset(): void;
|
|
36
|
+
static fromStorage(): SessionInfo;
|
|
37
|
+
private toJson;
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../src/session.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AACH,qBAAa,WAAW;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,aAAa,CAAkB;gBAE3B,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE;QAAG,SAAS,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;IAW/N,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMnC,UAAU,IAAI,IAAI;IAQlB,eAAe,IAAI,OAAO;IAK1B,YAAY,IAAI,OAAO;IAKvB,IAAI,IAAI,IAAI;IAKZ,KAAK,IAAI,IAAI;IAab,MAAM,CAAC,WAAW,IAAI,WAAW;IAqBjC,OAAO,CAAC,MAAM;CAUf"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { UsdcBridgeExtension } from './extensions/usdc/types';
|
|
2
|
+
export type Network = 'devnet' | 'testnet' | 'mainnet' | 'local' | 'dev' | 'test' | 'main';
|
|
3
|
+
export type UsdcBridgeAccessType = 'not_requested' | 'pending' | 'granted';
|
|
4
|
+
export type Account = {
|
|
5
|
+
party_id: string;
|
|
6
|
+
auth_token: string;
|
|
7
|
+
public_key: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
has_preapproval?: boolean;
|
|
10
|
+
has_merge_delegation?: boolean;
|
|
11
|
+
usdc_bridge_access?: UsdcBridgeAccessType;
|
|
12
|
+
};
|
|
13
|
+
export declare enum MessageType {
|
|
14
|
+
HANDSHAKE_ACCEPT = "handshake_accept",
|
|
15
|
+
HANDSHAKE_REJECT = "handshake_reject",
|
|
16
|
+
RUN_TRANSACTION = "run_transaction",
|
|
17
|
+
TRANSACTION_COMPLETED = "transaction_completed",
|
|
18
|
+
SIGN_RAW_MESSAGE = "sign_raw_message",
|
|
19
|
+
SIGN_RAW_MESSAGE_RESPONSE = "sign_raw_message_response",
|
|
20
|
+
REJECT_REQUEST = "reject_request"
|
|
21
|
+
}
|
|
22
|
+
export type InstrumentId = {
|
|
23
|
+
admin: string;
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
export type Holding = {
|
|
27
|
+
instrument_id: InstrumentId;
|
|
28
|
+
decimals: number;
|
|
29
|
+
symbol: string;
|
|
30
|
+
org_name: string;
|
|
31
|
+
total_unlocked_coin: string;
|
|
32
|
+
total_locked_coin: string;
|
|
33
|
+
image: string;
|
|
34
|
+
};
|
|
35
|
+
export type ActiveContract = {
|
|
36
|
+
template_id: string;
|
|
37
|
+
contract_id: string;
|
|
38
|
+
[key: string]: any;
|
|
39
|
+
};
|
|
40
|
+
export type Instrument = {
|
|
41
|
+
instrument_admin?: string;
|
|
42
|
+
instrument_id: string;
|
|
43
|
+
};
|
|
44
|
+
export type TransferRequest = {
|
|
45
|
+
recipient: string;
|
|
46
|
+
amount: string;
|
|
47
|
+
instrument?: Instrument;
|
|
48
|
+
requested_at?: string;
|
|
49
|
+
execute_before?: string;
|
|
50
|
+
memo?: string;
|
|
51
|
+
};
|
|
52
|
+
export type TransactionPayload = {
|
|
53
|
+
commands: any[];
|
|
54
|
+
disclosedContracts: any[];
|
|
55
|
+
packageIdSelectionPreference?: string[];
|
|
56
|
+
actAs?: string[];
|
|
57
|
+
readAs?: string[];
|
|
58
|
+
synchronizerId?: string;
|
|
59
|
+
};
|
|
60
|
+
export type PreparedTransferPayload = {
|
|
61
|
+
actAs: string[];
|
|
62
|
+
readAs: string[];
|
|
63
|
+
synchronizerId: string;
|
|
64
|
+
commands: any[];
|
|
65
|
+
disclosedContracts: any[];
|
|
66
|
+
packageIdSelectionPreference: string[];
|
|
67
|
+
};
|
|
68
|
+
export type ConnectTransferResponse = {
|
|
69
|
+
payload: PreparedTransferPayload;
|
|
70
|
+
};
|
|
71
|
+
export type RunTransactionResponse = {
|
|
72
|
+
command_id: string;
|
|
73
|
+
submission_id?: string;
|
|
74
|
+
estimated_traffic?: unknown;
|
|
75
|
+
update_data?: unknown;
|
|
76
|
+
update_id?: string;
|
|
77
|
+
status?: 'succeeded' | 'failed';
|
|
78
|
+
error?: SubmissionError;
|
|
79
|
+
};
|
|
80
|
+
export type SubmissionError = {
|
|
81
|
+
error_message: string;
|
|
82
|
+
};
|
|
83
|
+
export type TransferOptions = {
|
|
84
|
+
requestedAt?: string | Date;
|
|
85
|
+
executeBefore?: string | Date;
|
|
86
|
+
requestTimeout?: number;
|
|
87
|
+
memo?: string;
|
|
88
|
+
message?: string;
|
|
89
|
+
executionMode?: 'async' | 'wait';
|
|
90
|
+
estimateTraffic?: boolean;
|
|
91
|
+
};
|
|
92
|
+
export type InstrumentSpec = Instrument;
|
|
93
|
+
export interface Wallet {
|
|
94
|
+
transfer(recipient: string, amount: string | number, instrument?: InstrumentSpec, options?: TransferOptions): Promise<any>;
|
|
95
|
+
extension: {
|
|
96
|
+
usdcBridge: UsdcBridgeExtension;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export type ExchangeApiKeyResponse = {
|
|
100
|
+
api_key: string;
|
|
101
|
+
auth_token: string;
|
|
102
|
+
email?: string;
|
|
103
|
+
ticket_id: string;
|
|
104
|
+
session_id: string;
|
|
105
|
+
};
|
|
106
|
+
export type PreparedSubmissionResponse = {
|
|
107
|
+
command_id: string;
|
|
108
|
+
transaction_hash: string;
|
|
109
|
+
transaction_data: string;
|
|
110
|
+
};
|
|
111
|
+
export type ExecuteSubmissionResquest = {
|
|
112
|
+
command_id: string;
|
|
113
|
+
transaction_data: string;
|
|
114
|
+
signature: string;
|
|
115
|
+
};
|
|
116
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAEnE,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3F,MAAM,MAAM,oBAAoB,GAAG,eAAe,GAAG,SAAS,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AC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IACjC,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC;AAExC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3H,SAAS,EAAE;QACT,UAAU,EAAE,mBAAmB,CAAC;KACjC,CAAC;CACH;AAED,MAAM,MAAM,sBAAsB,GAAG;IAEnC,OAAO,EAAE,MAAM,CAAC;IAEhB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,gBAAgB,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAA"}
|
package/dist/wallet.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { InstrumentSpec, TransferOptions, Wallet } from './types';
|
|
2
|
+
import type { Provider } from './provider';
|
|
3
|
+
export declare class LoopWallet implements Wallet {
|
|
4
|
+
private getProvider;
|
|
5
|
+
extension: Wallet['extension'];
|
|
6
|
+
constructor(getProvider: () => Provider | null);
|
|
7
|
+
private requireProvider;
|
|
8
|
+
transfer(recipient: string, amount: string | number, instrument?: InstrumentSpec, options?: TransferOptions): Promise<any>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=wallet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../src/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEvE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAG3C,qBAAa,UAAW,YAAW,MAAM;IACvC,OAAO,CAAC,WAAW,CAAwB;IACpC,SAAS,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC;gBAE1B,WAAW,EAAE,MAAM,QAAQ,GAAG,IAAI;IAO9C,OAAO,CAAC,eAAe;IAQvB,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC;CAI3H"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fivenorth/loop-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"author": "support@fivenorth.io",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
7
7
|
"devDependencies": {
|
|
8
|
-
"@types/bun": "latest"
|
|
8
|
+
"@types/bun": "latest",
|
|
9
|
+
"@types/node-forge": "^1.3.14"
|
|
9
10
|
},
|
|
10
11
|
"peerDependencies": {
|
|
11
12
|
"typescript": "^5"
|
|
@@ -18,14 +19,27 @@
|
|
|
18
19
|
},
|
|
19
20
|
"repository": "github:fivenorth-io/loop-sdk",
|
|
20
21
|
"scripts": {
|
|
21
|
-
"build": "bun build ./src/index.ts --outdir ./dist",
|
|
22
|
+
"build": "bun tsc && bun build ./src/index.ts ./src/server/index.ts --outdir ./dist --declaration",
|
|
22
23
|
"prepublishOnly": "bun run build",
|
|
23
24
|
"start": "bun run src/server.ts"
|
|
24
25
|
},
|
|
25
26
|
"type": "module",
|
|
26
27
|
"types": "dist/index.d.ts",
|
|
28
|
+
"exports": {
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dist/index.d.ts",
|
|
31
|
+
"default": "./dist/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./server": {
|
|
34
|
+
"types": "./dist/server/index.d.ts",
|
|
35
|
+
"default": "./dist/server/index.js"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
27
38
|
"dependencies": {
|
|
28
39
|
"@types/qrcode": "^1.5.6",
|
|
29
40
|
"qrcode": "^1.5.4"
|
|
41
|
+
},
|
|
42
|
+
"optionalDependencies": {
|
|
43
|
+
"node-forge": "^1.3.3"
|
|
30
44
|
}
|
|
31
45
|
}
|