@bitgen/sdk 1.0.3 → 1.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/CHANGELOG.md +8 -0
- package/README.md +2 -2
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/package.json +1 -1
- package/readme/concepts.md +24 -0
- package/readme/configuration.md +1 -1
- package/readme/media/activation.svg +58 -0
- package/readme/media/deposit-flow.svg +70 -0
- package/readme/media/order-buy.svg +43 -0
- package/readme/media/order-sell.svg +47 -0
- package/readme/media/purchase-flow.svg +61 -0
- package/readme/media/sale-flow.svg +61 -0
- package/readme/media/staking-position.svg +75 -0
- package/readme/media/transaction-lifecycle.svg +61 -0
- package/readme/media/webhook-delivery.svg +53 -0
- package/readme/media/withdrawal-flow.svg +64 -0
- package/readme/resource/apikeys.md +4 -4
- package/readme/resource/asset.md +4 -4
- package/readme/resource/bank.md +16 -11
- package/readme/resource/core.md +2 -2
- package/readme/resource/custody.md +4 -4
- package/readme/resource/customer.md +6 -4
- package/readme/resource/staking.md +20 -16
- package/readme/resource/trading.md +10 -5
- package/readme/resource/transaction.md +8 -4
- package/readme/resource/webhooks.md +13 -11
- package/src/version.ts +1 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 540" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">Staking: the single movement of a position — STAKE, rewritten UNSTAKE on a full exit — and the states of the position</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<marker id="mcbd5e1" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#cbd5e1"/></marker>
|
|
5
|
+
<marker id="m7c3aed" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#7c3aed"/></marker>
|
|
6
|
+
<pattern id="grid" width="16" height="16" patternUnits="userSpaceOnUse"><circle cx="8" cy="8" r="1" fill="#e2e8f0"/></pattern>
|
|
7
|
+
<filter id="shadow" x="-10%" y="-20%" width="120%" height="160%"><feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#0f172a" flood-opacity="0.10"/></filter>
|
|
8
|
+
</defs>
|
|
9
|
+
<rect width="1000" height="540" fill="#ffffff"/>
|
|
10
|
+
<rect width="1000" height="540" fill="url(#grid)"/>
|
|
11
|
+
<text x="500.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="14" font-weight="600" fill="#0f172a" text-anchor="middle">Movement and position</text>
|
|
12
|
+
<rect x="40" y="60" width="920" height="190" rx="12" fill="#f8fafc" stroke="#e2e8f0"/>
|
|
13
|
+
<text x="54.0" y="78.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="10" font-weight="600" fill="#94a3b8" text-anchor="start" letter-spacing="1">MOVEMENT — ONE PER POSITION, THE UUID RETURNED BY STAKE NEVER CHANGES</text>
|
|
14
|
+
<rect x="59" y="111" width="58" height="22" rx="11.0" fill="#f1f5f9"/>
|
|
15
|
+
<text x="88.0" y="126.0" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="11" font-weight="500" fill="#475569" text-anchor="middle">STAKE</text>
|
|
16
|
+
<path d="M223,122 H245" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
17
|
+
<path d="M327,122 H349" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
18
|
+
<rect x="128" y="107" width="93" height="30" rx="15.0" fill="#eef2ff"/>
|
|
19
|
+
<text x="174.4" y="126.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">REQUESTED</text>
|
|
20
|
+
<rect x="247" y="107" width="78" height="30" rx="15.0" fill="#eef2ff"/>
|
|
21
|
+
<text x="286.0" y="126.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">PENDING</text>
|
|
22
|
+
<rect x="351" y="107" width="93" height="30" rx="15.0" fill="#dcfce7"/>
|
|
23
|
+
<text x="397.6" y="126.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#15803d" text-anchor="middle">COMPLETED</text>
|
|
24
|
+
<path d="M174,139 V166" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
25
|
+
<rect x="139" y="171" width="71" height="26" rx="13.0" fill="#fee2e2"/>
|
|
26
|
+
<text x="174.4" y="188.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#b91c1c" text-anchor="middle">FAILED</text>
|
|
27
|
+
<path d="M286,139 V166" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
28
|
+
<rect x="243" y="171" width="86" height="26" rx="13.0" fill="#f1f5f9"/>
|
|
29
|
+
<text x="286.0" y="188.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#475569" text-anchor="middle">CANCELED</text>
|
|
30
|
+
<path d="M446,122 H576.0" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
31
|
+
<rect x="452" y="110" width="98" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
32
|
+
<text x="501.0" y="126.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">full unstake</text>
|
|
33
|
+
<rect x="580" y="111" width="72" height="22" rx="11.0" fill="#f1f5f9"/>
|
|
34
|
+
<text x="616.0" y="126.0" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="11" font-weight="500" fill="#475569" text-anchor="middle">UNSTAKE</text>
|
|
35
|
+
<path d="M756,122 H828" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
36
|
+
<rect x="759" y="110" width="66" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
37
|
+
<text x="791.8" y="126.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">closing</text>
|
|
38
|
+
<rect x="661" y="107" width="93" height="30" rx="15.0" fill="#eef2ff"/>
|
|
39
|
+
<text x="707.4" y="126.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">REQUESTED</text>
|
|
40
|
+
<rect x="830" y="107" width="93" height="30" rx="15.0" fill="#dcfce7"/>
|
|
41
|
+
<text x="876.2" y="126.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#15803d" text-anchor="middle">COMPLETED</text>
|
|
42
|
+
<text x="791.8" y="162.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle" font-style="italic">the same movement, same uuid, rewritten</text>
|
|
43
|
+
<text x="791.8" y="178.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle">kind <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">UNSTAKE</tspan>, state <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">REQUESTED</tspan> then <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">COMPLETED</tspan></text>
|
|
44
|
+
<text x="500.0" y="226.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle">Read a movement · List movements (<tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">direction</tspan> <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">STAKE</tspan> or <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">UNSTAKE</tspan>) · List pending movements: <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">REQUESTED</tspan>, <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">PENDING</tspan>, <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">FAILED</tspan></text>
|
|
45
|
+
<rect x="40" y="280" width="920" height="236" rx="12" fill="#f8fafc" stroke="#e2e8f0"/>
|
|
46
|
+
<text x="54.0" y="298.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="10" font-weight="600" fill="#94a3b8" text-anchor="start" letter-spacing="1">POSITION — STAKING.UUID OF THE MOVEMENT, THE CAPITAL PLACED WITH THE PROVIDER</text>
|
|
47
|
+
<path d="M232,380 H356" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
48
|
+
<rect x="252" y="368" width="85" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
49
|
+
<text x="294.0" y="384.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">validation</text>
|
|
50
|
+
<path d="M438,380 H574" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
51
|
+
<rect x="458" y="368" width="98" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
52
|
+
<text x="506.4" y="384.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">full unstake</text>
|
|
53
|
+
<path d="M671,380 H775" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
54
|
+
<rect x="690" y="368" width="66" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
55
|
+
<text x="723.2" y="384.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">closing</text>
|
|
56
|
+
<rect x="152" y="365" width="78" height="30" rx="15.0" fill="#eef2ff"/>
|
|
57
|
+
<text x="190.8" y="384.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">CREATED</text>
|
|
58
|
+
<rect x="358" y="365" width="78" height="30" rx="15.0" fill="#eef2ff"/>
|
|
59
|
+
<text x="397.2" y="384.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">ENABLED</text>
|
|
60
|
+
<rect x="576" y="365" width="93" height="30" rx="15.0" fill="#eef2ff"/>
|
|
61
|
+
<text x="622.8" y="384.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">UNSTAKING</text>
|
|
62
|
+
<rect x="777" y="365" width="71" height="30" rx="15.0" fill="#dcfce7"/>
|
|
63
|
+
<text x="812.8" y="384.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#15803d" text-anchor="middle">CLOSED</text>
|
|
64
|
+
<path d="M191,397 V424" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
65
|
+
<rect x="155" y="429" width="71" height="26" rx="13.0" fill="#fee2e2"/>
|
|
66
|
+
<text x="190.8" y="446.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#b91c1c" text-anchor="middle">FAILED</text>
|
|
67
|
+
<text x="190.8" y="472.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle">transfer failed, or canceled by the platform</text>
|
|
68
|
+
<path d="M379,364 V350 Q379,342 387,342 H407 Q415,342 415,350 V362" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
69
|
+
<rect x="241" y="312" width="312" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
70
|
+
<text x="397.2" y="328.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">partial unstake · claim rewards: stays ENABLED</text>
|
|
71
|
+
<text x="397.2" y="424.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">amount</tspan> / <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">data.rewards</tspan> decrease</text>
|
|
72
|
+
<text x="622.8" y="424.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle">requested by Unstake</text>
|
|
73
|
+
<text x="812.8" y="424.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11" font-weight="400" fill="#475569" text-anchor="middle">closed by the platform</text>
|
|
74
|
+
<text x="500.0" y="500.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle">Claim rewards and Unstake take the position · <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">amount</tspan> becomes the net quantity received when the movement turns <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">PENDING</tspan></text>
|
|
75
|
+
</svg>
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 520" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">The lifecycle of a transaction: the compliance analysis, the nominal path of an incoming and of an outgoing transaction, the hold, the freeze, the refusal and the seizure</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<marker id="mcbd5e1" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#cbd5e1"/></marker>
|
|
5
|
+
<marker id="m7c3aed" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#7c3aed"/></marker>
|
|
6
|
+
<pattern id="grid" width="16" height="16" patternUnits="userSpaceOnUse"><circle cx="8" cy="8" r="1" fill="#e2e8f0"/></pattern>
|
|
7
|
+
<filter id="shadow" x="-10%" y="-20%" width="120%" height="160%"><feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#0f172a" flood-opacity="0.10"/></filter>
|
|
8
|
+
</defs>
|
|
9
|
+
<rect width="1000" height="520" fill="#ffffff"/>
|
|
10
|
+
<rect width="1000" height="520" fill="url(#grid)"/>
|
|
11
|
+
<text x="500.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="14" font-weight="600" fill="#0f172a" text-anchor="middle">The lifecycle of a transaction</text>
|
|
12
|
+
<path d="M178,118 H464" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
13
|
+
<circle cx="300" cy="118" r="4" fill="#7c3aed"/>
|
|
14
|
+
<rect x="338" y="106" width="91" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
15
|
+
<text x="383.2" y="122.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">clean · OUT</text>
|
|
16
|
+
<path d="M576,118 H812" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
17
|
+
<rect x="654" y="106" width="79" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
18
|
+
<text x="693.6" y="122.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">confirmed</text>
|
|
19
|
+
<path d="M300,114 V78 Q300,70 308,70 H852 Q860,70 860,78 V101" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
20
|
+
<rect x="538" y="58" width="85" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
21
|
+
<text x="580.0" y="74.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">clean · IN</text>
|
|
22
|
+
<path d="M130,135 V262 Q130,268 136,268 H259" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
23
|
+
<rect x="169" y="256" width="54" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
24
|
+
<text x="195.4" y="272.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">alert</text>
|
|
25
|
+
<path d="M341,268 H482" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
26
|
+
<rect x="382" y="256" width="60" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
27
|
+
<text x="411.8" y="272.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">frozen</text>
|
|
28
|
+
<path d="M558,268 H702" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
29
|
+
<rect x="600" y="256" width="60" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
30
|
+
<text x="630.0" y="272.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">seized</text>
|
|
31
|
+
<path d="M300,251 V123" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
32
|
+
<path d="M505,251 V198 Q505,192 499,192 H304" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4"/>
|
|
33
|
+
<rect x="261" y="180" width="79" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
34
|
+
<text x="300.0" y="196.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">validated</text>
|
|
35
|
+
<path d="M300,285 V402 Q300,408 306,408 H482" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
36
|
+
<rect x="359" y="396" width="66" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
37
|
+
<text x="392.2" y="412.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">refused</text>
|
|
38
|
+
<path d="M520,285 V391" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
39
|
+
<rect x="487" y="330" width="66" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
40
|
+
<text x="520.0" y="346.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">refused</text>
|
|
41
|
+
<path d="M545,133 V152 Q545,158 551,158 H814 Q820,158 820,164 V402 Q820,408 814,408 H558" fill="none" stroke="#cbd5e1" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#mcbd5e1)"/>
|
|
42
|
+
<rect x="759" y="330" width="123" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
43
|
+
<text x="820.0" y="346.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">execution failed</text>
|
|
44
|
+
<rect x="84" y="103" width="93" height="30" rx="15.0" fill="#eef2ff"/>
|
|
45
|
+
<text x="130.0" y="122.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">ANALYZING</text>
|
|
46
|
+
<rect x="466" y="103" width="107" height="30" rx="15.0" fill="#eef2ff"/>
|
|
47
|
+
<text x="520.0" y="122.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">TRANSFERING</text>
|
|
48
|
+
<rect x="814" y="103" width="93" height="30" rx="15.0" fill="#dcfce7"/>
|
|
49
|
+
<text x="860.0" y="122.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#15803d" text-anchor="middle">COMPLETED</text>
|
|
50
|
+
<rect x="261" y="253" width="78" height="30" rx="15.0" fill="#eef2ff"/>
|
|
51
|
+
<text x="300.0" y="272.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">PENDING</text>
|
|
52
|
+
<rect x="484" y="253" width="71" height="30" rx="15.0" fill="#eef2ff"/>
|
|
53
|
+
<text x="520.0" y="272.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#4338ca" text-anchor="middle">FROZEN</text>
|
|
54
|
+
<rect x="704" y="253" width="71" height="30" rx="15.0" fill="#fef3c7"/>
|
|
55
|
+
<text x="740.0" y="272.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#b45309" text-anchor="middle">SEIZED</text>
|
|
56
|
+
<rect x="484" y="393" width="71" height="30" rx="15.0" fill="#fee2e2"/>
|
|
57
|
+
<text x="520.0" y="412.3" font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="12" font-weight="600" fill="#b91c1c" text-anchor="middle">FAILED</text>
|
|
58
|
+
<text x="500.0" y="466.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle" font-style="italic"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">credited</tspan> turns <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">true</tspan> right after <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">COMPLETED</tspan> on an incoming transaction.</text>
|
|
59
|
+
<text x="500.0" y="484.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle" font-style="italic">A <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">FAILED</tspan> or <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">SEIZED</tspan> deposit is returned or seized by a separate outgoing transaction.</text>
|
|
60
|
+
<text x="500.0" y="502.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle" font-style="italic"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">COMPLETED</tspan>, <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">FAILED</tspan> and <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">SEIZED</tspan> are terminal.</text>
|
|
61
|
+
</svg>
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 540" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">Receiving a webhook delivery: the POST, its verification, the 2xx answer and the retries</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<marker id="m0d9488" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#0d9488"/></marker>
|
|
5
|
+
<marker id="m7c3aed" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#7c3aed"/></marker>
|
|
6
|
+
<pattern id="grid" width="16" height="16" patternUnits="userSpaceOnUse"><circle cx="8" cy="8" r="1" fill="#e2e8f0"/></pattern>
|
|
7
|
+
<filter id="shadow" x="-10%" y="-20%" width="120%" height="160%"><feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#0f172a" flood-opacity="0.10"/></filter>
|
|
8
|
+
</defs>
|
|
9
|
+
<rect width="1000" height="540" fill="#ffffff"/>
|
|
10
|
+
<rect width="1000" height="540" fill="url(#grid)"/>
|
|
11
|
+
<text x="500.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="14" font-weight="600" fill="#0f172a" text-anchor="middle">Receiving a delivery</text>
|
|
12
|
+
<line x1="250" y1="48" x2="250" y2="524" stroke="#e2e8f0" stroke-width="2"/>
|
|
13
|
+
<rect x="248" y="21" width="4" height="18" rx="2" fill="#7c3aed"/>
|
|
14
|
+
<text x="260.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">BITGEN</text>
|
|
15
|
+
<line x1="750" y1="48" x2="750" y2="524" stroke="#e2e8f0" stroke-width="2"/>
|
|
16
|
+
<rect x="748" y="21" width="4" height="18" rx="2" fill="#0d9488"/>
|
|
17
|
+
<text x="760.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">Your endpoint</text>
|
|
18
|
+
<rect x="247" y="82" width="6" height="100" rx="3" fill="#7c3aed"/>
|
|
19
|
+
<rect x="747" y="82" width="6" height="100" rx="3" fill="#0d9488"/>
|
|
20
|
+
<path d="M254,132 H745" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
21
|
+
<rect x="310" y="78" width="380" height="108" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
22
|
+
<text x="326.0" y="102.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">POST — the delivery</text>
|
|
23
|
+
<text x="326.0" y="122.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">Content-Type: application/json</tspan></text>
|
|
24
|
+
<text x="326.0" y="139.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">X-BITGEN-Timestamp: <epoch seconds></tspan></text>
|
|
25
|
+
<text x="326.0" y="156.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">X-BITGEN-Signature: sha256=<hex></tspan></text>
|
|
26
|
+
<text x="326.0" y="173.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">{ delivery_id, timestamp, event, data }</tspan></text>
|
|
27
|
+
<rect x="747" y="204" width="6" height="132" rx="3" fill="#0d9488"/>
|
|
28
|
+
<rect x="550" y="208" width="400" height="124" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
29
|
+
<text x="566.0" y="232.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Verify the delivery</text>
|
|
30
|
+
<text x="566.0" y="252.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">1 · Recompute <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">HMAC_SHA256(secret, "<timestamp>.<rawBody>")</tspan></text>
|
|
31
|
+
<text x="566.0" y="269.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">    on the raw body, with the timestamp of the header</text>
|
|
32
|
+
<text x="566.0" y="286.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">2 · Compare it with <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">X-BITGEN-Signature</tspan> in constant time</text>
|
|
33
|
+
<text x="566.0" y="303.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">3 · Reject it when <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">X-BITGEN-Timestamp</tspan> is more than 300 s away</text>
|
|
34
|
+
<text x="566.0" y="320.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">4 · Only then, parse the body</text>
|
|
35
|
+
<rect x="247" y="362" width="6" height="36" rx="3" fill="#7c3aed"/>
|
|
36
|
+
<rect x="747" y="362" width="6" height="36" rx="3" fill="#0d9488"/>
|
|
37
|
+
<path d="M746,380 H255" fill="none" stroke="#0d9488" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m0d9488)"/>
|
|
38
|
+
<rect x="410" y="364" width="180" height="32" rx="10" fill="#dcfce7" stroke="#bbf7d0" filter="url(#shadow)"/>
|
|
39
|
+
<text x="500.0" y="384.3" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#15803d" text-anchor="middle"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">2xx</tspan> — delivered</text>
|
|
40
|
+
<rect x="247" y="428" width="6" height="68" rx="3" fill="#7c3aed"/>
|
|
41
|
+
<rect x="747" y="428" width="6" height="68" rx="3" fill="#0d9488"/>
|
|
42
|
+
<path d="M254,462 H745" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" stroke-dasharray="4 4" marker-end="url(#m7c3aed)"/>
|
|
43
|
+
<rect x="310" y="428" width="380" height="68" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
44
|
+
<text x="326.0" y="452.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">No 2xx: the delivery is retried 4 times</text>
|
|
45
|
+
<rect x="326" y="466" width="85" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
46
|
+
<text x="368.0" y="482.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">after 60 s</text>
|
|
47
|
+
<rect x="429" y="466" width="54" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
48
|
+
<text x="456.0" y="482.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">5 min</text>
|
|
49
|
+
<rect x="504" y="466" width="60" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
50
|
+
<text x="534.0" y="482.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">15 min</text>
|
|
51
|
+
<rect x="584" y="466" width="41" height="24" rx="12.0" fill="#f1f5f9"/>
|
|
52
|
+
<text x="604.0" y="482.1" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="500" fill="#475569" text-anchor="middle">1 h</text>
|
|
53
|
+
</svg>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600" role="img" aria-labelledby="title">
|
|
2
|
+
<title id="title">An EUR withdrawal: the reserve on the ledger, the compliance analysis, the wire from the organization account to the customer IBAN, the debit at confirmation</title>
|
|
3
|
+
<defs>
|
|
4
|
+
<marker id="md97706" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#d97706"/></marker>
|
|
5
|
+
<marker id="m7c3aed" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#7c3aed"/></marker>
|
|
6
|
+
<marker id="m0d9488" viewBox="0 0 8 8" refX="7" refY="4" markerWidth="8" markerHeight="8" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0.5 L7,4 L0,7.5 z" fill="#0d9488"/></marker>
|
|
7
|
+
<pattern id="grid" width="16" height="16" patternUnits="userSpaceOnUse"><circle cx="8" cy="8" r="1" fill="#e2e8f0"/></pattern>
|
|
8
|
+
<filter id="shadow" x="-10%" y="-20%" width="120%" height="160%"><feDropShadow dx="0" dy="1" stdDeviation="2" flood-color="#0f172a" flood-opacity="0.10"/></filter>
|
|
9
|
+
</defs>
|
|
10
|
+
<rect width="1000" height="600" fill="#ffffff"/>
|
|
11
|
+
<rect width="1000" height="600" fill="url(#grid)"/>
|
|
12
|
+
<line x1="110" y1="48" x2="110" y2="520" stroke="#e2e8f0" stroke-width="2"/>
|
|
13
|
+
<rect x="108" y="21" width="4" height="18" rx="2" fill="#0f172a"/>
|
|
14
|
+
<text x="120.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">Customer</text>
|
|
15
|
+
<line x1="370" y1="48" x2="370" y2="520" stroke="#e2e8f0" stroke-width="2"/>
|
|
16
|
+
<rect x="368" y="21" width="4" height="18" rx="2" fill="#d97706"/>
|
|
17
|
+
<text x="380.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">Bank provider (holds the funds)</text>
|
|
18
|
+
<line x1="630" y1="48" x2="630" y2="520" stroke="#e2e8f0" stroke-width="2"/>
|
|
19
|
+
<rect x="628" y="21" width="4" height="18" rx="2" fill="#7c3aed"/>
|
|
20
|
+
<text x="640.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">BITGEN ledger</text>
|
|
21
|
+
<line x1="870" y1="48" x2="870" y2="520" stroke="#e2e8f0" stroke-width="2"/>
|
|
22
|
+
<rect x="868" y="21" width="4" height="18" rx="2" fill="#0d9488"/>
|
|
23
|
+
<text x="880.0" y="34.5" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="13" font-weight="600" fill="#0f172a" text-anchor="start">Your organization</text>
|
|
24
|
+
<rect x="867" y="62" width="6" height="108" rx="3" fill="#0d9488"/>
|
|
25
|
+
<rect x="627" y="62" width="6" height="108" rx="3" fill="#7c3aed"/>
|
|
26
|
+
<path d="M866,116 H635" fill="none" stroke="#0d9488" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m0d9488)"/>
|
|
27
|
+
<rect x="650" y="62" width="200" height="108" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
28
|
+
<text x="666.0" y="86.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Withdraw</text>
|
|
29
|
+
<text x="666.0" y="106.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">amount</tspan> 50.00 EUR, to the IBAN</text>
|
|
30
|
+
<text x="666.0" y="123.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">→ <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">200 { transaction }</tspan></text>
|
|
31
|
+
<text x="666.0" y="140.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">reserved: <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">pending.out</tspan> 50,</text>
|
|
32
|
+
<text x="666.0" y="157.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">balance</tspan> untouched</text>
|
|
33
|
+
<rect x="627" y="178" width="6" height="92" rx="3" fill="#7c3aed"/>
|
|
34
|
+
<rect x="867" y="178" width="6" height="92" rx="3" fill="#0d9488"/>
|
|
35
|
+
<path d="M634,224 H865" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
36
|
+
<rect x="650" y="178" width="200" height="92" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
37
|
+
<text x="666.0" y="202.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Compliance analysis</text>
|
|
38
|
+
<text x="666.0" y="222.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">transaction <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">BANK</tspan> <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">OUT</tspan></text>
|
|
39
|
+
<text x="666.0" y="239.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">event <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">bank.transaction</tspan>,</text>
|
|
40
|
+
<text x="666.0" y="256.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">PENDING</tspan> if an alert holds it</text>
|
|
41
|
+
<rect x="627" y="285" width="6" height="74" rx="3" fill="#7c3aed"/>
|
|
42
|
+
<rect x="367" y="285" width="6" height="74" rx="3" fill="#d97706"/>
|
|
43
|
+
<path d="M626,322 H375" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
44
|
+
<rect x="400" y="285" width="200" height="74" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
45
|
+
<text x="416.0" y="309.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Wire ordered</text>
|
|
46
|
+
<text x="416.0" y="329.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">from the organization's account</text>
|
|
47
|
+
<text x="416.0" y="346.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">to the customer's IBAN</text>
|
|
48
|
+
<rect x="367" y="374" width="6" height="60" rx="3" fill="#d97706"/>
|
|
49
|
+
<rect x="107" y="374" width="6" height="60" rx="3" fill="#0f172a"/>
|
|
50
|
+
<path d="M366,404 H115" fill="none" stroke="#d97706" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#md97706)"/>
|
|
51
|
+
<rect x="140" y="374" width="200" height="60" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
52
|
+
<text x="156.0" y="398.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Wire transfer</text>
|
|
53
|
+
<text x="156.0" y="418.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">the customer receives <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">net</tspan></text>
|
|
54
|
+
<rect x="627" y="436" width="6" height="108" rx="3" fill="#7c3aed"/>
|
|
55
|
+
<rect x="867" y="436" width="6" height="108" rx="3" fill="#0d9488"/>
|
|
56
|
+
<path d="M634,490 H865" fill="none" stroke="#7c3aed" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" marker-end="url(#m7c3aed)"/>
|
|
57
|
+
<rect x="650" y="436" width="200" height="108" rx="10" fill="#ffffff" stroke="#e2e8f0" filter="url(#shadow)"/>
|
|
58
|
+
<text x="666.0" y="460.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="12" font-weight="600" fill="#0f172a" text-anchor="start">Debited, at confirmation</text>
|
|
59
|
+
<text x="666.0" y="480.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">balance</tspan> debited,</text>
|
|
60
|
+
<text x="666.0" y="497.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">operation <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">WITHDRAWAL</tspan></text>
|
|
61
|
+
<text x="666.0" y="514.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start">event <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">bank.debited</tspan>: <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">amount</tspan>, <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">fee</tspan>, <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">net</tspan></text>
|
|
62
|
+
<text x="666.0" y="531.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="start"><tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">bank.transaction</tspan> <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">COMPLETED</tspan></text>
|
|
63
|
+
<text x="500.0" y="566.0" font-family="Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif" font-size="11.5" font-weight="400" fill="#475569" text-anchor="middle" font-style="italic">If it fails, the reserve is released: <tspan font-family="'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="0.92em" font-weight="600">pending.out</tspan> goes back down.</text>
|
|
64
|
+
</svg>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# API keys
|
|
2
2
|
|
|
3
|
-
An API key belongs to your organization: it is valid until it expires or is revoked, and every call made with it is journaled. `client.apikeys` reads the keys of your organization and the journal of their calls — it is read-only: a key
|
|
3
|
+
An API key belongs to your organization: it is valid until it expires or is revoked, and every call made with it is journaled. `client.apikeys` reads the keys of your organization and the journal of their calls — it is read-only: a key is created, configured and revoked by an administrator of the organization, in the BITGEN interface — never through the API, and the SDK does not revoke.
|
|
4
4
|
|
|
5
5
|
Examples use `client`, a configured `BitgenClient` ([Configuration](../configuration.md)). Wherever the API expects your organization, the SDK sends the `scope` of the client.
|
|
6
6
|
|
|
@@ -14,7 +14,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
|
|
|
14
14
|
|
|
15
15
|
TypeScript types of this resource, exported by the package: `Apikey`, `ApikeyLog`, `ApikeyListParams` — the constant `ApikeyState` (also a type) — plus the shared `PageParams`.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## List
|
|
18
18
|
|
|
19
19
|
```
|
|
20
20
|
client.apikeys.list(params?: ApikeyListParams): Promise<Page<Apikey>>
|
|
@@ -37,7 +37,7 @@ for (const key of items) {
|
|
|
37
37
|
|
|
38
38
|
Returns a page of `Apikey` ([get](#get)).
|
|
39
39
|
|
|
40
|
-
##
|
|
40
|
+
## Get
|
|
41
41
|
|
|
42
42
|
```
|
|
43
43
|
client.apikeys.get(apikey: string | Apikey): Promise<Apikey>
|
|
@@ -66,7 +66,7 @@ Returns an `Apikey`:
|
|
|
66
66
|
|
|
67
67
|
An unknown uuid answers `404 unknown_apikey`. The raw key itself is never returned: it is shown once, when the key is created.
|
|
68
68
|
|
|
69
|
-
##
|
|
69
|
+
## Logs
|
|
70
70
|
|
|
71
71
|
```
|
|
72
72
|
client.apikeys.logs(apikey: string | Apikey, params?: PageParams): Promise<Page<ApikeyLog>>
|
package/readme/resource/asset.md
CHANGED
|
@@ -15,7 +15,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
|
|
|
15
15
|
|
|
16
16
|
TypeScript types of this resource, exported by the package: `AssetTicker`, `AssetFees`, `AssetNetworkType`, `AssetNetwork`, `Asset` — the constants `AssetState` (also a type) and `Asset` (the ISO codes, a value only: the `Asset` type is the model) — plus the shared `AssetRef`, `AssetInput`, `History`.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## List
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
client.asset.list(): Promise<Page<Asset>>
|
|
@@ -34,7 +34,7 @@ for (const asset of available) {
|
|
|
34
34
|
|
|
35
35
|
Returns a page of `Asset` ([get](#get)).
|
|
36
36
|
|
|
37
|
-
##
|
|
37
|
+
## Get
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
client.asset.get(asset: AssetInput): Promise<Asset>
|
|
@@ -70,7 +70,7 @@ Returns an `Asset`:
|
|
|
70
70
|
|
|
71
71
|
An unknown uuid or ISO code answers `404 unknown_asset`.
|
|
72
72
|
|
|
73
|
-
##
|
|
73
|
+
## Tickers
|
|
74
74
|
|
|
75
75
|
```
|
|
76
76
|
client.asset.tickers(): Promise<Page<{ iso: string, ticker: AssetTicker }>>
|
|
@@ -86,7 +86,7 @@ for (const { iso, ticker } of items) {
|
|
|
86
86
|
|
|
87
87
|
Returns, for every asset, its `iso` and its `ticker` (`AssetTicker`): `price` and `marketcap` (in EUR), `rank` (market cap rank), `percentChange24h` (24-hour change, in %).
|
|
88
88
|
|
|
89
|
-
##
|
|
89
|
+
## Ticker
|
|
90
90
|
|
|
91
91
|
```
|
|
92
92
|
client.asset.ticker(iso: string): Promise<{ iso: string, ticker: AssetTicker, history: History }>
|
package/readme/resource/bank.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Bank accounts
|
|
2
2
|
|
|
3
|
-
Every customer has an EUR account on the BITGEN platform: a ledger
|
|
3
|
+
Every customer has an EUR account on the BITGEN platform: a **ledger** of the EUR they hold with the bank provider of your organization — the provider receives their bank transfers and pays their withdrawals to their IBAN, BITGEN keeps the account and notifies you ([Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal)). The balance pays their purchases and is credited by their sales. `client.bank` reads the account and its operations, withdraws EUR, and credits deposits.
|
|
4
4
|
|
|
5
5
|
Examples use `client`, a configured `BitgenClient` ([Configuration](../configuration.md)). A customer is designated by a `UserRef`: their uuid, or a model carrying it, such as the `Created` returned by `client.customer.create` ([User references](../concepts.md#user-references)). The customer must belong to your organization and be activated, otherwise the API answers `404 unknown_bank` ([Activation and identity](../concepts.md#activation-and-identity)).
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
|
|
|
15
15
|
|
|
16
16
|
TypeScript types of this resource, exported by the package: `BankAccount`, `BankOperation`, `BankOperationsParams`, `BankWithdrawParams`, `BankCreditParams` — the constant `BankDirection` (also a type) — plus the shared `UserRef`, `Created`, `Amount`.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Get
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
client.bank.get(user: UserRef): Promise<BankAccount>
|
|
@@ -42,10 +42,10 @@ Returns a `BankAccount`:
|
|
|
42
42
|
| `message` | The wire transfer reference the customer must indicate (`BTGN` prefix) |
|
|
43
43
|
| `iban`, `bank`, `bic` | The customer's bank details, `null` until set — `withdraw` can set them |
|
|
44
44
|
| `balance` | EUR balance (number) |
|
|
45
|
-
| `pending` | `{ in, out }` —
|
|
45
|
+
| `pending` | `{ in, out }` — `in`: reported deposits not credited yet (BITGEN processing and compliance analysis); `out`: withdrawals requested and purchase reserves, not settled yet |
|
|
46
46
|
| `history` | EUR balance curve, a `History` ([Timestamps and histories](../concepts.md#timestamps-and-histories)); `{}` until the hourly computation has run for this account |
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Operations
|
|
49
49
|
|
|
50
50
|
```
|
|
51
51
|
client.bank.operations(user: UserRef, params?: BankOperationsParams): Promise<Page<BankOperation>>
|
|
@@ -75,7 +75,7 @@ for (const operation of items) {
|
|
|
75
75
|
|
|
76
76
|
Returns a page of `BankOperation`: `txId` (identifier of the ledger entry), `amount` (EUR, number), `direction` (`BankDirection.DEPOSIT`, `WITHDRAWAL`, `PURCHASE` or `SELL` — never `ALL`), `date` (epoch seconds), `info` (free label of the operation — for instance the asset bought or sold — or `null`).
|
|
77
77
|
|
|
78
|
-
##
|
|
78
|
+
## Withdraw
|
|
79
79
|
|
|
80
80
|
```
|
|
81
81
|
client.bank.withdraw(user: UserRef, params: BankWithdrawParams): Promise<{ transaction: string }>
|
|
@@ -96,15 +96,17 @@ const { transaction } = await client.bank.withdraw('CUSTOMER_UUID', {
|
|
|
96
96
|
const movement = await client.transaction.get(transaction) // follow the withdrawal in the transaction journal
|
|
97
97
|
```
|
|
98
98
|
|
|
99
|
-
The withdrawal goes to the customer's IBAN: the account must have bank details (`412 bank_rib_required`), a sufficient balance (`416 requested_amount_error`) and an amount above the fee (`416 amount_below_fee`). `transaction`
|
|
99
|
+
The withdrawal goes to the customer's IBAN: the amount is reserved in `pending.out` and debited from the balance when the provider confirms the wire; the event `bank.debited` reports it then, with `amount`, `fee` and `net` — what the customer receives ([Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal)). The account must have bank details (`412 bank_rib_required`), a sufficient balance (`416 requested_amount_error`) and an amount above the fee (`416 amount_below_fee`). `transaction` identifies the withdrawal — its `Transaction` in the journal ([Transactions](transaction.md)).
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+

|
|
102
|
+
|
|
103
|
+
## Credit
|
|
102
104
|
|
|
103
105
|
```
|
|
104
106
|
client.bank.credit(params: BankCreditParams): Promise<Created>
|
|
105
107
|
```
|
|
106
108
|
|
|
107
|
-
`credit` only applies when your organization's bank provider is **manual** — deposits are not reported to BITGEN automatically: you tell BITGEN a wire has arrived
|
|
109
|
+
`credit` only applies when your organization's bank provider is **manual** — deposits are not reported to BITGEN automatically: you tell BITGEN a wire has arrived on the organization's account. The amount enters `pending.in`, goes through BITGEN's processing and the compliance analysis, and the account is credited then — `bank.credited` at that moment ([Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal)). On a provider that **takes the declaration and reports the deposit itself** — the test bank of the sandbox environment — the call answers `202` with an empty body: the incoming movement appears in `pending.in` a few seconds later, once the provider has reported it, and the `bank.transaction` / `bank.credited` events follow as for any deposit. With an automated provider that refuses declarations, deposits are detected and credited automatically and you are notified by the `bank.credited` webhook ([Webhooks](webhooks.md)) — do not call `credit`: the API refuses it (`412 deposit_reported_by_provider`). The account is designated either by the customer (`user`) or by the wire transfer reference of the account (`message`).
|
|
108
110
|
|
|
109
111
|
| Parameter | Type | Description |
|
|
110
112
|
|---|---|---|
|
|
@@ -112,7 +114,7 @@ client.bank.credit(params: BankCreditParams): Promise<Created>
|
|
|
112
114
|
| `params.currency` | `'EUR'` | Optional |
|
|
113
115
|
| `params.user` | `UserRef` | The customer — or `message` |
|
|
114
116
|
| `params.message` | `string` | The wire transfer reference of the account (`BTGN…`) — or `user` |
|
|
115
|
-
| `params.reference` | `string` | The bank's transfer reference — it makes the call idempotent: calling twice with the same reference
|
|
117
|
+
| `params.reference` | `string` | The bank's transfer reference — it makes the call idempotent: calling twice with the same reference declares once (and returns the same `uuid`) |
|
|
116
118
|
|
|
117
119
|
```ts
|
|
118
120
|
const { uuid } = await client.bank.credit({
|
|
@@ -122,7 +124,9 @@ const { uuid } = await client.bank.credit({
|
|
|
122
124
|
})
|
|
123
125
|
```
|
|
124
126
|
|
|
125
|
-
Returns a `Created` — the `uuid`
|
|
127
|
+
Returns a `Created` — the `uuid` of the declared deposit: the incoming movement, not credited yet. On a `202` (provider that reports the deposit itself, see above) `uuid` is `undefined`. Without `user` nor `message`, the API answers `400 bank_target_required`.
|
|
128
|
+
|
|
129
|
+

|
|
126
130
|
|
|
127
131
|
## Errors
|
|
128
132
|
|
|
@@ -139,7 +143,7 @@ In addition to the [common errors](../errors.md#common-errors):
|
|
|
139
143
|
| `412` | `owner_identity_not_validated` | Your organization uses BITGEN's identity verification and the customer's identity is not validated: the account cannot be created |
|
|
140
144
|
| `412` | `bank_rib_required` | `withdraw` without an IBAN or a bank on the account |
|
|
141
145
|
| `412` | `ramp_not_enabled` | The `CoreType.RAMP` (bank) connector of your organization is not enabled |
|
|
142
|
-
| `412` | `deposit_reported_by_provider` | `credit` on an automated bank provider: deposits are reported by the provider itself |
|
|
146
|
+
| `412` | `deposit_reported_by_provider` | `credit` on an automated bank provider that refuses declarations: deposits are reported by the provider itself |
|
|
143
147
|
| `412` | `trading_not_enabled` | The `CoreType.TRADING` connector of your organization is not enabled |
|
|
144
148
|
| `416` | `requested_amount_error` | Insufficient balance |
|
|
145
149
|
| `416` | `amount_below_fee` | The amount does not cover the fee |
|
|
@@ -150,6 +154,7 @@ In addition to the [common errors](../errors.md#common-errors):
|
|
|
150
154
|
|
|
151
155
|
## Related
|
|
152
156
|
|
|
157
|
+
- [Following a deposit and a withdrawal](../concepts.md#following-a-deposit-and-a-withdrawal) — who holds the funds, what the ledger shows, when the events are sent
|
|
153
158
|
- [Amounts](../concepts.md#amounts) — EUR amounts as strings, 2 decimals
|
|
154
159
|
- [Trading](trading.md) — purchases paid from the EUR balance, sales credited to it
|
|
155
160
|
- [Transactions](transaction.md) — the journal where withdrawals appear
|
package/readme/resource/core.md
CHANGED
|
@@ -15,7 +15,7 @@ TypeScript types of this resource, exported by the package: `CoreConfigField`, `
|
|
|
15
15
|
|
|
16
16
|
The catalogue is managed by BITGEN. Which connectors your organization uses, and their configuration, are set in the BITGEN interface — not through the API.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## List
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
client.core.list(params?: CoreListParams): Promise<Page<Core>>
|
|
@@ -44,7 +44,7 @@ for (const provider of providers.items) {
|
|
|
44
44
|
|
|
45
45
|
Returns the matching `Core` connectors ([get](#get)).
|
|
46
46
|
|
|
47
|
-
##
|
|
47
|
+
## Get
|
|
48
48
|
|
|
49
49
|
```
|
|
50
50
|
client.core.get(core: string | Core): Promise<Core>
|
|
@@ -15,7 +15,7 @@ Examples use `client`, a configured `BitgenClient` ([Configuration](../configura
|
|
|
15
15
|
|
|
16
16
|
TypeScript types of this resource, exported by the package: `Wallet`, `CustodyPortfolio`, `TravelRule`, `CustodyWithdrawParams` — the constants `WalletState`, `WalletType` (also types) — plus the shared `UserRef`, `AssetRef`, `AssetInput`, `Amount`.
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## Wallets
|
|
19
19
|
|
|
20
20
|
```
|
|
21
21
|
client.custody.wallets(user: UserRef): Promise<Wallet[]>
|
|
@@ -45,7 +45,7 @@ Returns the wallets without their `history`:
|
|
|
45
45
|
| `asset` | `AssetRef`: `{ uuid, iso, label }` ([Assets](../concepts.md#assets) — compare `iso` case-insensitively) |
|
|
46
46
|
| `history` | Only on `wallet`: the EUR value curve, a `History` ([Timestamps and histories](../concepts.md#timestamps-and-histories)) — `{}` on a new wallet until the curve has been computed |
|
|
47
47
|
|
|
48
|
-
##
|
|
48
|
+
## Wallet
|
|
49
49
|
|
|
50
50
|
```
|
|
51
51
|
client.custody.wallet(user: UserRef, asset: AssetInput): Promise<Wallet>
|
|
@@ -69,7 +69,7 @@ console.log(wallet.history?.d) // EUR value over the last 24 hours — only
|
|
|
69
69
|
|
|
70
70
|
When the customer has no wallet for this asset yet, the API **provisions** it: a deposit address is created at the custodian. The customer must be activated, not frozen (`403 account_frozen`), with a validated identity if your organization uses BITGEN's identity verification (`403 kyc_not_validated` — [Activation and identity](../concepts.md#activation-and-identity)) and no active compliance alert (`423 blocked_by_alert`). Returns the `Wallet` with its `history`.
|
|
71
71
|
|
|
72
|
-
##
|
|
72
|
+
## Portfolio
|
|
73
73
|
|
|
74
74
|
```
|
|
75
75
|
client.custody.portfolio(user: UserRef): Promise<CustodyPortfolio>
|
|
@@ -83,7 +83,7 @@ console.log(portfolio.history.m) // EUR value of the custody, one point per da
|
|
|
83
83
|
|
|
84
84
|
Returns `{ uuid, type, history }` — `uuid` is the custody account of the customer, `type` is `WalletType.USER` (a customer) or `WalletType.TREASURY` (the organization) — or a flat `{ history }` at zero while the customer has no custody. Customers only: your organization's uuid is refused with `415 custody_portfolio_treasury_unsupported`.
|
|
85
85
|
|
|
86
|
-
##
|
|
86
|
+
## Withdraw
|
|
87
87
|
|
|
88
88
|
```
|
|
89
89
|
client.custody.withdraw(user: UserRef, params: CustodyWithdrawParams): Promise<{ transaction: string | null }>
|