n3-sdk 0.2.5 → 0.2.6
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/exchange/depositERC20.d.ts +15 -3
- package/dist/exchange/depositERC20.d.ts.map +1 -1
- package/dist/exchange/depositERC20.js +36 -26
- package/dist/exchange/depositHYPE.d.ts +5 -3
- package/dist/exchange/depositHYPE.d.ts.map +1 -1
- package/dist/exchange/depositHYPE.js +18 -18
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/lib/utils/redis.d.ts +1 -1
- package/dist/lib/utils/redis.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type { N3Clients } from
|
|
2
|
-
import type { NoteStore } from
|
|
3
|
-
import type { NoteV1 } from
|
|
1
|
+
import type { N3Clients } from "../lib/client.js";
|
|
2
|
+
import type { NoteStore } from "../notes/store.js";
|
|
3
|
+
import type { NoteV1 } from "../types/NoteStoreTypes.js";
|
|
4
|
+
export type DepositPokePayload = {
|
|
5
|
+
pool: `0x${string}`;
|
|
6
|
+
chainId: number;
|
|
7
|
+
tx: `0x${string}`;
|
|
8
|
+
assetId: string;
|
|
9
|
+
amount: string;
|
|
10
|
+
commitment: `0x${string}`;
|
|
11
|
+
notePubkey?: string;
|
|
12
|
+
user?: `0x${string}`;
|
|
13
|
+
ts?: number;
|
|
14
|
+
};
|
|
4
15
|
export declare function depositERC20({ clients, pool, chainId, token, assetId, amount, seed, sysAddress, store, }: {
|
|
5
16
|
clients: N3Clients;
|
|
6
17
|
pool: `0x${string}`;
|
|
@@ -15,5 +26,6 @@ export declare function depositERC20({ clients, pool, chainId, token, assetId, a
|
|
|
15
26
|
hash: `0x${string}`;
|
|
16
27
|
receipt: import("viem").TransactionReceipt;
|
|
17
28
|
note: NoteV1;
|
|
29
|
+
poke: DepositPokePayload;
|
|
18
30
|
}>;
|
|
19
31
|
//# sourceMappingURL=depositERC20.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depositERC20.d.ts","sourceRoot":"","sources":["../../src/exchange/depositERC20.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"depositERC20.d.ts","sourceRoot":"","sources":["../../src/exchange/depositERC20.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAEzD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,KAAK,MAAM,EAAE,CAAC;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAOF,wBAAsB,YAAY,CAAC,EACjC,OAAO,EACP,IAAI,EACJ,OAAO,EACP,KAAK,EACL,OAAO,EACP,MAAM,EACN,IAAI,EACJ,UAAU,EACV,KAAK,GACN,EAAE;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,KAAK,MAAM,EAAE,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;;;;;GA2EA"}
|
|
@@ -1,64 +1,74 @@
|
|
|
1
|
-
import { erc20Abi } from
|
|
2
|
-
import { initPoseidon, genNote, makeDepositCommitments } from
|
|
3
|
-
import { PrivatePoolAbi as POOL_ABI } from
|
|
4
|
-
import { publishDepositPoke } from '../lib/utils/redis.js';
|
|
1
|
+
import { erc20Abi } from "viem";
|
|
2
|
+
import { initPoseidon, genNote, makeDepositCommitments } from "../lib/utils/poseidon.js";
|
|
3
|
+
import { PrivatePoolAbi as POOL_ABI } from "../lib/consts/poolAbi.js";
|
|
5
4
|
function sysAddressFromAssetId(assetId) {
|
|
6
5
|
const val = (0x20n << 152n) | assetId;
|
|
7
|
-
return (`0x${val.toString(16).padStart(40,
|
|
6
|
+
return (`0x${val.toString(16).padStart(40, "0")}`);
|
|
8
7
|
}
|
|
9
8
|
export async function depositERC20({ clients, pool, chainId, token, assetId, amount, seed, sysAddress, store, }) {
|
|
10
9
|
await initPoseidon();
|
|
11
|
-
const {
|
|
10
|
+
const { skBytes, Ax, Ay, pubkey, blinding } = await genNote(seed);
|
|
12
11
|
const { commitment } = makeDepositCommitments(assetId, amount, pubkey, blinding);
|
|
13
12
|
const sys = sysAddress ?? sysAddressFromAssetId(assetId);
|
|
14
13
|
const { publicClient, walletClient, account } = clients;
|
|
15
|
-
const allowance = await publicClient.readContract({
|
|
16
|
-
address: token,
|
|
14
|
+
const allowance = (await publicClient.readContract({
|
|
15
|
+
address: token,
|
|
16
|
+
abi: erc20Abi,
|
|
17
|
+
functionName: "allowance",
|
|
17
18
|
args: [account.address, pool],
|
|
18
|
-
});
|
|
19
|
+
}));
|
|
19
20
|
if (allowance < amount) {
|
|
20
21
|
const { request } = await publicClient.simulateContract({
|
|
21
|
-
address: token,
|
|
22
|
-
|
|
22
|
+
address: token,
|
|
23
|
+
abi: erc20Abi,
|
|
24
|
+
functionName: "approve",
|
|
25
|
+
args: [pool, amount],
|
|
26
|
+
account,
|
|
23
27
|
});
|
|
24
28
|
const h = await walletClient.writeContract(request);
|
|
25
29
|
await publicClient.waitForTransactionReceipt({ hash: h });
|
|
26
30
|
}
|
|
27
31
|
const { request } = await publicClient.simulateContract({
|
|
28
|
-
address: pool,
|
|
29
|
-
|
|
32
|
+
address: pool,
|
|
33
|
+
abi: POOL_ABI,
|
|
34
|
+
functionName: "depositERC20",
|
|
35
|
+
args: [assetId, amount, commitment, token, sys],
|
|
36
|
+
account,
|
|
30
37
|
});
|
|
31
38
|
const hash = await walletClient.writeContract(request);
|
|
32
39
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
33
40
|
const note = {
|
|
34
41
|
version: 1,
|
|
35
|
-
commitment: `0x${BigInt(commitment).toString(16).padStart(64,
|
|
36
|
-
chainId,
|
|
37
|
-
|
|
42
|
+
commitment: `0x${BigInt(commitment).toString(16).padStart(64, "0")}`,
|
|
43
|
+
chainId,
|
|
44
|
+
pool,
|
|
45
|
+
assetId,
|
|
46
|
+
amount,
|
|
38
47
|
ownerPub: { x: BigInt(Ax), y: BigInt(Ay) },
|
|
39
48
|
notePubkey: BigInt(pubkey),
|
|
40
49
|
secret: {
|
|
41
50
|
sk: skBytes,
|
|
42
51
|
blind: (() => {
|
|
43
|
-
const hex = BigInt(blinding).toString(16).padStart(64,
|
|
44
|
-
return Uint8Array.from(Buffer.from(hex,
|
|
45
|
-
})()
|
|
52
|
+
const hex = BigInt(blinding).toString(16).padStart(64, "0");
|
|
53
|
+
return Uint8Array.from(Buffer.from(hex, "hex"));
|
|
54
|
+
})(),
|
|
46
55
|
},
|
|
47
|
-
status:
|
|
56
|
+
status: "STAGED",
|
|
48
57
|
createdAt: Date.now(),
|
|
49
58
|
updatedAt: Date.now(),
|
|
50
59
|
};
|
|
51
60
|
if (store)
|
|
52
61
|
await store.addStagedNotes([note]);
|
|
53
|
-
|
|
62
|
+
const poke = {
|
|
54
63
|
pool,
|
|
55
64
|
chainId,
|
|
56
65
|
tx: hash,
|
|
57
|
-
assetId,
|
|
58
|
-
amount,
|
|
66
|
+
assetId: assetId.toString(),
|
|
67
|
+
amount: amount.toString(),
|
|
59
68
|
commitment: note.commitment,
|
|
60
|
-
notePubkey: note.notePubkey,
|
|
69
|
+
notePubkey: note.notePubkey?.toString(),
|
|
61
70
|
user: account.address,
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
ts: Date.now(),
|
|
72
|
+
};
|
|
73
|
+
return { hash, receipt, note, poke };
|
|
64
74
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { N3Clients } from
|
|
2
|
-
import type { NoteStore } from
|
|
3
|
-
import type { NoteV1 } from
|
|
1
|
+
import type { N3Clients } from "../lib/client.js";
|
|
2
|
+
import type { NoteStore } from "../notes/store.js";
|
|
3
|
+
import type { NoteV1 } from "../types/NoteStoreTypes.js";
|
|
4
|
+
import type { DepositPokePayload } from "./depositERC20.js";
|
|
4
5
|
export declare function depositHYPE({ clients, pool, chainId, amountWei, seed, store, }: {
|
|
5
6
|
clients: N3Clients;
|
|
6
7
|
pool: `0x${string}`;
|
|
@@ -12,5 +13,6 @@ export declare function depositHYPE({ clients, pool, chainId, amountWei, seed, s
|
|
|
12
13
|
hash: `0x${string}`;
|
|
13
14
|
receipt: import("viem").TransactionReceipt;
|
|
14
15
|
note: NoteV1;
|
|
16
|
+
poke: DepositPokePayload;
|
|
15
17
|
}>;
|
|
16
18
|
//# sourceMappingURL=depositHYPE.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"depositHYPE.d.ts","sourceRoot":"","sources":["../../src/exchange/depositHYPE.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"depositHYPE.d.ts","sourceRoot":"","sources":["../../src/exchange/depositHYPE.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAI5D,wBAAsB,WAAW,CAAC,EAChC,OAAO,EACP,IAAI,EACJ,OAAO,EACP,SAAS,EACT,IAAI,EACJ,KAAK,GACN,EAAE;IACD,OAAO,EAAE,SAAS,CAAC;IACnB,IAAI,EAAE,KAAK,MAAM,EAAE,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;;;;;GAwDA"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { initPoseidon, genNote, makeDepositCommitments } from
|
|
2
|
-
import { PrivatePoolAbi as POOL_ABI } from
|
|
3
|
-
import { publishDepositPoke } from '../lib/utils/redis.js';
|
|
1
|
+
import { initPoseidon, genNote, makeDepositCommitments } from "../lib/utils/poseidon.js";
|
|
2
|
+
import { PrivatePoolAbi as POOL_ABI } from "../lib/consts/poolAbi.js";
|
|
4
3
|
const HYPE_ASSET_ID = 150n;
|
|
5
4
|
export async function depositHYPE({ clients, pool, chainId, amountWei, seed, store, }) {
|
|
6
5
|
await initPoseidon();
|
|
7
|
-
const {
|
|
6
|
+
const { skBytes, Ax, Ay, pubkey, blinding } = await genNote(seed);
|
|
8
7
|
const { commitment } = makeDepositCommitments(HYPE_ASSET_ID, amountWei, pubkey, blinding);
|
|
9
8
|
const { publicClient, walletClient, account } = clients;
|
|
10
9
|
const { request } = await publicClient.simulateContract({
|
|
11
10
|
address: pool,
|
|
12
11
|
abi: POOL_ABI,
|
|
13
|
-
functionName:
|
|
12
|
+
functionName: "depositHYPE",
|
|
14
13
|
args: [commitment],
|
|
15
14
|
value: amountWei,
|
|
16
15
|
account,
|
|
@@ -19,8 +18,9 @@ export async function depositHYPE({ clients, pool, chainId, amountWei, seed, sto
|
|
|
19
18
|
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
20
19
|
const note = {
|
|
21
20
|
version: 1,
|
|
22
|
-
commitment: `0x${BigInt(commitment).toString(16).padStart(64,
|
|
23
|
-
chainId,
|
|
21
|
+
commitment: `0x${BigInt(commitment).toString(16).padStart(64, "0")}`,
|
|
22
|
+
chainId,
|
|
23
|
+
pool,
|
|
24
24
|
assetId: HYPE_ASSET_ID,
|
|
25
25
|
amount: amountWei,
|
|
26
26
|
ownerPub: { x: BigInt(Ax), y: BigInt(Ay) },
|
|
@@ -28,26 +28,26 @@ export async function depositHYPE({ clients, pool, chainId, amountWei, seed, sto
|
|
|
28
28
|
secret: {
|
|
29
29
|
sk: skBytes,
|
|
30
30
|
blind: (() => {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
})()
|
|
31
|
+
const hex = BigInt(blinding).toString(16).padStart(64, "0");
|
|
32
|
+
return Uint8Array.from(Buffer.from(hex, "hex"));
|
|
33
|
+
})(),
|
|
35
34
|
},
|
|
36
|
-
status:
|
|
35
|
+
status: "STAGED",
|
|
37
36
|
createdAt: Date.now(),
|
|
38
37
|
updatedAt: Date.now(),
|
|
39
38
|
};
|
|
40
39
|
if (store)
|
|
41
40
|
await store.addStagedNotes([note]);
|
|
42
|
-
|
|
41
|
+
const poke = {
|
|
43
42
|
pool,
|
|
44
43
|
chainId,
|
|
45
44
|
tx: hash,
|
|
46
|
-
assetId: HYPE_ASSET_ID,
|
|
47
|
-
amount: amountWei,
|
|
45
|
+
assetId: HYPE_ASSET_ID.toString(),
|
|
46
|
+
amount: amountWei.toString(),
|
|
48
47
|
commitment: note.commitment,
|
|
49
|
-
notePubkey: note.notePubkey,
|
|
48
|
+
notePubkey: note.notePubkey?.toString(),
|
|
50
49
|
user: account.address,
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
ts: Date.now(),
|
|
51
|
+
};
|
|
52
|
+
return { hash, receipt, note, poke };
|
|
53
53
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export type { N3Env } from './data/config.js';
|
|
2
2
|
export { Topics, type TopicName, type AssetId } from './data/_common.js';
|
|
3
|
+
export { publishDepositPoke, publishIntent, publishEncryptedIntent, redis } from "./lib/utils/redis.js";
|
|
4
|
+
export type { DepositPoke } from "./lib/utils/redis.js";
|
|
3
5
|
export * as Info from './info/index.js';
|
|
4
6
|
export * as Subscription from './subscription/index.js';
|
|
5
7
|
export * as Exchange from './exchange/index.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,YAAY,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AACxG,YAAY,EAAE,WAAW,EAAE,M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|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
2
|
export { Topics } from './data/_common.js';
|
|
3
|
+
export { publishDepositPoke, publishIntent, publishEncryptedIntent, redis } from "./lib/utils/redis.js";
|
|
3
4
|
// Namespaced re-exports (tree-shakable)
|
|
4
5
|
export * as Info from './info/index.js';
|
|
5
6
|
export * as Subscription from './subscription/index.js';
|
|
@@ -14,7 +14,7 @@ export declare function publishEncryptedIntent(redisClient: Redis, { intent, att
|
|
|
14
14
|
* All callers should keep using publishIntent; it just routes to encrypted.
|
|
15
15
|
*/
|
|
16
16
|
export declare function publishIntent(intent: any): Promise<string | null>;
|
|
17
|
-
type DepositPoke = {
|
|
17
|
+
export type DepositPoke = {
|
|
18
18
|
pool: `0x${string}`;
|
|
19
19
|
chainId: number;
|
|
20
20
|
tx: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"redis.d.ts","sourceRoot":"","sources":["../../../src/lib/utils/redis.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,SAAS,CAAC;AAK5B,eAAO,MAAM,KAAK,OAIhB,CAAC;AAEH,KAAK,oBAAoB,GAAG;IAC1B,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC;AAGF,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,KAAK,EAClB,EACE,MAAM,EACN,SAAS,EACT,WAAW,EACX,WAAW,EACX,mBAAmB,EACnB,iBAAiB,GAClB,EAAE,oBAAoB,0BAaxB;AAED;;;GAGG;AACH,wBAAsB,aAAa,CAAC,MAAM,EAAE,GAAG,0BAa9C;AAED,
|
|
1
|
+
{"version":3,"file":"redis.d.ts","s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