@frak-labs/core-sdk 0.0.2 → 0.0.5
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/cdn/bundle.js +18 -6
- package/dist/actions/index.cjs +65 -63
- package/dist/actions/index.d.cts +11 -13
- package/dist/actions/index.d.ts +11 -13
- package/dist/actions/index.js +42 -53
- package/dist/{chunk-QZL2KCSB.js → chunk-GDH3M5ZC.js} +7 -9
- package/dist/{chunk-NJJQPEEL.cjs → chunk-IVQL5N55.cjs} +62 -67
- package/dist/{chunk-PR3T7O5I.cjs → chunk-PO6YSB4Q.cjs} +15 -10
- package/dist/{chunk-VAINYZSV.js → chunk-RMOFMRZR.js} +48 -39
- package/dist/{chunk-K5SAPMC2.js → chunk-XDZMP74U.js} +37 -56
- package/dist/chunk-ZDGHKI3S.cjs +155 -0
- package/dist/{context-GkNATUkF.d.cts → context-C7RkT8hA.d.cts} +206 -23
- package/dist/{context-B0trlYGx.d.ts → context-CJ5ByAXa.d.ts} +206 -23
- package/dist/index.cjs +238 -68
- package/dist/index.d.cts +49 -63
- package/dist/index.d.ts +49 -63
- package/dist/index.js +164 -52
- package/dist/interactions/index.cjs +26 -13
- package/dist/interactions/index.d.cts +35 -1
- package/dist/interactions/index.d.ts +35 -1
- package/dist/interactions/index.js +1 -13
- package/package.json +14 -5
- package/dist/chunk-RAPLRHQ4.cjs +0 -140
package/dist/chunk-RAPLRHQ4.cjs
DELETED
|
@@ -1,140 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var _chunkPR3T7O5Icjs = require('./chunk-PR3T7O5I.cjs');
|
|
5
|
-
|
|
6
|
-
// src/interactions/pressEncoder.ts
|
|
7
|
-
var _viem = require('viem');
|
|
8
|
-
var PressInteractionEncoder = {
|
|
9
|
-
/**
|
|
10
|
-
* Encode an open article interaction
|
|
11
|
-
* @param args
|
|
12
|
-
* @param args.articleId - The id of the article the user opened (32 bytes), could be a `keccak256` hash of the article slug, or your internal id
|
|
13
|
-
*/
|
|
14
|
-
openArticle({ articleId }) {
|
|
15
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
16
|
-
_chunkPR3T7O5Icjs.interactionTypes.press.openArticle,
|
|
17
|
-
_viem.pad.call(void 0, articleId, { size: 32 })
|
|
18
|
-
]);
|
|
19
|
-
return {
|
|
20
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.press),
|
|
21
|
-
interactionData
|
|
22
|
-
};
|
|
23
|
-
},
|
|
24
|
-
/**
|
|
25
|
-
* Encode a read article interaction
|
|
26
|
-
* @param args
|
|
27
|
-
* @param args.articleId - The id of the article the user opened (32 bytes), could be a `keccak256` hash of the article slug, or your internal id
|
|
28
|
-
*/
|
|
29
|
-
readArticle({ articleId }) {
|
|
30
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
31
|
-
_chunkPR3T7O5Icjs.interactionTypes.press.readArticle,
|
|
32
|
-
_viem.pad.call(void 0, articleId, { size: 32 })
|
|
33
|
-
]);
|
|
34
|
-
return {
|
|
35
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.press),
|
|
36
|
-
interactionData
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
// src/interactions/referralEncoder.ts
|
|
42
|
-
|
|
43
|
-
var ReferralInteractionEncoder = {
|
|
44
|
-
/**
|
|
45
|
-
* Records the event of a user creating a referral link. Note that this interaction doesn't actually create the link itself; it only sends an event to track that a link was created.
|
|
46
|
-
*/
|
|
47
|
-
createLink() {
|
|
48
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
49
|
-
_chunkPR3T7O5Icjs.interactionTypes.referral.createLink,
|
|
50
|
-
"0x"
|
|
51
|
-
]);
|
|
52
|
-
return {
|
|
53
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.referral),
|
|
54
|
-
interactionData
|
|
55
|
-
};
|
|
56
|
-
},
|
|
57
|
-
/**
|
|
58
|
-
* Encode a referred interaction
|
|
59
|
-
* @param args
|
|
60
|
-
* @param args.referrer - The Ethereum address of the user who made the referral
|
|
61
|
-
*/
|
|
62
|
-
referred({ referrer }) {
|
|
63
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
64
|
-
_chunkPR3T7O5Icjs.interactionTypes.referral.referred,
|
|
65
|
-
_viem.pad.call(void 0, referrer, { size: 32 })
|
|
66
|
-
]);
|
|
67
|
-
return {
|
|
68
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.referral),
|
|
69
|
-
interactionData
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
// src/interactions/purchaseEncoder.ts
|
|
75
|
-
|
|
76
|
-
var PurchaseInteractionEncoder = {
|
|
77
|
-
/**
|
|
78
|
-
* Encode a start purchase interaction
|
|
79
|
-
* @param args
|
|
80
|
-
* @param args.purchaseId - The id of the purchase that is being started.
|
|
81
|
-
*/
|
|
82
|
-
startPurchase({ purchaseId }) {
|
|
83
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
84
|
-
_chunkPR3T7O5Icjs.interactionTypes.purchase.started,
|
|
85
|
-
_viem.pad.call(void 0, purchaseId, { size: 32 })
|
|
86
|
-
]);
|
|
87
|
-
return {
|
|
88
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.purchase),
|
|
89
|
-
interactionData
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
/**
|
|
93
|
-
* Encode a complete purchase interaction
|
|
94
|
-
* @param args
|
|
95
|
-
* @param args.purchaseId - The id of the purchase that is being completed.
|
|
96
|
-
* @param args.proof - The merkle proof that the user has completed the purchase (see [Purchase Webhooks](/wallet-sdk/references-api/webhook) for more details).
|
|
97
|
-
*/
|
|
98
|
-
completedPurchase({
|
|
99
|
-
purchaseId,
|
|
100
|
-
proof
|
|
101
|
-
}) {
|
|
102
|
-
const innerData = _viem.encodeAbiParameters.call(void 0,
|
|
103
|
-
[{ type: "uint256" }, { type: "bytes32[]" }],
|
|
104
|
-
[BigInt(purchaseId), proof]
|
|
105
|
-
);
|
|
106
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
107
|
-
_chunkPR3T7O5Icjs.interactionTypes.purchase.completed,
|
|
108
|
-
innerData
|
|
109
|
-
]);
|
|
110
|
-
return {
|
|
111
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.purchase),
|
|
112
|
-
interactionData
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
// src/interactions/webshopEncoder.ts
|
|
118
|
-
|
|
119
|
-
var WebShopInteractionEncoder = {
|
|
120
|
-
/**
|
|
121
|
-
* Encode an open webshop interaction
|
|
122
|
-
*/
|
|
123
|
-
open() {
|
|
124
|
-
const interactionData = _viem.concatHex.call(void 0, [
|
|
125
|
-
_chunkPR3T7O5Icjs.interactionTypes.webshop.open,
|
|
126
|
-
"0x"
|
|
127
|
-
]);
|
|
128
|
-
return {
|
|
129
|
-
handlerTypeDenominator: _viem.toHex.call(void 0, _chunkPR3T7O5Icjs.productTypes.webshop),
|
|
130
|
-
interactionData
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
exports.PressInteractionEncoder = PressInteractionEncoder; exports.ReferralInteractionEncoder = ReferralInteractionEncoder; exports.PurchaseInteractionEncoder = PurchaseInteractionEncoder; exports.WebShopInteractionEncoder = WebShopInteractionEncoder;
|